SSH协议的安装与卸载

SSH协议的卸载

[root@node-01 ~]#rm -rf .ssh/ 删除 

安装SSH协议

安装ssh

[root@node-01 ~] ssh-keygen

或者

[root@node-01 ~] ssh-keygen -r rea

查看隐藏文件

[root@node-01 ~]ll -a
[root@node-01 ~] cd .ssh

分别生成公钥和私钥

[root@node-01 .ssh]# ssh-copy-id node-01 
The authenticity of host 'node-04 (192.168.123.200)' can't be established. RSA key fingerprint is 8a:4b:67:79:e4:f9:30:7c:0c:6e:b3:01:26:ed:41:30. Are you sure you want to continue connecting (yes/no)? yes 
Warning: Permanently added 'node-04,192.168.123.200' (RSA) to the list of known hosts.

把其他服务器上的密钥发送给堡垒机(node-02)

ssh-copy-id node-01

将堡垒机上的 authorized_keys 发送给其他服务器##

[root@node-01 ~]# scp .ssh/authorized_keys node-02:$PWD

查看

ssh node-02

退出

exit
posted @ 2020-07-25 14:30  诸葛孔萌  阅读(592)  评论(0编辑  收藏  举报