当前位置: 代码迷 >> 综合 >> How to solve SSH Between Host Not Working problem in centos
  详细解决方案

How to solve SSH Between Host Not Working problem in centos

热度:45   发布时间:2023-12-15 00:32:33.0

I have server A and server B and can ssh from server A to server B if I’m logged in as the user whose keys have been set up

But, I can’t do user@serverB from server A logged in as another user

and I can’t do the following to allow the user to ssh to the local server

-bash-4.2$ ssh-copy-id jenkins@localhost
/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Check if “PasswordAuthentication” is set to “no” in /etc/ssh/sshd_config on the remote system if so, then change it to “yes” and restart sshd service and then check. By default this is set to “yes”.

[root@ansible-host ~]# grep ^PasswordAuthentication /etc/ssh/sshd_config 
PasswordAuthentication yes

Restart the sshd server

sudo systemctl restart sshd

参考文献

  • SSH Between Host Not Working
  相关解决方案