
windows执行ssh-keygen生成公钥ssh-keygen一路回车即可拷贝windows公钥到linux服务器# windows 拷贝下面文件的内容 C:\Users\.ssh\id_rsa.pub # linux 复制到 /root/.ssh/authorized_keys vim authorized_keyslinux更新ssh# linux环境执行命令更新ssh sudo systemctl restart sshd注意linux要开启支持免密sshd -T | egrep pubkeyauthentication|passwordauthentication pubkeyauthentication no # 修改成yes passwordauthentication yes vim /etc/ssh/sshd_config sudo systemctl restart ssh