I have to enable password less authentication betweeen A to B server and A to C server and A to D server.
For this I generated a ssh key on server A using ssh-keygen command and copied the key using ssh-copy-id command to B, C and D server. Everything is working fine as of now but for confirmation is this approach ok
It is.
ssh-copy-id is a shell script which is written to ease the distribution of keys on Linux systems (not sure about other operating systems).
user@server:~$ file /usr/bin/ssh-copy-id
/usr/bin/ssh-copy-id: POSIX shell script, ASCII text executable
....
# Shell script to install your public key(s) on a remote machine
# See the ssh-copy-id(1) man page for details
....
You can do that 'by hand' as well (same effect), there are some handy oneliners like
You are saying that you can connect to server B from server A, and if you try it again you get password prompt ?
I would suspect someone is changing permissions on $HOME and .ssh folders.
They need to be per documentation, check out the section on the following link: