Unable to set ssh passwordless authentication
I am unable to ssh with passwordless authentication from Windows client onto UBuntu server. The ssh version on UBuntu is OpenSSH_5.8p1 Debian-7ubuntu1, OpenSSL 1.0.0e , while SSH on Windows Client is OpenSSH_5.1p1, OpenSSL 0.9.8k. I turned on ssh debugging and noticed these messages on server and client:
I verified that the permissions on authorized_keys, .ssh etc on host are correct. I regenerated host keys to get around the 'Could not load host keys' and restarted ssh services, but problem persists. Here are contents of sshd_config:
Any suggestions on what could be wrong? The host private keys are unable to load because they are owned by 'root' user. Changing their permissions to anything other than mode 600 is not allowed. I appreciate any solutions. I am stuck at this point.. please help!
Last edited by Scott; 11-12-2012 at 06:40 PM..
Reason: Code tags
First, I would make sure that the passwordless ssh works to localhost on both hosts. This way, you are dealing with one .ssh directory. The id_rsa file seems messed up from the printout. I often just "scp -rp .ssh wherever:." once I get localhost working, and then the keys match perfectly, although perversely any localhost//127.0.0.1 keys do not and it will tell you where they are to discard them so they can be reset for the local host keys.
Yes, having the right permissions on $HOME and everything from .ssh*/ down is very important. Hence, I scp them with -p, so I do not get umask derived permissions.
1. the sshd_config files seems ok, I don't think you should edit it.
2. check for correct permissions on the server-side ~/.ssh directory of the user you are going to login with; they should be:
700 (rwx --- ---) for ~/.ssh directory
600 (rw- --- ---) for all the files inside ~/.ssh directory
3. please check that the public key you are using to perform passwordless authentication is correctly stored in server-side file ~/.ssh/authorized_keys
The format of the key should be something like:
be aware that the newlines in public key are just a consequence of the fact that the text may be wrapped by the text editor/viewer: the key itself should not contain newline characters (sometimes ssh_keygen on windows may produce weird output results).
For the same reason, if you generated the key pair on a windows machine, make sure to sanitize the content of the private and public key in order to comply with the server newline standard (see for example 'man dos2unix').
4. when invoking ssh on the client, please remember to specify the user to login with and try to explicitly indicate the private key you want to use in order to authenticate (using the -i switch of ssh).
Hey team
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... (5 Replies)
Hi,
I am in the process FTPing some of my report files from my production server to another FTP server through batch/Shell Script.
This is working fine with the password less authentication.
Once i place all my report files in the ftp server the end users need to download ... (3 Replies)
Hello,
Need a suggestion to setup private key passwordless authentication. I am not sure this can done or not :wall:
here is the sincerio
I have two servers, sever1 with a user "user1" and servera with usera
here dataflow: usera from servera, will pull/push files to server1 on user1... (2 Replies)
hi,
i have tried with passwordless shh in google..
i followed the below steps ...
user:~> ssh-keygen -t rsa
Enter file in which to save the key (/home/cantin/.ssh/id_rsa):key.txt
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
till this step i... (0 Replies)
I have experience in setting up passwordless authentication by sharing ssh public keys manually.Currently I am in the process to the write a script to perform the same functionality from one source(host) to multiple destinations.
I have one source host (Host A) whose public keys has to be shared... (9 Replies)
Dear All
I need to discuss about the problem which has been discussed so many times here. I need to transfer a file from server A to server B via passwordless SFTP script. By reading the threads on this topic here, I followed the below steps but still it's not working ..
Pls find the steps... (13 Replies)
Hi,
Can someone help me on ssh-keygen usage...?
I used ssh-keygen after which "id.pub" file was generated in system1's > .ssh directory...
I copied the same into the remote system system2 > .ssh directory as "authorized_keys" file.
Now i tried ssh connection from system 1 to system... (7 Replies)
Hello,
I would like to issue a couple of commands as root on a remote machine without having to enter the root password. I used "ssh-keygen -t rsa" to generate the encryption keys, copied the public key to the remote machine, etc.
I also tried playing around with the sshd_config file and... (3 Replies)
I am trying to implement passwordless authentication via ssh2. I have used the well documented technique of generating a key pair with a blank passphrase on my client machine, and installing the public key on the destination server (AIX 5.3) in the user's .ssh2 directory. I have used this technique... (1 Reply)