Install And Use SALTStack In A Mixed Environment - Page 3
On this page
User management on Salt-Minions from Salt-Master
Adding a user by:
root@salt-master:~# salt '*' user.add user02
salt-minion1.test.local: True salt-minion2.test.local: True salt-centos: True
Set user's full name by:
root@salt-master:~# salt '*' user.chfullname user02 "Test User"
salt-centos: True salt-minion1.test.local: True salt-minion2.test.local: True
adding user to groups by:
root@salt-master:~# salt '*' user.chgroups user02 games,ssh,mysql True
salt-centos: False salt-minion2.test.local: True salt-minion1.test.local: True
The CentOS faild, because it has different groups
Let's try again
root@salt-master:~# salt '*' user.chgroups user02 games True
salt-minion2.test.local: True salt-minion1.test.local: True salt-centos: True
Check what we did by:
root@salt-master:~# salt '*' user.list_groups user02
salt-minion2.test.local: - games - mysql - ssh - user02 salt-minion1.test.local: - games - mysql - ssh - user02 salt-centos: - games - user02
I recomment to Set up users' shell because it is not nice by default
root@salt-master:~# salt '*' user.chshell user02 /bin/bash
salt-centos: True salt-minion1.test.local: True salt-minion2.test.local: True
Set user's password to 123123
root@salt-master:~# salt '*' shadow.set_password user02 '$6$EYk3o52W$DaSUIfHpYMBkSShFYXdODyrHbmQlCNKFghNpRABSdrJWkIMcXay.l9FZzZshUn240GCOn5szQ3piyBMtt/x4m.'
salt-minion2.test.local: True salt-minion1.test.local: True salt-centos: True
Here is two ways to generate you own password:
python -c "import crypt, getpass, pwd; print crypt.crypt('123123', '\$6\$SALTsalt\$')"
openssl passwd -1
Remove the prevoiously created user02:
root@salt-master:~# salt '*' user.delete user02 remove=True force=True
salt-minion2.test.local: True salt-minion1.test.local: True salt-centos: True