rhce第二次作业

配置ssh远程连接
1.实现两台linux主机之间通过公钥验证能够互相实现免密登陆

步骤:

第一步:定位客户端,制作公私钥对

[root@server ~]# ssh-keygen  -t  rsa  # 一路回车

第二步:定位客户端,将公钥上传到服务器端

[root@node1 ~]# ssh-copy-id   root@192.168.48.130  # 输入服务端的账户及IP地址
The authenticity of host '192.168.48.130 (192.168.48.130)' can't be established.
ED25519 key fingerprint is SHA256:K7nvJFkfIh+p9YytEGR44wLbTfpB0Y52oVou0UdG6nc.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes  # 输入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.48.130's password:  # 输入服务端root账户的的密码 

Number of key(s) added: 1

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

# 注意:客户端将公钥上传到服务器端后,服务器端的/root/.ssh/authorized_keys文件会存储客户端的公钥数据

第三步:客户端测试

[root@node1 ~]# ssh  root@192.168.48.130
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: Wed Mar 22 11:31:31 2023
[root@server ~]# 

第四步:由于是要实现服务端与客户端相互免密,则将上述操作在服务端在执行一遍

运行截图:

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值