Basic administrative commands for users and user groups

an actual combat
[root@localhost ~]# groupadd sexy
[root@localhost ~]# groupmod -n market sexy
[root@localhost ~]# groupmod -g 668 market
[root@localhost ~]# groupadd -g 888 boss
[root@localhost ~]# groupdel market
[root@localhost ~]# groupadd sexy
[root@localhost ~]# useradd -g sexy sdf
[root@localhost ~]# useradd -g sexy jzmb
[root@localhost ~]# useradd -d /home/xxx test
[root@localhost ~]# cat /etc/passwd
[root@localhost ~]# usermod -c dgdzmx sdf
[root@localhost ~]# usermod -l cls sdf
[root@localhost ~]# usermod -d /home/cls cls
[root@localhost ~]# usermod -g sexy test
[root@localhost ~]# userdel jzmb
[root@localhost ~]# touch /etc/nologin
[root@localhost ~]# passwd -ls cls
passwd: bad argument -ls: unknown option
[root@localhost ~]# passwd -l cls
Locking password for user cls.
passwd: Success
[root@localhost ~]# passwd -u cls
Unlocking password for user cls.
passwd: Warning: unlocked password would be empty.
passwd: Unsafe operation (use -f to force)
[root@localhost ~]# passwd -d cls
Removing password for user cls.
passwd: Success
 
Two main combination subgroups


 
 
Three actual combat
[root@localhost ~]# gpasswd -a cls boss
Adding user cls to group boss
[root@localhost ~]# newgrp boss
[root@localhost ~]# gpasswd -d cls boss
Removing user cls from group boss
[root@localhost ~]# useradd -g group1 -G group2
[root@localhost ~]# gpasswd test
Changing the password for group test
New Password:
Re-enter new password:
 
Four other management commands
[root@localhost ~]# su cakin24
[cakin24@localhost root]$ su root
Password:
[root@localhost ~]# whoami
root
[root@localhost ~]# id root
uid=0(root) gid=0(root) groups=0(root)
[root@localhost ~]# id cakin24
uid=1000(cakin24) gid=1000(cakin24) groups=1000(cakin24)
[root@localhost ~]# chfn cakin24
Changing finger information for cakin24.
Name [cakin24]: cakin24
Office []: cakin
Office Phone []: cakin
Home Phone []: cakin
 
Finger information changed.
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326267482&siteId=291194637