用戶型別
超級用戶(0)、系統用戶(1-999)
普通用戶(1000~60000)
普通用戶的主要屬性:登錄名、密碼、家目錄(/home/用戶名)
查看當前登錄賬戶
[root@localhost ~]# whoami
root
添加用戶: useradd 用戶名

給用戶設定密碼 passwd 用戶名

洗掉用戶 userdel [-r] 用戶名 使用-r選項,可以將用戶的家目錄一起洗掉

添加組
組賬號的主要屬性:組名、成員用戶串列
命令: groupadd [-g GID ] 組名
[root@localhost ~]# groupadd -g 600 students
[root@localhost ~]#
為用戶組添加成員用戶 gpasswd [選項] 組名
[root@localhost ~]# useradd guojing //重新添加用戶guojing
[root@localhost ~]# gpasswd -a guojing students
正在將用戶“guojing”加入到“students”組中
[root@localhost ~]# id guojing //確認結果
uid=1001(guojing) gid=1001(guojing) 組=1001(guojing),600(students)
洗掉組 groupdel 組名

轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/234563.html
標籤:Linux
上一篇:vim編輯器的使用
下一篇:ubuntu安裝dbus
