- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ssh public key - keeps prompting for password
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2008 10:06 AM
тАО11-14-2008 10:06 AM
I'm pulling my hair out on this. Using OpenSSH_3.6.1p2 and am using ssh public keys and keep getting prompted for a password. The process I've done is as follows:
1) ssh-keygen -t rsa
2) copied the id_rsa.pub to the /home/.ssh directory of the remote host into an authorized_keys2 file.
3) made sure that permissions on the .ssh directory on both servers is 700
4) made sure that permissions for the authorized_keys2 file is 644 on the remote host. The id_rsa.pub on the client also has 644 permissions.
5) I need to have ssh working both ways between the servers. If I do it from one server as outlined above, it prompts for a password, if I do it the other way, it does not and works beautifully.
6) I've checked ssh.config and sshd.config between the servers, they're exactly alike.
I'm attaching the ssh -v [servername] output. Obviously I would expect a line in there saying that the public key is being accepted, but that is not happening, so it falls through to password authentication. Does anyone have any clues? I've obviously gone through many other threads on the subject and nothing has worked thus far.
I would be eternally grateful for any clue.
Thanks
Mauro
ssh -v server output
-----------------------
ssh -v sargon
OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090702f
debug1: Reading configuration data /opt/ssh/etc/ssh_config
debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug1: Connecting to sargon [172.16.3.44] port 22.
debug1: Connection established.
debug1: identity file /home/appltest/.ssh/id_rsa type 1
debug1: identity file /home/appltest/.ssh/id_dsa type 2
debug1: Remote protocol version 2.0, remote software version OpenSSH_3.6.1p2
debug1: match: OpenSSH_3.6.1p2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.6.1p2
debug1:
debug1: Mechanism encoded as toWM5Slw5Ew8Mqkay+al2g==
debug1:
debug1: Mechanism encoded as A/vxljAEU54gt9a48EiANQ==
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 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 'sargon' is known and matches the RSA host key.
debug1: Found key in /home/appltest/.ssh/known_hosts:1
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: external-keyx,gssapi,publickey,passwo
rd,keyboard-interactive
debug1: Next authentication method: external-keyx
debug1: Authentications that can continue: external-keyx,gssapi,publickey,passwo
rd,keyboard-interactive
debug1: Next authentication method: gssapi
debug1:
debug1:
debug1:
debug1: Next authentication method: publickey
debug1: Offering public key: /home/appltest/.ssh/id_rsa
debug1: Authentications that can continue: external-keyx,gssapi,publickey,passwo
rd,keyboard-interactive
debug1: Offering public key: /home/appltest/.ssh/id_dsa
debug1: Authentications that can continue: external-keyx,gssapi,publickey,passwo
rd,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: external-keyx,gssapi,publickey,passwo
rd,keyboard-interactive
debug1: Next authentication method: password
appltest@sargon's password:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2008 10:20 AM
тАО11-14-2008 10:20 AM
Re: ssh public key - keeps prompting for password
maybe the above will help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2008 10:28 AM
тАО11-14-2008 10:28 AM
Re: ssh public key - keeps prompting for password
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2008 10:32 AM
тАО11-14-2008 10:32 AM
SolutionOldschool may have the right answer.
grep -i authorizedkeysfile /opt/ssh/etc/sshd_config
and see what ssh is looking for. Older versions used the authorized_keys2 for whatever reason, possibly to separate ssh ver 1 from ver 2 keys. Newer versions went straight for the authorized_keys file.
If that doesn't pan out, check syslog. ssh is usually very good about logging why it's not letting a public key authenticate.
If *that* doesn't pan out, change the SyslogFacility to AUTH and the LogLevel to VERBOSE in the sshd_config file, sighup sshd and try again. You should see something in syslog then.
HTH;
Doug
------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2008 11:23 AM
тАО11-14-2008 11:23 AM
Re: ssh public key - keeps prompting for password
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2008 12:54 PM
тАО11-14-2008 12:54 PM
Re: ssh public key - keeps prompting for password
<---- you should have gotten a message that the key was accepted here.....
===========================================================================
debug1: Authentications that can continue: external-keyx,gssapi,publickey,passwo
rd,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: external-keyx,gssapi,publickey,passwo
rd,keyboard-interactive
debug1: Next authentication method: password
appltest@sargon's password:
====================================================
suggest you crank the logging up one more level w/
ssh -vv sargon
Also, on the destination server, the destination directory that you are logging into needs to have permissions set to r/x for "group" and "others", .ssh directory is 700 and all the files are 600 correct? you've tried redistributing the keys or regen/redistribute?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2008 01:00 PM
тАО11-14-2008 01:00 PM
Re: ssh public key - keeps prompting for password
Mauro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2008 01:12 PM
тАО11-14-2008 01:12 PM
Re: ssh public key - keeps prompting for password
Thanks again,
Mauro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2008 01:26 PM
тАО11-14-2008 01:26 PM
Re: ssh public key - keeps prompting for password
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2008 01:34 PM
тАО11-14-2008 01:34 PM
Re: ssh public key - keeps prompting for password
> directory needed the appropriate
> permissions. [...]
It's a pretty reasonable security policy.
If its parent directory lets anyone play
around, then it doesn't matter much what the
permissions on ".ssh" itself are, because
then anyone could change the permissions on
".ssh", play around in it, and change them
back. Unless the permissions are restrictive
all the way to the top, they're really not
restrictive.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2008 01:45 PM
тАО11-14-2008 01:45 PM
Re: ssh public key - keeps prompting for password
Mauro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2008 01:55 PM
тАО11-14-2008 01:55 PM
Re: ssh public key - keeps prompting for password
"StrictModes" parameter in sshd_config allows those checks to be bypassed....
as I said tho, its not recommended for the reasons Steve noted.......