为什么要建设医院网站,关于加强网站建设的情况说明,网站同时做竞价和seo,网页游戏哪个平台最好一、实验要求
通过两台linux主机 配置ssh 实现互相免密登陆 的操作
二、实验思路
免密登录我们可以理解为使用公钥登录#xff0c;这里分别使用两台主机#xff08;client#xff09;和#xff08;server#xff09;作为实验主机。
首先让client免密登录server#x…一、实验要求
通过两台linux主机 配置ssh 实现互相免密登陆 的操作
二、实验思路
免密登录我们可以理解为使用公钥登录这里分别使用两台主机client和server作为实验主机。
首先让client免密登录server在client上配置生成公钥和私钥再将公钥发送给server主机最后使用ssh登录server如果登录成功我们就成功实现免密登录在server端同样的操作就可以实现相互免密登录
三、实验步骤
[rootclient ~]# ssh-keygen -t rsa // 非对称算法
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): //所保存的公钥文件地址
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:uRr7QU1LWwkkGvtBdLxLAxi3eAPCR3Sutm2nf0LGWXw rootclient
The keys randomart image is:
---[RSA 3072]----
| ..o**o |
| ..o... . |
| . *.ooo |
| Bo E |
| o So . |
| . .* |
| o o. |
| . . |
| o.o..o |
----[SHA256]-----
[rootclient ~]# ll .ssh/
总计 8
-rw------- 1 root root 2590 1月13日 15:51 id_rsa
-rw-r--r-- 1 root root 565 1月13日 15:51 id_rsa.pub
[rootclient ~]# ssh-copy-id 192.168.1.14 //发送到要登录的主机地址
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: /root/.ssh/id_rsa.pub
The authenticity of host 192.168.1.14 (192.168.1.14) cant be established.
ED25519 key fingerprint is SHA256:P7tf244ctRmrIrPB0K8zUOKP1OC9SIO0uRqw5hHquk.
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 keysAuthorized users only. All activities may be monitored and reported.
root192.168.1.14s password: Number of key(s) added: 1Now try logging into the machine, with: ssh 192.168.1.14
and check to make sure that only the key(s) you wanted were added.
[rootclient ~]# ssh 192.168.1.14
[rootserver ~]# 到这里就代表成功登录
之后在server端继续如上配置即可实现相互免密登录