Simply run sysync --edithost=default
You'll see something akin to this in your favorite text editor:
users:
- uid: 0
username: root
homedir: /root
shell: /bin/bash
password: ''
ssh_keys:
- "ssh-rsa 1XXX"
- "ssh-rsa 2XXX"
- "ssh-rsa 3XXX"
- { uid: 1, username: daemon, homedir: /usr/sbin, shell: /bin/sh }
- { uid: 2, username: bin, homedir: /bin, shell: /bin/sh }
- { uid: 3, username: sys, homedir: /dev, shell: /bin/sh }
- { uid: 8, username: mail, homedir: /var/mail, shell: /bin/sh }
- { uid: 10, username: uucp, homedir: /var/spool/uucp, shell: /bin/sh }
- { uid: 33, username: www-data, homedir: /var/www, shell: /bin/sh }
- { uid: 34, username: backup, homedir: /var/backups, shell: /bin/sh }
- { uid: 65534, username: nobody, homedir: /nonexistent, shell: /bin/sh }
- { uid: 100, gid: 101, username: libuuid, homedir: /var/lib/libuuid, shell: /bin/sh }
- { uid: 101, gid: 103, username: syslog, homedir: /home/syslgo, shell: /bin/false }
- { uid: 102, username: sshd, homedir: /var/run/sshd, shell: /usr/sbin/nologin }
- { uid: 103, username: ntpd, homedir: /var/run/openntpd, shell: /bin/false }
- { uid: 104, username: 'Debian-exim', gid: 109, homedir: /var/spool/exim4, shell: /bin/false }
groups:
- { gid: 4, groupname: adm }
- { gid: 5, groupname: tty }
- { gid: 6, groupname: disk }
- { gid: 7, groupname: lp }
- { gid: 15, groupname: kmem }
- { gid: 24, groupname: cdrom }
- { gid: 25, groupname: floppy }
- { gid: 30, groupname: dip }
- { gid: 37, groupname: operator }
- { gid: 40, groupname: src }
- { gid: 42, groupname: shadow }
- { gid: 43, groupname: utmp }
- { gid: 44, groupname: video }
- { gid: 45, groupname: sasl }
- { gid: 46, groupname: plugdev }
- { gid: 50, groupname: staff }
- { gid: 100, groupname: users }
- { gid: 101, groupname: libuuid }
- { gid: 103, groupname: crontab }
- { gid: 104, groupname: ssh }
- { gid: 106, groupname: mlocate }
- { gid: 107, groupname: landscape }
- { gid: 109, groupname: 'Debian-exim' }
- { gid: 65534, groupname: nogroup }
# only import users from the follow groups
# use all for all users
user_groups:
- all
You'll want to set your default root password, along with any ssh keys you'd like
propagated to the machine.
You'll notice the "user_groups" config, which by default is set to "all". This setting
specifies which groups of users should be allowed on the host. 'all' is a special group
which imports all users.
You may be interested in generating your host configuration files initially with the --import-host command (see below).
$ sudo sysync --addhost=spam --interactive
You'll see:
#users:
# - uid: 0
# username: root
# homedir: /root
# shell: /bin/bash
# password: '$6$928b679b70731fc7$OjB.vI0hI4PWC9ObsudW3ITZMBjo7Rfs6Dd5vQ80XZM0A6NU6EQqIVQAI3T90T5Bz3K9Vfha0cp176IAHaNQQ.'
# ssh_keys:
# - here
# only import users from the following groups
# use all for all users
user_groups:
- all
You can add system users and override users, referenced by the default host image, in this file.
For example, you could set a different root password on every host configuration.
Example:
users:
- uid: 0
username: root
homedir: /root
shell: /bin/bash
password: '$6$928b679b70731fc7$OjB.vI0hI4PWC9ObsudW3ITZMBjo7Rfs6Dd5vQ80XZM0A6NU6EQqIVQAI3T90T5Bz3K9Vfha0cp176IAHaNQQ.'
ssh_keys:
- here
# only import users from the following groups
# use all for all users
user_groups:
- sysadmin
In the above example, we're overriding the default password and ssh keys for the root user.
We're also only importing members of the sysadmin group.