$ cat /etc/passwd # cat /etc/shadow $ cat /etc/group
!!!! В ubuntu была замечана необходимость указывать shell !!!!
# useradd -u 10001 -m -s /bin/bash user1 # cat /etc/default/useradd
# passwd user1 # echo user1:password1 | chpasswd # apt install whois $ mkpasswd -m sha-512 $ openssl passwd -1
# groupadd -g 15001 group1 # groupadd -g 15002 group2
# usermod -c "Ivan Ivanovitch Ivanov,RA7,401,499-239-45-23" user1
# usermod -G group1,group2 user1 или # usermod -a -G group1 user1 # usermod -a -G group2 user1 или # gpasswd -a user1 group1 # gpasswd -a user1 group2 # gpasswd -d user1 group1 # cat /etc/group # getent group # id user1
# cat /etc/shells
... /usr/sbin/nologin /usr/bin/passwd
# usermod -s /usr/bin/passwd user1
См. также chsh, chfn
server# usermod -d /home/zabbix zabbix server# mkhomedir_helper zabbix
# man chage # chage -l userX # chage -E 2020-08-30 userX
# passwd -l user1 # passwd -S user1 # passwd -u user1 или, если надо разблокировать, но не задавать пароль # usermod -p '*' root
# userdel -r student
$ sudo -s ... # passwd ...
# usermod -l ivanovii -m -d /home/ivanovii user1 # groupmod -n ivanovii user1
# ###export UGIDLIMIT=1000 # UGIDLIMIT=1001 # awk -v LIMIT=$UGIDLIMIT -F: '($3>=LIMIT) && ($3!=65534)' /etc/passwd >> /var/lib/lxc/www/rootfs/etc/passwd # awk -v LIMIT=$UGIDLIMIT -F: '($3>=LIMIT) && ($3!=65534)' /etc/passwd | ssh www 'cat >> /etc/passwd' # awk -v LIMIT=$UGIDLIMIT -F: '($3>=LIMIT) && ($3!=65534)' /etc/group >> /var/lib/lxc/www/rootfs/etc/group # awk -v LIMIT=$UGIDLIMIT -F: '($3>=LIMIT) && ($3!=65534)' /etc/group | ssh www 'cat >> /etc/group' # awk -v LIMIT=$UGIDLIMIT -F: '($3>=LIMIT) && ($3!=65534) {print $1}' /etc/passwd | tee - | egrep -f - /etc/shadow >> /var/lib/lxc/www/rootfs/etc/shadow # awk -v LIMIT=$UGIDLIMIT -F: '($3>=LIMIT) && ($3!=65534) {print $1}' /etc/passwd | tee - | egrep -f - /etc/shadow | ssh www 'cat >> /etc/shadow' # cd /home; tar -cf - . | (cd /var/lib/lxc/www/rootfs/home; tar -xvf -) # cd /home; tar -cf - . | ssh www '(cd /home; tar -xvf -)' # cd /var/mail; tar -cf - . | (cd /var/lib/lxc/www/rootfs/var/mail; tar -xvf -) # cd /var/mail; tar -cf - . | ssh www '(cd /var/mail; tar -xvf -)'
groupadd -g 15001 group1 useradd -u 10001 -m -s /bin/bash -c "Ivan Ivanovitch Ivanov,RA7,401,499-239-45-23" -G group1 user1 useradd -u 10002 -m -s /bin/bash -c "Petr Petrovitch Petrov,RA7,402,499-323-55-53" -G group1 user2 useradd -u 10003 -m -s /bin/bash -c "Сидор Сидорович Сидоров,РА7,403,499-323-55-53" -G group1 user3 echo 'user1:password1' | chpasswd echo 'user2:password2' | chpasswd echo 'user3:password3' | chpasswd