Not able to do passwordless ssh from one user to another machine same user.
hello,
i am not able to do password less ssh from one machine user to another user.
steps i did .
su - username
ssh-keygen
enter
enter
enter
ssh-copy-id -i username@ip
still have the same issue
Responses
Hi Yogesh,
Does that mean you could do ssh successfully and login by entering password, however, password less login to same user is not working? If so, try to capture verbose output of ssh command paste the results here (you would need to run ssh -v , to increase verbosity add one more 'v').
Also, you may try removing/deleting the 'authorized_keys' file under respective users home directory on destination and then execute 'ssh-copy-id' again and test. NOTE: There may be multiple keys in this file, so, you would need to check and delete respective key, also, better you take backup of this file first before attempting to edit it. So, if any chance the file gets corrupted/broken you could restore it from backup.
All the best!
It's worth noting that ssh-keygen actually has an option for deleting a particular key from the default authorized_keys file:
ssh-keygen -R <hostname>
(Note the upper case R)
It may be safer than messing around in the file with an editor.
This also creates a backup file, but note that it will be overwritten by next backup each time you run the command.
Please format your log file input. Add these lines between ~~~ and ~~~ so it looks good.
I guess you've not understood what I told before. Let me make it simple, you would need to start the beginning of line with 3 symbols (~~~) and then insert text in between and then end the line with again 3 symbols. Say for example, if I wish to insert some command output then I'll do like this:
[root@ansi-host ~]# rpm -q --last kernel
kernel-3.10.0-514.el7.x86_64 Thu 08 Jun 2017 08:27:43 AM EDT
kernel-3.10.0-229.el7.x86_64 Tue 10 Jan 2017 06:58:00 AM EST
So, the above output I've formatted it and the text is pasted between "~~~" as it looks neat.
Yes, that could be the reason. Make sure the files under ~/.ssh folder holds proper permissions. You may refer to any users default file/directory permissions of .ssh and make sure it is set accordingly. It looks like that it was unable to read the key files.
Hi Yogesh,
For your convenience, these are the appropriate permissions for the files in the ssh folder Sadashiva mentioned :
chmod 600 /home/<your-user-name>/.ssh/id_rsachmod 644 /home/<your-user-name>/.ssh/id_rsa.pub
Also, please format terminal outputs properly, as you were asked to do by Sadashiva, the text is a pain to read. :)
Regards,
Christian
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
