I have created a private/public dsa-keypair. I've put the public key on the server in
~/.ssh/authorized_keys
Everything is set up like my other server, but it seems like the server is just ignoring my efforts.
|
|
|
Although your problem may have already been solved by other answeres, I've locked myself out of enough machines from not validating sshd_config changes before signing off so have come up with the below process that might be useful for future debugging of sshd config changes: DO NOT DISCONNECT an active ssh connection until AFTER testing has verified behaviour is as you expect. a. verify what you think sshd is supposed to be doing b. verify the configuration is valid using "-t" c. start a verbose 'test' version of the server you can live monitor d. start a verbose 'test' client connection you can live monitor a. verify what you think sshd is supposed to be doing Review the sshd configuration file without all the commentary with something like the below (assuming sshd_config is the correct file and in /etc/ssh)
This just clears things out so we verify what we think we're changing (not necessarily whether it is correct or not.) b. verify the configuration is valid using "-t" From the man page of the sshd's I'm using,
Other changes can have more subtle circumstances. For example, do not disable password authentication until you are sure that the public key authentication is working correctly. c. start a verbose 'test' version of the server you can live monitor
This keeps your existing, working session active, but gives you another instance of sshd to verify your new configuration changes. SSHD is now running in the foreground to a user-defined port (9999 in our example.) and pushing a lot of noisy debug information you can track in /var/log/authlog (or possibly /var/log/auth.log depending on your OS.) d. start a verbose 'test' client connection you can live monitor Run the ssh client connection in verbose mode to display on your screen more information that might lead you to better debugging your error.
You should now have enough information in either the server's log files, or the client's connection screen to isolate your problem. The solution generally comes down to file permissions (as shown by Magnar and setatakahashi) Best of luck |
|||||
|
|
The server will ignore your authorized_keys file if the owner properties are wrong. Changing it to this fixes it:
|
|||||||||||||||
|
Check for these attributes in /etc/ssh/sshd_config
|
|||||||
|
|
Check |
|||||||
|
|
All of the above discussions are perfect for if you're using an openssh style of ssh. If you're system is using ssh2 then it has a totally wacky different way to manage keys. This article discusses the hows and whats. http://burnz.wordpress.com/2007/12/14/ssh-convert-openssh-to-ssh2-and-vise-versa/ |
|||
|
|
|
In case you already logged out from server and cannot log in due to invalid server configuration then following forces client to use password: ssh @ -p -o 'PasswordAuthentication yes' -o 'ChallengeResponseAuthentication no' -o 'PreferredAuthentications password' |
|||
|
|