RHCE第二次作业

1.

#进入/etc/chrony.conf
vim /etc/chrony.conf
#使用pool.ntp.org中的公共服务器编辑
#iburst表表示首次同步的的时候快速同步
server 0/centos.pool.ntp.org iburst
server 1/centos.pool.ntp.org.iburst
server 2/centos.pool.ntp.org.iburst
server 3/centos.pool.ntp.org.iburst
#指定ntp客户端地址,以允许或拒绝连接到扮演时钟服务器
#allow 192.168.95.135
#编辑完成后,保存退出
systemctl restart chronyd #重启服务
chronyc sources -v #时间同步
timedatectl status 
Local time: 二 2023-07-18 00:15:41 CST
           Universal time: 一 2023-07-17 16:15:41 UTC
                 RTC time: 一 2023-07-17 16:15:38
                Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes  #yes表示已同步
              NTP service: active
          RTC in local TZ: no

2. 

useradd redhat #新建用户redhat
passwd redhat #设置密码
ssh-keygen -t rsa #制作公钥对,-t指定密钥类型
cd .shh
vim autorized_keys