remove first person reference
[pve-docs.git] / pveum.adoc
1 ifdef::manvolnum[]
2 PVE({manvolnum})
3 ================
4 include::attributes.txt[]
5
6 NAME
7 ----
8
9 pveum - Proxmox VE User Manager
10
11
12 SYNOPSYS
13 --------
14
15 include::pveum.1-synopsis.adoc[]
16
17
18 DESCRIPTION
19 -----------
20 endif::manvolnum[]
21
22 ifndef::manvolnum[]
23 User Management
24 ===============
25 include::attributes.txt[]
26 endif::manvolnum[]
27
28 // Copied from pve wiki: Revision as of 16:10, 27 October 2015
29
30 Proxmox VE supports multiple authentication sources, e.g. Microsoft
31 Active Directory, LDAP, Linux PAM or the integrated Proxmox VE
32 authentication server.
33
34 By using the role based user- and permission management for all
35 objects (VMs, storages, nodes, etc.) granular access can be defined.
36
37
38 Authentication Realms
39 ---------------------
40
41 Proxmox VE stores all user attributes in `/etc/pve/user.cfg`. So there
42 must be an entry for each user in that file. The password is not
43 stored, instead you can use configure several realms to verify
44 passwords.
45
46 Microsoft Active Directory::
47
48 LDAP::
49
50 Linux PAM standard authentication::
51
52 You need to create the system users first with `adduser`
53 (e.g. `adduser heinz`) and possibly the group as well. After that you
54 can create the user on the GUI.
55
56 [source,bash]
57 ----
58 useradd heinz
59 passwd heinz
60 groupadd watchman
61 usermod -a -G watchman heinz
62 ----
63
64 Proxmox VE authentication server::
65
66 This is a unix like password store
67 (`/etc/pve/priv/shadow.cfg`). Password are encrypted using the SHA-256
68 hash method. Users are allowed to change passwords.
69
70
71 Terms and Definitions
72 ---------------------
73
74
75 Users
76 ~~~~~
77
78 A Proxmox VE user name consists of two parts: `<userid>@<realm>`. The
79 login screen on the GUI shows them a separate items, but it is
80 internally used as single string.
81
82 We store the following attribute for users (`/etc/pve/user.cfg`):
83
84 * first name
85 * last name
86 * email address
87 * expiration date
88 * flag to enable/disable account
89 * comment
90
91
92 Superuser
93 ^^^^^^^^^
94
95 The traditional unix superuser account is called `root@pam`. All
96 system mails are forwarded to the email assigned to that account.
97
98
99 Groups
100 ~~~~~~
101
102 Each user can be member of several groups. Groups are the preferred
103 way to organize access permissions. You should always grant permission
104 to groups instead of using individual users. That way you will get a
105 much shorter access control list which is easier to handle.
106
107
108 Objects and Paths
109 ~~~~~~~~~~~~~~~~~
110
111 Access permissions are assigned to objects, such as a virtual machines
112 (`/vms/{vmid}`) or a storage (`/storage/{storeid}`) or a pool of
113 resources (`/pool/{poolname}`). We use file system like paths to
114 address those objects. Those paths form a natural tree, and
115 permissions can be inherited down that hierarchy.
116
117
118 Privileges
119 ~~~~~~~~~~
120
121 A privilege is the right to perform a specific action. To simplify
122 management, lists of privileges are grouped into roles, which can then
123 be uses to set permissions.
124
125 We currently use the following privileges:
126
127 Node / System related privileges::
128
129 * `Permissions.Modify`: modify access permissions
130 * `Sys.PowerMgmt`: Node power management (start, stop, reset, shutdown, ...)
131 * `Sys.Console`: console access to Node
132 * `Sys.Syslog`: view Syslog
133 * `Sys.Audit`: view node status/config
134 * `Sys.Modify`: create/remove/modify node network parameters
135 * `Group.Allocate`: create/remove/modify groups
136 * `Pool.Allocate`: create/remove/modify a pool
137 * `Realm.Allocate`: create/remove/modify authentication realms
138 * `Realm.AllocateUser`: assign user to a realm
139 * `User.Modify`: create/remove/modify user access and details.
140
141 Virtual machine related privileges::
142
143 * `VM.Allocate`: create/remove new VM to server inventory
144 * `VM.Migrate`: migrate VM to alternate server on cluster
145 * `VM.PowerMgmt`: power management (start, stop, reset, shutdown, ...)
146 * `VM.Console`: console access to VM
147 * `VM.Monitor`: access to VM monitor (kvm)
148 * `VM.Backup`: backup/restore VMs
149 * `VM.Audit`: view VM config
150 * `VM.Clone`: clone/copy a VM
151 * `VM.Config.Disk`: add/modify/delete Disks
152 * `VM.Config.CDROM`: eject/change CDROM
153 * `VM.Config.CPU`: modify CPU settings
154 * `VM.Config.Memory`: modify Memory settings
155 * `VM.Config.Network`: add/modify/delete Network devices
156 * `VM.Config.HWType`: modify emulated HW type
157 * `VM.Config.Options`: modify any other VM configuration
158 * `VM.Snapshot`: create/remove VM snapshots
159
160 Storage related privileges::
161
162 * `Datastore.Allocate`: create/remove/modify a data store, delete volumes
163 * `Datastore.AllocateSpace`: allocate space on a datastore
164 * `Datastore.AllocateTemplate`: allocate/upload templates and iso images
165 * `Datastore.Audit`: view/browse a datastore
166
167
168 Roles
169 ~~~~~
170
171 A role is simply a list of privileges. Proxmox VE comes with a number
172 of predefined roles which satisfies most needs.
173
174 * `Administrator`: has all privileges
175 * `NoAccess`: has no privileges (used to forbid access)
176 * `PVEAdmin`: can do most things, but miss rights to modify system settings (`Sys.PowerMgmt`, `Sys.Modify`, `Realm.Allocate`).
177 * `PVEAuditor`: read only access
178 * `PVEDatastoreAdmin`: create and allocate backup space and templates
179 * `PVEDatastoreUser`: allocate backup space and view storage
180 * `PVEPoolAdmin`: allocate pools
181 * `PVESysAdmin`: User ACLs, audit, system console and system logs
182 * `PVETemplateUser`: view and clone templates
183 * `PVEUserAdmin`: user administration
184 * `PVEVMAdmin`: fully administer VMs
185 * `PVEVMUser`: view, backup, config CDROM, VM console, VM power management
186
187 You can see the whole set of predefined roles on the GUI.
188
189 Adding new roles using the CLI:
190
191 [source,bash]
192 ----
193 pveum roleadd PVE_Power-only -privs "VM.PowerMgmt VM.Console"
194 pveum roleadd Sys_Power-only -privs "Sys.PowerMgmt Sys.Console"
195 ----
196
197
198 Permissions
199 ~~~~~~~~~~~
200
201 Permissions are the way we control access to objects. In technical
202 terms they are simply a triple containing `<path,user,role>`. This
203 concept is also known as access control lists. Each permission
204 specifies a subject (user or group) and a role (set of privileges) on
205 a specific path.
206
207 When a subject requests an action on an object, the framework looks up
208 the roles assigned to that subject (using the object path). The set of
209 roles defines the granted privileges.
210
211
212 Inheritance
213 ^^^^^^^^^^^
214
215 As mentioned earlier, object paths form a file system like tree, and
216 permissions can be inherited down that tree (the propagate flag is set
217 by default). We use the following inheritance rules:
218
219 * permission for individual users always overwrite group permission.
220 * permission for groups apply when the user is member of that group.
221 * permission set at higher level always overwrites inherited permissions.
222
223
224 What permission do I need?
225 ^^^^^^^^^^^^^^^^^^^^^^^^^^
226
227 The required API permissions are documented for each individual
228 method, and can be found at http://pve.proxmox.com/pve-docs/api-viewer/
229
230
231 Pools
232 ~~~~~
233
234 Pools can be used to group a set of virtual machines and data
235 stores. You can then simply set permissions on pools (`/pool/{poolid}`),
236 which are inherited to all pool members. This is a great way simplify
237 access control.
238
239 Command Line Tool
240 -----------------
241
242 Most users will simply use the GUI to manage users. But there is also
243 a full featured command line tool called `pveum` (short for ``**P**roxmox
244 **VE** **U**ser **M**anager''). Please note that all Proxmox VE command
245 line tools are wrappers around the API, so you can also access those
246 function through the REST API.
247
248 Here are some simple usage examples. To show help type:
249
250 [source,bash]
251 pveum
252
253 or (to show detailed help about a specific command)
254
255 [source,bash]
256 pveum help useradd
257
258 Create a new user:
259
260 [source,bash]
261 pveum useradd testuser@pve -comment "Just a test"
262
263 Set or Change the password (not all realms support that):
264
265 [source,bash]
266 pveum passwd testuser@pve
267
268 Disable a user:
269
270 [source,bash]
271 pveum usermod testuser@pve -enable 0
272
273 Create a new group:
274
275 [source,bash]
276 pveum groupadd testgroup
277
278 Create a new role:
279
280 [source,bash]
281 pveum roleadd PVE_Power-only -privs "VM.PowerMgmt VM.Console"
282
283
284 Real World Examples
285 -------------------
286
287
288 Administrator Group
289 ~~~~~~~~~~~~~~~~~~~
290
291 One of the most wanted features was the ability to define a group of
292 users with full administrator rights (without using the root account).
293
294 Define the group:
295
296 [source,bash]
297 pveum groupadd admin -comment "System Administrators"
298
299 Then add the permission:
300
301 [source,bash]
302 pveum aclmod / -group admin -role Administrator
303
304 You can finally add users to the new 'admin' group:
305
306 [source,bash]
307 pveum usermod testuser@pve -group admin
308
309
310 Auditors
311 ~~~~~~~~
312
313 You can give read only access to users by assigning the `PVEAuditor`
314 role to users or groups.
315
316 Example1: Allow user `joe@pve` to see everything
317
318 [source,bash]
319 pveum aclmod / -user joe@pve -role PVEAuditor
320
321 Example1: Allow user `joe@pve` to see all virtual machines
322
323 [source,bash]
324 pveum aclmod /vms -user joe@pve -role PVEAuditor
325
326
327 Delegate User Management
328 ~~~~~~~~~~~~~~~~~~~~~~~~
329
330 If you want to delegate user managenent to user `joe@pve` you can do
331 that with:
332
333 [source,bash]
334 pveum aclmod /access -user joe@pve -role PVEUserAdmin
335
336 User `joe@pve` can now add and remove users, change passwords and
337 other user attributes. This is a very powerful role, and you most
338 likely want to limit that to selected realms and groups. The following
339 example allows `joe@pve` to modify users within realm `pve` if they
340 are members of group `customers`:
341
342 [source,bash]
343 pveum aclmod /access/realm/pve -user joe@pve -role PVEUserAdmin
344 pveum aclmod /access/groups/customers -user joe@pve -role PVEUserAdmin
345
346 NOTE: The user is able to add other users, but only if they are
347 members of group `customers` and within realm `pve`.
348
349
350 Pools
351 ~~~~~
352
353 An enterprise is usually structured into several smaller departments,
354 and it is common that you want to assign resources to them and
355 delegate management tasks. A pool is simply a set of virtual machines
356 and data stores. You can create pools on the GUI. After that you can
357 add resources to the pool (VMs, Storage).
358
359 You can also assign permissions to the pool. Those permissions are
360 inherited to all pool members.
361
362 Lets assume you have a software development department, so we first
363 create a group
364
365 [source,bash]
366 pveum groupadd developers -comment "Our software developers"
367
368 Now we create a new user which is a member of that group
369
370 [source,bash]
371 pveum useradd developer1@pve -group developers -password
372
373 NOTE: The -password parameter will prompt you for a password
374
375 I assume we already created a pool called ``dev-pool'' on the GUI. So we can now assign permission to that pool:
376
377 [source,bash]
378 pveum aclmod /pool/dev-pool/ -group developers -role PVEAdmin
379
380 Our software developers can now administrate the resources assigned to
381 that pool.
382
383
384 ifdef::manvolnum[]
385 include::pve-copyright.adoc[]
386 endif::manvolnum[]
387