第九题:配置LDAP用户家目录autofs自动挂载、配置NTP同步时间
Q1:请使用LDAP服务器上的用户thales登录系统,并满足以下要求:
&thales用户的家目录路径为本地/home/ldap下面的thales目录
&thales用户登录后,家目录会自动挂载到server.group10.example.com服务通过nfs服务到处的/rhome/thales
&home目录必须对用户具有可写权限
&thales的密码是redhat
1.-安装autofs软件包
yum install -y autofs
2.配置autofs主配置文件,增加一条autofs用户挂载主目录配置项:
vim /etc/auto.master
/home/ldap /etc/auto.ldap(是题目要求的挂载主目录,挂载时自动创建:/etc/auto.ldap是用户配置文件)
3.配置用户挂载配置文件:
vim /etc/auto.ldap
thales -fstype=nfs,rw server.group10.example.com:/rhome/thales
4.启动服务:
systemctl enable autofs
systemctl restart autofs
5.测试
su - thales(可以成功登录就基本没问题)
Q2:配置您的系统时间与服务器server.group10.example.com同步,要求系统重启后依然生效
1.安装软件包
yum install -y chrony
2.修改配置文件(在第3~6行以server开头前面加#注释符,并增加题目要求的NTP服务器)
#server 0.rhel.ntp.org iburst
#server 1.rhel.ntp.org iburst
#server 2.rhel.ntp.org iburst
server server.group10.example.com iburst
3.启动NTP同步功能
timedatectl set-ntp true
4.启动服务
systemctl enable chronyd
systemctl enable chrony-wait
systemctl restart chronyd
systemctl restart chrony-wait(执行大概需要20秒时间,等待同步结束)
5.同步服务器时间的测试,可以不做
chronyc waitsync
chronyc sources
浙公网安备 33010602011771号