RHCE第二次作业

作业:537ab17e48044445b0846052648ed8f4.png

作业一:

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

b5f5ad303a08414eaa50587eb67ba78d.png

 4ad3d7c201c849f380223b8477dbca54.png

 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

48be701d102144f3a222a7353b35ae8e.png

 作业二:

服务端:

[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 ~]$ 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值