1.linux 安装sshd;window10安装OpenSSH-Win32 client
2.window10,生成密钥对。OpenSSH-Win32提供有工具:ssh-keygen -t rsa。
3.私钥放在window10目录:C:\Users\admin\.ssh\id_rsa
4.公钥放在linux服务器目录:/root/.ssh/authorized_keys
5.linux服务器放的公钥命名写错了,无法登录。
6./etc/ssh/sshd_config Linux配置文件开启密钥登录:PubkeyAuthentication yes
7.文件权限、所有者配置
chmod 600 authorized_keys
chmod 700 /root/.ssh