最后编辑:10 月
ssh-keygen -t rsa -C "xxx@domain" # 将生成的密钥放到相应的位置 mkdir /home/username/.ssh touch /home/username/.ssh/authorized_keys # Enter file in which to save the key (/root/.ssh/id_rsa):/home/username/.ssh/id_rsa cd /home/username/.ssh cat id_rsa.pub > authorized_keys # 修改权限 cd .. chown -R username:username .ssh chmod -R 700 .ssh chmod 600 .ssh/authorized_keys登陆的用户名为:username 登陆的密钥为/home/username/.ssh/id_rsa的内容