I need help in reconfiguring password connection-less on 3 servers.
I had this feature on 3 servers, working fine for servers A, B and C, but for some unknown reason, and after a reboot was performed, from server B to server A is asking me for password, the same applies from server C to server A.
I try to setup again by generating a public key again, but if If I choose to overwrite already existing file, it might damage the already connection between servers A and B and A and C.
Please can someone help
For server A to accept connections from servers B & C, it needs to have the public keys for the connecting accounts from those two servers in the authorized_keys file owned by the user account on Server A that you are connecting to.
I don't know a reason that a re-boot would affect this. I'm assuming that you are using sshor sftp etc. Can you complete the process manually, and did it ask you to verify the remote host fingerprint again? That would indicate that the server keys have been regenerated. i suppose that this could happen on a boot if the server had the flag set for a first-time boot when the keys would be generated.
The authorized_keys file also needs to be RW only to the owner, so perhaps this has been undone.
, and earlier when I try to generate a key from server B to A:
ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/nikira_data01/.ssh/id_rsa):
/nikira_data01/.ssh/id_rsa already exists.
Overwrite (yes/no)? no
If you are trying to connect to UserA on ServerA, sign on manually and look in the home directory. There should be a directory call .ssh and within there, the file authorized_keys should exist. Do you have that?
The records in this file are made up from the public keys of users that you want to allow to connect. What do you have? This file should be public keys only, so you can happily paste the whole file without compromising your security, but please wrap it in
```text
&
```
tags to make it clear.
You should find a record that matches the public key for your user on ServerB. Perhaps send the public key as id_rsa.pub-from-ServerB from the user on ServerB to the user on serverA and use grep -f id_rsa.pub-from-ServerB authorized keys to see if you have a matching record.
Hopefully we will be able to work out what's wrong and correct it rather than rebuild everything.
Compare the security settings on the home directory between the server where private/public key works with the one where it does not work. If the public write and execute flags are turned on for the home directory then private/public key sign on won't work.
Just remove the id_rsa and id_rsa_vl58.pub files from your ~/.ssh directory as well as remove the public key from the authorized files on any server where it can connect with the key. Then generate a new key and put the public key on any server where you want to log in without a password.