1832662 Members
2957 Online
110043 Solutions
New Discussion

Re: sshd question

 
SOLVED
Go to solution
Aljosa_1
Advisor

sshd question

Hi,


I'm trying to connect to my ssh server (3.91.002) on hpux 11.00. I'm trying to use public key authentication but I'm receiving following error: Authentication refused: bad ownership or modes for file authorized_keys. I check this file and have following permissions: 600 root sys. Any ideas?

Aljosa
11 REPLIES 11
Peter Godron
Honored Contributor

Re: sshd question

Peter Godron
Honored Contributor

Re: sshd question

Aljosa,
you may also want to scan through:
http://www.nitech.com/consulting/onlinesupport/unix/hpuxSecureShell.html
Regards
Gordon  Morrison_1
Regular Advisor

Re: sshd question

This may be a silly question, but are you trying to login as root? Only root can read the authorized_keys file with the ownership/permissions you stated.
What does this button do?
Jerome_18
New Member

Re: sshd question

Are you doing ssh from a unix/linux box.. or from a windows box.
If it's unix/linux, then try using
ssh -v option. It provides verbose information and will help in resolving the problem faster.
If you are using cygwin on windows, you can log all information onto a file and trace out the error.
Do atatch these outputs and send it.

Thanks
Jerome
Aljosa_1
Advisor

Re: sshd question

Hi,

at the client side (Windows) I use Putty.
I check and change file and folders permissions at the server site.

Now I'm getting error: server refuses our key and at the server site only error I found is in syslog.log: Failed none for root from ...

Aljosa
Andrew Cowan
Honored Contributor

Re: sshd question

SSH checks the ownership of the ".ssh" directory, and the "authorized_hosts", and your home directory. Check that all these are owned by you.

The other alternative is to set the variable:

StrictModes no

in "/etc/ssh/sshd_config, then restart sshd and retry to see if this is really the problem.

====
http://www.openbsd.org/cgi-bin/man.cgi?query=sshd_config&sektion=5&arch=&apropos=0&manpath=OpenBSD+Current

StrictModes
Specifies whether sshd should check file modes and ownership of the user's files and home directory before accepting login. This is normally desirable because novices sometimes accidentally leave their directory or files world-writable. The default is ``yes''.
====
Aljosa_1
Advisor

Re: sshd question

I change disable StrictModes: StrictModes no. But I'm still getting the same error?

Aljosa
Andrew Cowan
Honored Contributor
Solution

Re: sshd question

Have you tried using SSH to connect the Unix box back to itself? If you run up two telnet sessions, then run "sshd -d" on one, and "ssh -v localhost" this should tell you what SSH is complaining about.
Michael Selvesteen_2
Trusted Contributor

Re: sshd question

Please check the following,

1.Ensure you have correctly appended the correct public key generated from puttygen.exe to the
~/.ssh/authorized_keys
or
~/.ssh/authorized_keys2

2.At the client side (PuTTY), in the connection tab ensure you have provided the user name by which you connect to the server.

3. Check whether server supports public key authentication. ( setting yes to PubkeyAuthentication directive in sshd_config)

4. Try posting detailed server and client debug messages for better analysis.

All the Best.
Andrew Cowan
Honored Contributor

Re: sshd question

Another common problem with Putty keys is if you have copied them and picked-up some line breaks in the key. It should be one continuous line.
Aljosa_1
Advisor

Re: sshd question

Thnx all. I solve problem. There was missing a part of data in my autorized_keys file.

Aljosa