SSH public key failing without error message


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users SSH public key failing without error message
# 1  
Old 03-29-2012
SSH public key failing without error message

My password-free ssh connection has worked in the past but has stopped working and I can't get it going again.

The files in .ssh on both source and target are set to 600:
Code:
drwx------   2 ingres      1024 Mar  2 13:57 .
drwxr-xr-x  25 ingres      2048 Mar 29 09:38 ..
-rw-------   1 ingres       454 Mar 29 08:38 authorized_keys
-rw-------   1 ingres       887 Mar  2 13:15 id_rsa
-rw-------   1 ingres       227 Mar  2 13:15 id_rsa.pub
-rw-------   1 ingres      5033 Mar 13 09:43 known_hosts

The home directory on both servers is set to 755. I created the key using ssh-keygen -t rsa.

When running with -v-v-v I get this (output truncated to publickey statements):

Code:
debug1: Next authentication method: publickey
debug1: Trying private key: /bs01/ingres/.ssh/identity
debug3: no such identity: /bs01/ingres/.ssh/identity
debug1: Trying public key: /bs01/ingres/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 149 lastkey 6ef18 hint 1
debug2: input_userauth_pk_ok: fp da:3f:10:82:dd:91:fa:c4:a8:6c:8d:87:77:73:62:e9
debug3: sign_and_send_pubkey
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive
debug1: Trying private key: /bs01/ingres/.ssh/id_dsa

The debug information doesn't help me much, because it doesn't seem to show any errors for the public key. I'm also puzzled when it lists publickey under Authentications that can continue, even though it's already tried it.

Can anyone give me some pointers?

Thanks

Last edited by Scrutinizer; 04-04-2012 at 03:46 PM.. Reason: code tags
# 2  
Old 03-29-2012
Did it ask for password or just failed? Maybe your remote .profile has something wrong.
# 3  
Old 03-29-2012
It went on to:
debug1: Next authentication method: keyboard-interactive
and then it did ask for a password.
# 4  
Old 03-29-2012
Ask SA check the log on the server /var/log/auth.log. Or run your own sshd with "-d" option, your own config file, key file, port. Then you will be able to see why the server reject your key.
https://www.unix.com/shell-programmin...#post302499819
# 5  
Old 03-29-2012
Who owns the key file? I mean, are you "ingres"?
I have noticed that the user who owns the key file, gets this kind of issue.
Try creating the file with group id or something similar and then try running the ssh command.
# 6  
Old 03-29-2012
Please try setting non recursive chmod (644) for $HOME i $HOME/.ssh
OpenSSH FAQ 3.14

Code:
chmod 644 $HOME $HOME/.ssh

See if that helps.

Regards
Peasant.
# 7  
Old 04-04-2012
If you mean set it to 755, then it is already that on both servers for $HOME; I have set $HOME/.ssh to 700.

Does anyone know what these debug messages indicate - to me, it looks like the key is being accepted, but I am relatively new to SSH:

Code:
debug1: Server accepts key: pkalg ssh-rsa blen 149 lastkey 6ef18 hint 1
debug2: input_userauth_pk_ok: fp da:3f:10:82:dd:91:fa:c4:a8:6c:8d:87:77:73:62:e9
debug3: sign_and_send_pubkey
debug1: read PEM private key done: type RSA


Last edited by Scrutinizer; 04-04-2012 at 03:46 PM.. Reason: code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to create a public/private key using ssh-keygen

Hi, please guide me create a public/private key using ssh-keygen, lets say I have been access to server named pngpcdb1with a userid and password ...!!! and also please explain in detail the concept of these keys and ssh as I was planning to use them in ftp related scripts..! Thanks in... (1 Reply)
Discussion started by: rahul125
1 Replies

2. Solaris

Solaris 8 ssh public key authentication issue - Server refused our key

Hi, I've used the following way to set ssh public key authentication and it is working fine on Solaris 10, RedHat Linux and SuSE Linux servers without any problem. But I got error 'Server refused our key' on Solaris 8 system. Solaris 8 uses SSH2 too. Why? Please help. Thanks. ... (1 Reply)
Discussion started by: aixlover
1 Replies

3. Red Hat

SSH Public key Authentication Issue

Hi All; I have an issue with password less authentication via ssh ( v2) I have two servers Server A and Server B, following are the server details Server A OS - HP UX B.11.11 U 9000/800 SSH - OpenSSH_4.3p2-hpn, OpenSSL 0.9.7i 14 Oct 2005 HP-UX Secure Shell-A.04.30.000, HP-UX... (3 Replies)
Discussion started by: maverick_here
3 Replies

4. UNIX for Dummies Questions & Answers

Public Key Authentication over SSH and Sudo-ing Implementation

Hi, We are currently implementing an Identity Management application which has several Unix systems as its target system. A pre-defined connector will be installed to provide connection between the Identity Management application and the Unix target system. The connection will use Public Key... (1 Reply)
Discussion started by: tristanD
1 Replies

5. AIX

ssh public key setup questions.

Hi all, I have N number of AIX hosts, where I need to login frequently and do some routine tasks (run some scripts). I need to setup ssh public/private key, so I can auto-login via a master (wrapper) script and run each script in each server. I am trying to setup/generate ssh keys, but am... (6 Replies)
Discussion started by: haroon_a
6 Replies

6. UNIX for Advanced & Expert Users

Generate Public key for non ssh enabled servers

I am writing a script that needs to access various servers some of which are not ssh enabled. In order to access the ssh enabled servers I am using the following command to generate the public key : ssh-keygen -t rsa Is there a similar command for the other servers as well. If I try to use... (1 Reply)
Discussion started by: ravneet123
1 Replies

7. Shell Programming and Scripting

Generate Public Key when the server is not ssh enabled

I am writing a script that needs to access various servers some of which are not ssh enabled. In order to access the ssh enabled servers I am using the following command to generate the public key : ssh-keygen -t rsa Is there a similar command for the other servers as well. If I try to use... (1 Reply)
Discussion started by: ravneet123
1 Replies

8. UNIX for Advanced & Expert Users

Setting Up public key on Windows for ssh/scp

Hi, I am trying to scp a file from our Unix server to the local Windows machine.I have created the key pair in Unix server using ssh-keygen command in unix. But I am not sure where can we put the public key(generated on Unix) in Windows machine so that scp from Unix machine to Windows is... (3 Replies)
Discussion started by: dennis.jacob
3 Replies

9. UNIX for Advanced & Expert Users

SSH - Public key

When should one have to generate a public key on a Server when the public key is already created and used by other clients? Thanks, Rahul. (6 Replies)
Discussion started by: rahulrathod
6 Replies

10. Shell Programming and Scripting

SSH Public key method

do we need root access for the remote server to ssh without a password(i.e by using id_rsa.pub method)??? (1 Reply)
Discussion started by: roshanjain2
1 Replies
Login or Register to Ask a Question