作業練習4-用戶組和權限管理

1. 創建用戶gentoo,附加組爲bin和root,默認shell爲/bin/csh,註釋信息爲"Gentoo Distribution"
2. 創建下面的用戶、組和組成員關係
名字爲webs 的組
用戶nginx,使用webs 作爲附加組
用戶varnish,使用webs 作爲附加組
用戶mysql,不可交互登錄系統,且不是webs 的成員,nginx,varnish,mysql密碼都是
magedu


[root@Centos7 ~]# useradd  -G bin root -s /bin/csh -c "Gentoo Distribution" gentoo
[root@Centos7 ~]# grep ^gentoo /etc/passwd
gentoo:x:1002:1002:Gentoo Distribution:/home/gentoo:/bin/csh


[root@Centos7 ~]# groupadd webs
[root@Centos7 ~]# getent group webs
webs:x:1003:
[root@Centos7 ~]# useradd -G webs nginx
[root@Centos7 ~]# useradd -G webs varnish
[root@Centos7 ~]# useradd -s /sbin/nologin mysql
[root@Centos7 ~]# echo magedu | passwd --stdin nginx
Changing password for user nginx.
passwd: all authentication tokens updated successfully.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章