RHCE考试通关秘籍第六式—用户帐号的那点事
2018-11-02阅读 3593

前面导读:  

RHCE考试通关秘籍第一式--巧破linux密码》

https://www.easthome.com/front/teacherReportInfo/reportInfo/detial?tid=186

 

RHCE考试通关秘籍第二式不会配置网络你就Over了》  

https://www.easthome.com/front/teacherReportInfo/reportInfo/detial?tid=843

 

RHCE考试通关秘籍第三式你必须知道的SELinux 

https://www.easthome.com/front/teacherReportInfo/reportInfo/detial?tid=844

 

RHCE考试通关秘籍第四式软件包安装基础之YUM配置》

https://www.easthome.com/front/teacherReportInfo/reportInfo/detial?tid=850

 

RHCE考试通关秘籍第五式调整逻辑卷的大小》

https://www.easthome.com/front/teacherReportInfo/reportInfo/detial?tid=851

 

 

文章正文:

第六式和用户帐号配置相关,也是一道比较容易的考题。

 

好了,继续举栗子~~假设我需要你做如下配置

 

要求如下:

 

l  创建组sysadm

l  创建用户harrynatashatom

l  要求harrynatasha的附加组为sysadm

l  要求tom用户的登陆shell为非交互式shell

l  三个用户的密码为redhat

 

怎么样,不难吧,我相信对大家来说so easy了,对一下答案,看看Ok不。

# groupadd sysadm

# useradd -G sysadm natasha

# useradd -G sysadm harry

# useradd -s /sbin/nologin tom

# echo redhat | passwd --stdin harry

# echo redhat | passwd --stdin natasha

# echo redhat | passwd --stdin tom

 

如果不放心,我们就再检查一下

# id natasha

# id harry

# id tom

# ssh harry@localhost 'hostname'

redhat

# ssh natasha@localhost 'hostname'

redhat

# ssh tom@localhost 'hostname'

redhat

 

你做对了不?

头像
韩梅
60
文章总数
171286
总阅读数