SSH 密钥登录

SSH 密钥登录
# 建立密钥对(这里是在root用户下)
ssh-keygen

# 安装公钥
cd ~/.ssh
cat id_rsa.pub >> authorized_keys
# 确保权限正确
chmod 600 authorized_keys
chmod 700 ~/.ssh

# 配置文件
vi /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes
PermitRootLogin yes
# 可以关闭密码登录
PasswordAuthentication no

# 重启SSH服务
service sshd restart

评论

此博客中的热门博文

docker安装及配置

静默启动bat文件