第二次作业

配置ntp时间服务器,确保客户端主机能和服务主机同步时间

[root@server ~]# yum install  chrony -y
# 编辑配置文件,定位至3行,修改为阿里的时间同步服务器地址
server ntp.aliyun.com  iburst
[root@server ~]# systemctl  restart chronyd
[root@server ~]# chronyc sources  -v
[root@server ~]# timedatectl  status
# 编辑配置文件,定位定26行,设置谁可以访问本机进行时间同步
[root@server ~]# yum install  chrony -y
allow xx ip   # IP地址改为客户端主机的地址
[root@server ~]# systemctl  restart chronyd

配置ssh免密登录,能够实现客户端主机通过服务器端的redhat账户进行基于公钥验证方式的远程连接

[root@server ~]# useradd redhat
[root@server ~]# su redhat
[redhat@server root]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/redhat/.ssh/id_rsa): 
Created directory '/home/redhat/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/redhat/.ssh/id_rsa
Your public key has been saved in /home/redhat/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:R1ketbj1GS6AOYJ1XSnILFW1kSf7OhIYhw95smD69D4 redhat@server
The key's randomart image is:
+---[RSA 3072]----+
|       .+o+.==+  |
|      o..+o* *oo |
|     . ..+=.+.*. |
|       o.B.o.+..o|
|      o S @ ...o.|
|     . . + o  .. |
|      o .   . .  |
|       . E . o   |
|        ... . .  |
+----[SHA256]-----+
[redhat@server root]$ ssh-copy-id -i /home/redhat/.ssh/id_rsa.pub root@192.168.203.128
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/redhat/.ssh/id_rsa.pub"
The authenticity of host '192.168.203.128 (192.168.203.128)' can't be established.
ED25519 key fingerprint is SHA256:r7fRpCT9/IW5pCJblgC6x1oklFIbWrtevEG0qnbwGeY.
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
root@192.168.203.128's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'root@192.168.203.128'"
and check to make sure that only the key(s) you wanted were added.

[redhat@server root]$ ssh root@192.168.203.128
Activate the web console with: systemctl enable --now cockpit.socket

Register this system with Red Hat Insights: insights-client --register
Create an account or view all your systems at https://red.ht/insights-dashboard
Last login: Tue Jul 18 11:07:45 2023 from 192.168.203.1
[root@server ~]# 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值