1 生成密钥
ssh-keygen -P "" -f ~/.ssh/id_rsa # 一路回车,免交互 ssh-keygen -t rsa
2 复制密钥
2.1 手动复制密钥方法1
ssh-copy-id pskgops@${服务器ip}
2.2 手动复制密钥方法2
cat /home/pskgops/.ssh/id_rsa.pub #复制公钥
登录服务器
su - pskgops
mkdir -p ~/.ssh
cd ~/.ssh
vim ~/.ssh/authorized_keys # 将公钥粘贴进去
chmod 600 authorized_keys
3 验证免密
ssh -o StrictHostKeyChecking=no pskgops@${服务器ip} # 免交互
标签:免密,pskgops,rsa,密钥,操作,普通用户,id,ssh
From: https://www.cnblogs.com/danielHan/p/18678560