RHCE培训课堂实验-17 指导练习-管理用户密码
1244RHCE应如何为几个用户设置密码策略,强制用户在第一次登录系统时更改密码,强制每90天更改一次密码,将帐户设置为从当天起180天后过期
查看全文全站搜索 公开课 学习资料 未分类
红帽系统管理1-学员练习册-12管理网络.pdf—P416
在本练习中,您将手动配置系统的静态主机名、/etc/hosts文件和DNS名称解析器。
目标:
您应能够设置自定义主机名并配置名称解析设置。
练习准备工作:
以student用户身份并使用student作为密码登录workstation。
在workstation上,运行lab net-hostnames start命令。该命令将运行一 个起始脚本,它将确定主机servera是否可从网络访问。
[student@workstation ~]$ lab net-hostnames start

1 使用ssh命令,以student用户身份登录servera。系统已配置为使用SSH密钥来进行身份验证,因此不需要输入密码就能登录servera。
[student@servera ~]$ ssh student@servera

2 查看当前的主机名设置。
2.1 显示当前的主机名。
[student@servera ~]$ hostname
2.2 显示主机名状态。
[student@servera ~]$ hostnamectl status

3 设置静态主机名,以便和当前的临时主机名匹配。
3.1 更改主机名和主机名配置文件。
[student@servera ~]$ sudo hostnamectl set-hostname servera.lab.example.com
3.2 查看在网络启动时提供主机名的配置文件。
[student@servera ~]$ cat /etc/hostname
3.3 显示主机名状态。
[student@servera ~]$ hostnamectl status

4 临时更改主机名。
4.1 更改主机名。
[student@servera ~]$ sudo hostname testname
4.2 显示当前的主机名。
[student@servera ~]$ hostname
4.3 查看在网络启动时提供主机名的配置文件。
[student@servera ~]$ cat /etc/hostname
4.4 重新启动系统。
[student@servera ~]$ sudo systemctl reboot

4.5 从workstation,以student用户身份登录servera。
[student@workstation ~]$ ssh student@servera
4.6 显示当前的主机名。
[student@servera ~]$ hostname

5 为课堂服务器添加一个本地别名。
5.1 查询classroom.example.com的IP地址。
[student@servera ~]$ host classroom.example.com

5.2 修改/etc/hosts,以便附加名称class可用于访问IP地址172.25.254.254。
[student@servera ~]$ sudo vim /etc/hosts

5.3 查找class的IP地址。
[student@servera ~]$ host class

5.4 ping class。
[student@servera ~]$ ping -c3 class

5.5 从servera退出。
[student@servera ~]$ exit

完成
在workstation上,运行lab net-hostnames finish脚本来结束本练习。
[student@workstation ~]$ lab net-hostnames finish

本引导式练习到此结束。

扫码添加教务-杨老师微信号,备注“红帽”,可免费领取实验环境和完整的PDF技术资料。
RHCE应如何为几个用户设置密码策略,强制用户在第一次登录系统时更改密码,强制每90天更改一次密码,将帐户设置为从当天起180天后过期
查看全文这个虚拟机可以用于RH124、RH134、RH294三门课程,建议解压一份用于RH124和RH134,再解压一份用于RH294.
查看全文