作业:
作业一:
server端:
[root@server ~]# yum install chrony -y
[root@server ~]# vim /etc/chrony.conf
# 第三行修改为:server ntp.aliyun.com iburst
[root@server ~]# systemctl restart chronyd
[root@server ~]# chronyc sources -v
[root@server ~]# yum install chrony -y
[root@server ~]# vim /etc/chrony.conf
# 定位26行:添加node1ip: allow 192.168.48.137/24
[root@server ~]# systemctl restart chronyd
node1端:
[root@node1 ~]# yum install chrony -y
[root@node1 ~]# vim /etc/chrony.conf
修改第三行:server 192.168.20.135 iburst
[root@node1 ~]# systemctl restart chronyd
[root@node1 ~]# chronyc sources -v
.-- Source mode '^' = server, '=' = peer, '#' = local clock.
/ .- Source state '*' = current best, '+' = combined, '-' = not combined,
| / 'x' = may be in error, '~' = too variable, '?' = unusable.
|| .- xxxx [ yyyy ] +/- zzzz
|| Reachability register (octal) -. | xxxx = adjusted offset,
|| Log2(Polling interval) --. | | yyyy = measured offset,
|| \ | | zzzz = estimated error.
|| | | \
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* 192.168.20.135 3 6 37 18 -2936ns[ -382us] +/- 46ms
[root@node1 ~]# timedatectl status
Local time: 日 2023-07-16 23:59:35 CST
Universal time: 日 2023-07-16 15:59:35 UTC
RTC time: 日 2023-07-16 15:59:35
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
作业二:
服务端:
[root@server ~]# useradd redhat
[root@server ~]# passwd redhat
更改用户 redhat 的密码 。
新的密码:
无效的密码: 密码少于 8 个字符
重新输入新的密码:
passwd:所有的身份验证令牌已经成功更新。
客户端:
[root@node1 ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:zAAUK0mWLOg5sXvq9qjESnoYqfvPqtfGoo8eti0tllY root@node1
The key's randomart image is:
+---[RSA 3072]----+
|..oo+. |
|o+o. o |
|..* . . |
| = . + |
| .o S |
|+. E |
|.O*o |
|OXOo+ |
|/&BBo |
+----[SHA256]-----+
[root@node1 ~]# ssh-copy-id redhat@192.168.20.135
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host '192.168.20.135 (192.168.20.135)' can't be established.
ED25519 key fingerprint is SHA256:/06F8vJsc10fEzNXQ6gg8NisJM9tRJqNX0y1mkNeuGc.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
redhat@192.168.20.135's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'redhat@192.168.20.135'"
and check to make sure that only the key(s) you wanted were added.
测试:测试成功!
[root@node1 ~]# ssh redhat@192.168.20.135
Register this system with Red Hat Insights: insights-client --register
Create an account or view all your systems at https://red.ht/insights-dashboard
[redhat@server ~]$