I'm working from the URL I found here:
My ssh client is Ubuntu 64 bit 11.10 desktop and my server is Centos 6.2 64 bit. I have followed the directions. I still get a password prompt on ssh.
I'm not sure what to do next.
|
I'm working from the URL I found here: My ssh client is Ubuntu 64 bit 11.10 desktop and my server is Centos 6.2 64 bit. I have followed the directions. I still get a password prompt on ssh. I'm not sure what to do next. |
||||
|
Make sure the permissions on the
¹ Except on some distributions (Debian and derivatives) which have patched the code to allow group writability if you are the only user in your group. |
|||||||||||||||||||||
|
|
If you have root access to the server, the easy way to solve such problems is to run sshd in debug mode, by issuing something like
If it isn't possible to use an alternative port, you can temporarily stop the SSH daemon and replace it with one in debug mode. Stopping the SSH daemon does not kill existing connections so it is possible to do this through a remote terminal, but somewhat risky - if the connection does get broken somehow at a time when the debug replacement is not running, you are locked out of the machine until you can restart it somehow. The commands required:
|
|||||||||||||||||||||
|
|
Is your home dir encrypted? If so, for your first ssh session you will have to provide a password. The second ssh session to the same server is working with auth key. If this is the case, you could move your What I ended up doing was create a
This allows multiple users to have this ssh access without compromising permissions. |
|||||||||||||
|
|
After copying keys to the remote machine and putting them inside the
|
|||||||||
|
|
I faced challenges when the home directory on the remote does not have correct privileges. In my case the user changed the home dir to 777 for some local access with in the team. The machine could not connect with ssh keys any longer. I changed the permission to 744 and it started to work again. |
|||||||||
|
|
Just try these following commands
|
|||||||||||||||||
|
|
SELinux on RedHat/CentOS 6 has an issue with pubkey authentication, probably when some of the files are created selinux is not setting its ACLs correctly. To manually fix the SElinux ACLs for the root user:
|
|||
|
|
|
We ran into the same problem and we followed the steps in the answer. But it still did not work for us. Our problem was that login worked from one client but not from another (the .ssh directory was NFS mounted and both clients were using the same keys). So we had to go one step further. By running the ssh command in verbose mode you get a lot of information.
What we discovered was that the default key (id_rsa) was not accepted and instead the ssh client offered a key matching the client hostname:
Obviously this will not work from any other client. So the solution in our case was to switch the default rsa key to the one that contained user@myclient. When a key is default, there is no checking for client name. Then we ran into another problem, after the switch. Apparently the keys are cached in the local ssh agent and we got the following error on the debug log:
This was solved by reloading the keys to the ssh agent:
|
|||
|
|
|
It would be SSH miss configuration at server end. Server side sshd_config file has to be edited. Located in
Based on http://kaotickreation.com/2008/05/21/disable-ssh-password-authentication-for-added-security/ |
||||
|
|
|
Two comments: this will overwrite the original file. I'd just copy the public key generated and do something like:
This will append the key you want to use to the pre-existing list of keys. Also, some systems use the file |
|||||||||||||||||
|
|
In /etc/selinux/config file changing SELINUX to disabled from enforcing made passwordless ssh work successfully. Earlier I am able to do it on one way. Now from bothways I am able to do passwordless ssh. |
|||
|
|
|
My solution was that the account was locked. Message found in /var/log/secure: User not allowed because account is locked Solution: give the user a new password. |
|||||
|
|
I ran into a similar problem and followed the steps using the debug mode.
This showed the following result
It was really confusing
It showed the root directory had permissions for every one. We changed it so that others would not have permissions.
The key authentication started working. |
|||||||||
|
|
Ensure that
It may be that you just need to uncomment the line: AuthorizedKeysFile .ssh/authorized_keys Mind that you must reload ssh service for the changes to take place:
|
||||
|
|
|
These steps should help you out. I use this regularly among many 64bit Ubuntu 10.04 machines.
you could put this in a script with some prompts and invoke it as
|
|||||||||||||
|
|
I had similar problem with ssh. In my case the problem was that I installed hadoop cloudera (from rpm on centos 6) and it created user hdfs with home directory
I changed in /etc/passwd |
|||
|
|
|
One thing that I had wrong was the ownership on my home directory on the server system. The server system was set to default:default so I:
And it worked. Another Cheap workaround is to Disable StrictModes: StirctModes no. in sshd_config. This will at least tell you if the key exchange and connection protocols are good. Then you can go hunt the bad permissions. |
||||
|
|
|
For me, the solution was opposite Wojtek Rzepala's: I didn't notice I was still using D'oh! |
|||||
|
|
I just had this same problem, and for me the solution was to set Extra background to help anyone with the same situation: I'm connecting from a host running Dropbear to one running OpenSSH. With
Providing the identity file with |
|||
|
|
|
After checking the permissions, and trying several other solutions listed here, I finally removed the ssh directory on the server, the setup my public key again. Server commands:
Local commands:
|
|||
|
|
|
In the past I came across some tutorials that describe how to achieve a ssh password-less setup, but some are sadly wrong.
Now, if it's still not working after the described 3 steps, lets try the following:
|
||||
|
|
|
My scenario was that I have a NAS server on which I created a Check to see if:
This magically resolved my issue. I had previously checked all my permissions and even the RSA fingerprints of the public and private keys. This is strange and probably a bug with |
|||
|
|
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
chmod 700– Rob Apr 16 '12 at 14:55/var/log/auth.logwill tell you why the login is failing. – UtahJarhead Apr 17 '12 at 4:05/var/log/secure. – Dennis Williamson Oct 2 '13 at 20:36