运维笔记 --sftp远程连接服务器,提示:Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)

场景描述:

阿里云服务器开启配置了免密登录,导致正常使用用户名/密码登录的时候,提示公钥等信息,拒绝访问,

异常:Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)

处理方式:
---配置sshd_config:
vim /etc/ssh/sshd_config
(1) PermitRootLogin,将其修改为yes,即为允许root通过ssh进行连接
 
(2) 注释掉Subsystem sftp /usr/libexec/openssh/sftp-server再加上一行
#Subsystem  sftp    /usr/libexec/openssh/sftp-server
Subsystem sftp internal-sftp
 
(3) PasswordAuthentication no
该参数默认启用,默认值为 yes, 这里改回到yes。
 
(4)注释掉:
RSAAuthentication yes
PubkeyAuthentication yes
 
(5)放开注释:
Port 22
AddressFamily any
ListenAddress 0.0.0.0
ListenAddress ::
 
(6)重启sshd服务:
systemctl restart sshd
systemctl status sshd.service #查看ssh服务的状态
 
posted @ 2020-10-16 16:15  hello-Jesson  阅读(9412)  评论(0编辑  收藏  举报