ubuntu新建使用者、刪除使用者的操作需要root許可權
root@ubuntu-virtual-machine:~# useradd abc
/var/log/auth.log下對應的記錄為:
may 7 20:01:50 ubuntu-virtual-machine useradd[4347]: new group: name=abc, gid=1001
may 7 20:01:50 ubuntu-virtual-machine useradd[4347]: new user: name=abc, uid=1001, gid=1001, home=/home/abc, shell=
root@ubuntu-virtual-machine:~# passwd abc
/var/log/auth.log下對應的記錄為:
may 7 20:02:03 ubuntu-virtual-machine passwd[4354]: pam_unix(passwd:chauthtok): password changed for abc
may 7 20:02:03 ubuntu-virtual-machine passwd[4354]: gkr-pam: couldn't update the login keyring password: no old password was entered
root@ubuntu-virtual-machine:~# passwd -l abc
/var/log/auth.log下對應的記錄為:
may 7 20:47:33 ubuntu-virtual-machine passwd[5092]: password for 'abc' changed by 'root'
root@ubuntu-virtual-machine:~# usermod -l abc
/var/log/auth.log下對應的記錄為:
may 7 20:19:14 ubuntu-virtual-machine usermod[4927]: lock user 'abc' password
root@ubuntu-virtual-machine:~# passwd -u abc
/var/log/auth.log下對應的記錄為:
may 7 20:53:43 ubuntu-virtual-machine passwd[5109]: password for 'abc' changed by 'root'
root@ubuntu-virtual-machine:~# usermod -u abc
/var/log/auth.log下對應的記錄為:
may 7 20:20:09 ubuntu-virtual-machine usermod[4935]: unlock user 'abc' password
root@ubuntu-virtual-machine:~# userdel abc
/var/log/auth.log下對應的記錄為:
may 7 20:41:57 ubuntu-virtual-machine userdel[5036]: delete user 'abc'
may 7 20:41:57 ubuntu-virtual-machine userdel[5036]: removed group 'abc' owned by 'abc'
may 7 20:41:57 ubuntu-virtual-machine userdel[5036]: removed shadow group 'abc' owned by 'abc'
ubuntu新建組、刪除組的操作需要root許可權
root@ubuntu-virtual-machine:~# groupadd -g 888 testgroup
/var/log/auth.log下對應的記錄為:
may 7 20:27:24 ubuntu-virtual-machine groupadd[4984]: group added to /etc/group: name=testgroup, gid=888
may 7 20:27:24 ubuntu-virtual-machine groupadd[4984]: group added to /etc/gshadow: name=testgroup
may 7 20:27:24 ubuntu-virtual-machine groupadd[4984]: new group: name=testgroup, gid=888
root@ubuntu-virtual-machine:~# gpasswd -a testuser testgroup
/var/log/auth.log下對應的記錄為:
may 7 20:28:02 ubuntu-virtual-machine gpasswd[4998]: user testuser added by root to group testgroup
root@ubuntu-virtual-machine:~# gpasswd -d testuser testgroup
/var/log/auth.log下對應的記錄為:
may 7 21:02:26 ubuntu-virtual-machine gpasswd[5122]: user testuser removed by root from group testgroup
root@ubuntu-virtual-machine:~# groupmod -n testgroups testgroup
/var/log/auth.log下對應的記錄為:
may 7 21:05:45 ubuntu-virtual-machine groupmod[5149]: group changed in /etc/group (group testgroup/888, new name: testgroups)
may 7 21:05:45 ubuntu-virtual-machine groupmod[5149]: group changed in /etc/gshadow (group testgroup, new name: testgroups)
root@ubuntu-virtual-machine:~# groupdel testgroups
/var/log/auth.log下對應的記錄為:
may 7 21:07:21 ubuntu-virtual-machine groupdel[5156]: group 'testgroups' removed from /etc/group
may 7 21:07:21 ubuntu-virtual-machine groupdel[5156]: group 'testgroups' removed from /etc/gshadow
may 7 21:07:21 ubuntu-virtual-machine groupdel[5156]: group 'testgroups' removed
ubuntu 使用者 使用者組管理
1 檢視所有的使用者組 cat etc group ftpgroup x 1001 ftpadminftpgroup是使用者組,ftpadmin是該組的使用者 1 建立使用者組 groupadd ftpgroup2 刪除使用者組 groupdel ftpgroup 2 檢視使用者 cat etc s...
ubuntu 使用者 使用者組管理
1 檢視所有的使用者組 cat etc groupftpgroup x 1001 ftpadmin ftpgroup是使用者組,ftpadmin是該組的使用者 1 建立使用者組 groupadd ftpgroup 2 刪除使用者組 groupdel ftpgroup 2 檢視使用者 cat etc ...
UBUNTU 使用者及使用者組管理
建立組 sudo addgroup ccache 建立使用者 sudo useradd ccache g ccache m 創新wfz使用者並建立home目錄,指定使用者組為ccache sudo useradd wfz g ccache m 增加已存在使用者到指定組 sudo adduser us...