// 打开命令提示符或PowerShell窗口输入以下命令生成SSH密钥对: ssh-keygen -t rsa -b 4096
默认生成位置:
//注意提示保存的位置:
Your identification has been saved in /data/data/com.termux/files/home/.ssh/id_rsa
Your public key has been saved in /data/data/com.termux/files/home/.ssh/id_rsa.pub
C:\Users\用户名\.ssh\
找到 id_rsa.pub 文件 将里面的内容
添加到服务器的 C:\ProgramData\ssh\administrators_authorized_keys 文件中
如果文件不存在则自行创建!
执行powershell命令:
icacls.exe "C:\ProgramData\ssh\administrators_authorized_keys" /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"
----------------------------------------------------------------------------linux 分割线-----------------------------------------------------------
将公钥拷贝到 ~/.ssh/authorized_keys 文件里面
linux则放在:
~/.ssh/authorized_keys