Ssh to the same host is not working

I am trying to ssh the same host where I am logged in.It's asking for the password.

Please assist me with the troubleshooting steps for this.

Best regards,
Vishal

The very interesting question is why are you trying to ssh to same host?

Yes, it will ask you for password when you try to connect. Unless you want to add its "public key" to "authorized_keys" file.

Check that the hostname resolving works correctly.
E.g. the own hostname should not be preceded by localhost in /etc/hosts .

Hello,

There are 3 nodes.ssh is working fine from node 1 to 2 and node 1 to 3 but not vice versa. It looks to be some issue with public key of node 1.Even node 1 ssh to itself is not working.

Also the hostname is not preceded by localhost in /etc/hosts.

Please share the steps to be done further/can I generate the public key now for node 1 and copy this to authorized_keys in all the nodes.

Best regards,
Vishal

Ok, you yourself gave the partial answer, it may not be an issue. But, one may have not created the "authorized_keys" file under node 1, with "Public key" of node 2 and node3, if you add those keys to the file you should be able to ssh into the server (node 1) without prompting for password.