windows 免密码ssh登录linux;linux免密码ssh登录其他linux

1、windows 免密码ssh登录linux

参考:https://blog.csdn.net/qq285744011/article/details/118293937

1)windows先生成公钥私钥

ssh-keygen -t rsa -C "你的邮箱地址"

生成后放在用户命令.ssh文件下
在这里插入图片描述
2)把公钥复制到linux /root/.ssh/authorized_keys

在这里插入图片描述

在这里插入图片描述
3)然后就可以在windows下免密码登录了

ssh -p 31 root@192.168**

在这里插入图片描述

2、linux免密码ssh登录其他linux

参考:https://www.cnblogs.com/JackieDYH/p/17635056.html

1)如果linux /root/.ssh/不存在就去生成

sh-keygen -t rsa -b 4096 -C "your_email@domain.com"

2)ssh-copy-id 命令直接默认把 /root/.ssh/公钥拷贝到远程linux的/root/.ssh/authorized_keys中;不需要指定文件路径很方便

ssh-copy-id remote_username@server_ip_address

3)设置成功就可以免密码登录了

ssh -p 31 root@192.168**