
正文
linux ssh 免密码登录的配置过程
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
- # ssh-keygen -t rsa -C "自定义描述" -f ~/.ssh/自定义生成的rsa文件
- # cd ./.ssh
- # touch config
-
# 粘贴
Host 远程服务器地址
IdentityFile ~/.ssh/自定义生成rsa文件
User root 登录远程服务器的用户 - # 保存
-
#
ssh-copy-id -i ~/.ssh/自定义生成rsa文件.pub root@远程服务器地址
如果上述 步骤完成未生效 清检查 服务器 /etc/ssh/sshd_config 文件
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys检查上面配置是否被 # 注释. 如果被注释 则取消注释 重启
// ubuntu系统
service ssh restart
// debian系统
/etc/init.d/ssh restart








