Window免密连接Linux系统
- 生成公匙
ssh-keygen -t rsa
- 一路回车生成公钥
- 复制公匙,使用记事本打开复制全部内容
notepad C:\Users\DELL\.ssh\id_rsa.pub
- 内容如"ssh-rsa AAAAB3NzaC1yc2EAAAA…"
- 远程登录服务器将内容写入
~/.ssh/authorized_keys
echo "ssh-rsa AAAAB3NzaC.......OF" >> ~/.ssh/authorized_keys
- 修改权限
chmod 600 ~/.ssh/authorized_keys
、chmod 700 ~/.ssh
- 验证是否成功
ssh root@xxx.xxx.x.xxx
如果不需要输入密码,说明成功了 🎉!