[error][/usr/share/perl5/vendor_perl/MHA/SSHCheck.pm, ln63] Permission denied (publickey,gssapi-ke

When building mha, the following error was reported when using the masterha_check_ssh script to do ssh communication between the three nodes.

Master: 192.168.0.60 master
backup1: 192.168.0.61 slave1
Backup 2: 192.168.0.62 slave2, while the management node of mha is placed on the second slave

[root@manager mha_master]# masterha_check_ssh –global_conf=/etc/mha_master/mha.cnf –conf=/etc/mha_master/mha.cnf
Sun Sep 26 14:30:23 2021 – [info] Reading default configuration from /etc/mha_master/mha.cnf…
Sun Sep 26 14:30:23 2021 – [info] Reading application default configuration from /etc/mha_master/mha.cnf…
Sun Sep 26 14:30:23 2021 – [info] Reading server configuration from /etc/mha_master/mha.cnf…
Sun Sep 26 14:30:23 2021 – [info] Starting SSH connection tests…
Sun Sep 26 14:30:24 2021 – [error][/usr/share/perl5/vendor_perl/MHA/SSHCheck.pm, ln63]
Sun Sep 26 14:30:23 2021 – [debug] Connecting via SSH from [email protected](192.168.0.60:22) to [email protected](192.168.0.61:22)…
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
Sun Sep 26 14:30:24 2021 – [error][/usr/share/perl5/vendor_perl/MHA/SSHCheck.pm, ln111] SSH connection from [email protected](192.168.0.60:22) to [email protected](192.168.0.61:22) failed!
Sun Sep 26 14:30:24 2021 – [error][/usr/share/perl5/vendor_perl/MHA/SSHCheck.pm, ln63]
Sun Sep 26 14:30:24 2021 – [debug] Connecting via SSH from [email protected](192.168.0.61:22) to [email protected](192.168.0.60:22)…
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
Sun Sep 26 14:30:24 2021 – [error][/usr/share/perl5/vendor_perl/MHA/SSHCheck.pm, ln111] SSH connection from [email protected](192.168.0.61:22) to [email protected](192.168.0.60:22) failed!
Sun Sep 26 14:30:25 2021 – [error][/usr/share/perl5/vendor_perl/MHA/SSHCheck.pm, ln63]
Sun Sep 26 14:30:24 2021 – [debug] Connecting via SSH from [email protected](192.168.0.62:22) to [email protected](192.168.0.60:22)…
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
Sun Sep 26 14:30:25 2021 – [error][/usr/share/perl5/vendor_perl/MHA/SSHCheck.pm, ln111] SSH connection from [email protected](192.168.0.62:22) to [email protected](192.168.0.60:22) failed!
SSH Configuration Check Failed!
at /bin/masterha_check_ssh line 44.
The solution is as follows.

    1. Manually check if the ssh communication between the three nodes is normal , use the format ssh node1 date, each node is executed three times, pay attention to the user who does the ssh communication, for example: I use mysql to do the mutual trust between the three nodes, then we have to switch to mysql to do the check, not the root user
    1. [mysql@slave1 .ssh]$ ssh master date
    1. Sun Sep 26 14:48:30 CST 2021
    1. [mysql@slave1 .ssh]$ ssh slave1 date
    1. Sun Sep 26 14:48:34 CST 2021
    1. [mysql@slave1 .ssh]$ ssh manager date
    1. Sun Sep 26 14:48:38 CST 2021 Use mysql user to execute mutual trust script check, check all ok
    1. Check script.
    1. masterha_check_ssh –global_conf=/etc/mha_master/mha.cnf –conf=/etc/mha_master/mha.cnf
      1. or
    masterha_check_ssh –conf=/etc/mha_master/mha.cnf

[mysql@manager .ssh]$ masterha_check_ssh –global_conf=/etc/mha_master/mha.cnf –conf=/etc/mha_master/mha.cnf
Sun Sep 26 14:29:30 2021 – [info] Reading default configuration from /etc/mha_master/mha.cnf…
Sun Sep 26 14:29:30 2021 – [info] Reading application default configuration from /etc/mha_master/mha.cnf…
Sun Sep 26 14:29:30 2021 – [info] Reading server configuration from /etc/mha_master/mha.cnf…
Sun Sep 26 14:29:30 2021 – [info] Starting SSH connection tests…
Sun Sep 26 14:29:31 2021 – [debug]
Sun Sep 26 14:29:30 2021 – [debug] Connecting via SSH from [email protected](192.168.0.60:22) to [email protected](192.168.0.61:22)…
Sun Sep 26 14:29:31 2021 – [debug] ok.
Sun Sep 26 14:29:31 2021 – [debug] Connecting via SSH from [email protected](192.168.0.60:22) to [email protected](192.168.0.62:22)…
Sun Sep 26 14:29:31 2021 – [debug] ok.
Sun Sep 26 14:29:32 2021 – [debug]
Sun Sep 26 14:29:31 2021 – [debug] Connecting via SSH from [email protected](192.168.0.61:22) to [email protected](192.168.0.60:22)…
Sun Sep 26 14:29:31 2021 – [debug] ok.
Sun Sep 26 14:29:31 2021 – [debug] Connecting via SSH from [email protected](192.168.0.61:22) to [email protected](192.168.0.62:22)…
Sun Sep 26 14:29:31 2021 – [debug] ok.
Sun Sep 26 14:29:33 2021 – [debug]
Sun Sep 26 14:29:31 2021 – [debug] Connecting via SSH from [email protected](192.168.0.62:22) to [email protected](192.168.0.60:22)…
Sun Sep 26 14:29:32 2021 – [debug] ok.
Sun Sep 26 14:29:32 2021 – [debug] Connecting via SSH from [email protected](192.168.0.62:22) to [email protected](192.168.0.61:22)…
Sun Sep 26 14:29:32 2021 – [debug] ok.
Sun Sep 26 14:29:33 2021 – [info] All SSH connection tests passed successfully.
3. If you use root to execute the script, it will report the theme error, remember to switch the user.

Read More: