~cloud-init-dev/cloud-init/trunk

« back to all changes in this revision

Viewing changes to doc/examples/cloud-config-user-groups.txt

  • Committer: Scott Moser
  • Date: 2016-08-10 15:06:15 UTC
  • Revision ID: smoser@ubuntu.com-20160810150615-ma2fv107w3suy1ma
README: Mention move of revision control to git.

cloud-init development has moved its revision control to git.
It is available at 
  https://code.launchpad.net/cloud-init

Clone with 
  git clone https://git.launchpad.net/cloud-init
or
  git clone git+ssh://git.launchpad.net/cloud-init

For more information see
  https://git.launchpad.net/cloud-init/tree/HACKING.rst

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Add groups to the system
2
 
# The following example adds the ubuntu group with members foo and bar and
3
 
# the group cloud-users.
4
 
groups:
5
 
  - ubuntu: [foo,bar]
6
 
  - cloud-users
7
 
 
8
 
# Add users to the system. Users are added after groups are added.
9
 
users:
10
 
  - default
11
 
  - name: foobar
12
 
    gecos: Foo B. Bar
13
 
    primary-group: foobar
14
 
    groups: users
15
 
    selinux-user: staff_u
16
 
    expiredate: 2012-09-01
17
 
    ssh-import-id: foobar
18
 
    lock_passwd: false
19
 
    passwd: $6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/
20
 
  - name: barfoo
21
 
    gecos: Bar B. Foo
22
 
    sudo: ALL=(ALL) NOPASSWD:ALL
23
 
    groups: users, admin
24
 
    ssh-import-id: None
25
 
    lock_passwd: true
26
 
    ssh-authorized-keys:
27
 
      - <ssh pub key 1>
28
 
      - <ssh pub key 2>
29
 
  - name: cloudy
30
 
    gecos: Magic Cloud App Daemon User
31
 
    inactive: true
32
 
    system: true
33
 
 
34
 
# Valid Values:
35
 
#   name: The user's login name
36
 
#   gecos: The user name's real name, i.e. "Bob B. Smith"
37
 
#   homedir: Optional. Set to the local path you want to use. Defaults to
38
 
#           /home/<username>
39
 
#   primary-group: define the primary group. Defaults to a new group created
40
 
#           named after the user.
41
 
#   groups:  Optional. Additional groups to add the user to. Defaults to none
42
 
#   selinux-user:  Optional. The SELinux user for the user's login, such as
43
 
#           "staff_u". When this is omitted the system will select the default
44
 
#           SELinux user.
45
 
#   lock_passwd: Defaults to true. Lock the password to disable password login
46
 
#   inactive: Create the user as inactive
47
 
#   passwd: The hash -- not the password itself -- of the password you want
48
 
#           to use for this user. You can generate a safe hash via:
49
 
#               mkpasswd --method=SHA-512 --rounds=4096
50
 
#           (the above command would create from stdin an SHA-512 password hash
51
 
#           with 4096 salt rounds)
52
 
#
53
 
#           Please note: while the use of a hashed password is better than
54
 
#               plain text, the use of this feature is not ideal. Also,
55
 
#               using a high number of salting rounds will help, but it should
56
 
#               not be relied upon.
57
 
#
58
 
#               To highlight this risk, running John the Ripper against the
59
 
#               example hash above, with a readily available wordlist, revealed
60
 
#               the true password in 12 seconds on a i7-2620QM.
61
 
#
62
 
#               In other words, this feature is a potential security risk and is
63
 
#               provided for your convenience only. If you do not fully trust the
64
 
#               medium over which your cloud-config will be transmitted, then you
65
 
#               should use SSH authentication only.
66
 
#
67
 
#               You have thus been warned.
68
 
#   no-create-home: When set to true, do not create home directory.
69
 
#   no-user-group: When set to true, do not create a group named after the user.
70
 
#   no-log-init: When set to true, do not initialize lastlog and faillog database.
71
 
#   ssh-import-id: Optional. Import SSH ids
72
 
#   ssh-authorized-keys: Optional. [list] Add keys to user's authorized keys file
73
 
#   sudo: Defaults to none. Set to the sudo string you want to use, i.e.
74
 
#           ALL=(ALL) NOPASSWD:ALL. To add multiple rules, use the following
75
 
#           format.
76
 
#               sudo:
77
 
#                   - ALL=(ALL) NOPASSWD:/bin/mysql
78
 
#                   - ALL=(ALL) ALL
79
 
#           Note: Please double check your syntax and make sure it is valid.
80
 
#               cloud-init does not parse/check the syntax of the sudo
81
 
#               directive.
82
 
#   system: Create the user as a system user. This means no home directory.
83
 
#
84
 
 
85
 
# Default user creation:
86
 
#
87
 
# Unless you define users, you will get a 'ubuntu' user on ubuntu systems with the
88
 
# legacy permission (no password sudo, locked user, etc). If however, you want
89
 
# to have the 'ubuntu' user in addition to other users, you need to instruct
90
 
# cloud-init that you also want the default user. To do this use the following
91
 
# syntax:
92
 
#    users:
93
 
#      - default
94
 
#      - bob
95
 
#      - ....
96
 
#  foobar: ...
97
 
#
98
 
# users[0] (the first user in users) overrides the user directive.
99
 
#
100
 
# The 'default' user above references the distro's config:
101
 
# system_info:
102
 
#   default_user:
103
 
#    name: Ubuntu
104
 
#    plain_text_passwd: 'ubuntu'
105
 
#    home: /home/ubuntu
106
 
#    shell: /bin/bash
107
 
#    lock_passwd: True
108
 
#    gecos: Ubuntu
109
 
#    groups: [adm, audio, cdrom, dialout, floppy, video, plugdev, dip, netdev]