ssh prompts for password even though public and private keys have been generated
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
After that was done, I connected to the remote system as the user, but I was still prompted for a password. It should be noted that the root account has a similar setup between the two machines, and it can connect using this method without a problem.
Thanks for your reply. I changed the settings of the remote .ssh folder to 600, and then restarted the remote system's ssh server. Unfortunately, that did not help matters.
Here is the output that is generated when connecting in verbose mode:
Quote:
{localhost}[1] ssh -v sdc@<remote ip>
OpenSSH_4.2p1, OpenSSL 0.9.7f 22 Mar 2005
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to <remote ip> [<remote ip>] port 22.
debug1: Connection established.
debug1: identity file /export/home/sdc/.ssh/id_rsa type 1
debug1: identity file /export/home/sdc/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.2
debug1: match: OpenSSH_4.2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '<remote ip>' is known and matches the RSA host key.
debug1: Found key in /export/home/sdc/.ssh/known_hosts:3
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic
debug1: An invalid name was supplied
Unknown code krb5 243
debug1: An invalid name was supplied
Unknown code krb5 243
debug1: Next authentication method: publickey
debug1: Offering public key: /export/home/sdc/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Trying private key: /export/home/sdc/.ssh/id_dsa
debug1: Next authentication method: password
sdc@<remote ip>'s password:
The Unknown code errors also occur with the root account, but it successfully connects to the remote host.
I used the ssh-copy-id utility to see if that would help. I deleted the original .ssh directory on the remote system to allow the creation of a new one. I ran the command as the user in question on the local system, and it did appear to create the directory on the remote system. One thing I did notice: the permissions were set to 700 as opposed to 600.
I first connected with the permissions left as they were, and I was prompted for a password. I then changed the permissions to 600, and connected once more, but was still prompted for the password.
One other item of note: when the permissions on the .ssh directory were set to 600, the user in question could NOT change, or cd, into it even though the user is the owner of the directory. Only root could get into it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.