publickey,gssapi-with-mic,Unspecified GSS failure

简介:         最近的MHA配置时碰到了Permission denied (publickey,gssapi-with-mic,password)这个错误提示,同时在使用ssh -v时,出现了Unspecified GSS failure错误。

        最近的MHA配置时碰到了Permission denied (publickey,gssapi-with-mic,password)这个错误提示,同时在使用ssh -v时,出现了Unspecified GSS failure错误。这个主要是使用了GSSAPI 的认证功能导致的。客官,如果你碰到了在使用scp很慢的情况下,也是这个原因。不妨继续往下看。

 

1、故障现象
# masterha_check_ssh --conf=/etc/app1.cnf
Wed Apr  8 14:33:26 2015 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
           ...............
Permission denied (publickey,gssapi-with-mic,password).
Wed Apr  8 14:33:26 2015 - [error][/usr/lib/perl5/site_perl/5.8.8/MHA/SSHCheck.pm, ln86] SSH connection from
   root@vdbsrv1(192.168.1.6:22) to root@vdbsrv2(192.168.1.7:22) failed!

### ssh到另一主机时,花费20s左右
# time ssh 192.168.1.7 date
Wed Apr 15 21:33:53 CST 2015

real   0m20.245s
user   0m0.013s
sys 0m0.007s

### 使用-v参数ssh连接
# ssh -v 192.168.1.7
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.1.7 [192.168.1.7] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type 1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: loaded 3 keys
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '192.168.1.7' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
No credentials cache found

debug1: Unspecified GSS failure.  Minor code may provide more information
No credentials cache found

debug1: Unspecified GSS failure.  Minor code may provide more information
No credentials cache found

debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug1: Offering public key: /root/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
Last login: Wed Apr 15 16:56:12 2015 from 192.168.1.124

 

2、故障解决
###查看目标端的GSSAPI options
[root@vdbsrv2 ~]# grep GSSAPI /etc/ssh/sshd_config
# GSSAPI options
#GSSAPIAuthentication no
GSSAPIAuthentication yes      ###此时为开启GSSAPI认证
#GSSAPICleanupCredentials yes
GSSAPICleanupCredentials yes

### Author : Leshami
### Blog   :
http://blog.csdn.net/leshami

[root@vdbsrv2 ~]# cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bk
[root@vdbsrv2 ~]# vi /etc/ssh/sshd_config           ###关闭该认证方式
[root@vdbsrv2 ~]# grep GSSAPI /etc/ssh/sshd_config  ###查看关闭后的结果
# GSSAPI options
GSSAPIAuthentication no
#GSSAPIAuthentication yes
#GSSAPICleanupCredentials yes
GSSAPICleanupCredentials yes

###重启sshd服务
[root@vdbsrv2 ~]# service sshd restart
Stopping sshd: [  OK  ]
Starting sshd: [  OK  ]

###再次测试,仅仅0.191s,ssh -v时也无异常报错
[root@vdbsrv1 ~]# time ssh 192.168.1.7 date
Wed Apr 15 21:48:10 CST 2015

real   0m0.191s
user   0m0.014s
sys 0m0.003s


ssh连接过慢的另外一种情形(补充@20160629):

基于sshd_config修改以下配置项,

UseDNS=no


UseDNS  Specifies whether sshd(8) should look up the remote host name and check that the resolved host name for the remote IP
             address maps back to the very same IP address.  The default is “yes”.

该选项指定当客户端试图登录OpenSSH服务器时,服务器是否需要根据客户端的IP地址进行DNS PTR反向查询,查询出客户端的host name,然后根据查询出的客户端host name进行NS 正向A记录查询,验证与其原始IP地址是否一致,这是防止客户端欺骗的一种手段。如果该值为Yes,则修改服务器端hosts文件,添加对应记录也可以达到加快的目的。

目录
相关文章
|
开发工具 git
TLS certificate verification has been disabled
TLS certificate verification has been disabled
1027 0
TLS certificate verification has been disabled
|
3月前
|
Unix 网络安全 数据安全/隐私保护
putty Faual Error:No supported authentication methods available (server sent: publickey)
putty Faual Error:No supported authentication methods available (server sent: publickey)
125 0
|
9月前
|
分布式计算 Hadoop Linux
Centos7配置Hadoop出现Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)的解决
Centos7配置Hadoop出现Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)的解决
385 0
|
3月前
|
Web App开发 安全 小程序
Edge ERR_SSL_VERSION_OR_CIPHER_MISMATCH问题解决
以往应用的一些系统,可能因为年代久远,只能支持SSL的低版本协议,在Win 10和Win 11强制使用edge取代Internet explore以后: - 因为edge本身默认不支持低版本的SSL协议; - 老旧系统可能本身只能支持Internet explore。
310 1
|
7月前
|
存储 小程序 API
报错-小程序:errMsg: “getUserProfile:fail privacy permission is not authorized“
报错-小程序:errMsg: “getUserProfile:fail privacy permission is not authorized“
203 0
|
网络安全 数据安全/隐私保护
阿里云Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
阿里云Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
235 0
|
算法 网络安全 开发工具
Permission denied (publickey,gssapi-with-mic). fatal: Could not read from remote repository.
Permission denied (publickey,gssapi-with-mic). fatal: Could not read from remote repository.
|
NoSQL 安全 MongoDB
mongorestore[报错]auth error: sasl c onversation error: unable to authenticate using mechanism
mongodb中添加了admin表的用户,即创建了超级管理员(mongodb的安全生产环境的权限设置请查看: [https://blog.csdn.net/Chenftli/article/details/105228130](https://blog.csdn.net/Chenftli/article/details/105228130)),此时我想去将备份的集合的bson文件数据导入到mongodb指定的数据库时会报出上面的错误。 ##### 尝试 尝试使用下面的命令执行
575 0
|
网络安全
ssl.SSLError [SSL CERTIFICATE_VERIFY_FAILED] certificate verify failed
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed
172 0
|
网络安全
启动hdfs报错:hadoop100 Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)
启动hdfs报错:hadoop100 Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)
211 0
启动hdfs报错:hadoop100 Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)

热门文章

最新文章