权限问题

.sshauthroized_keys权限

1
2
chmod 700 .ssh
chmod 600 .ssh/authorized_keys

ssh配置文件

1
2
3
4
5
6
7
8
# 使用公钥认证
PubkeyAuthentication yes
# 认证秘钥文件
AuthorizedKeysFile .ssh/authorized_keys
# 密码认证关闭
PasswordAuthentication no
# 关闭Root登录
PermitRootLogin no

保存配置重启sshd服务

1
systemctl restart sshd.service