Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to use SSH authentication between my WinXP desktop running Cygwin and a Mac laptop, and for the life of me, I can't get it working. My public key is on the macbook in the authorized_keys directory, and my private key is sitting there, all nice and happy in my ~/.ssh folder.

Here are the relevant lines from running ssh -vv user@server

debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /c/cygwin/home/beerhalj/.ssh/identity
debug1: Trying private key: /c/cygwin/home/beerhalj/.ssh/id_rsa
debug1: Trying private key: /c/cygwin/home/beerhalj/.ssh/id_dsa
debug1: read PEM private key done: type DSA
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,keyboard-interactive
debug2: we did not send a packet, disable method

It looks like my server sends a publickey packet, then doesn't send a packet and disables. Why? Or, what possible things should I try? Any help or suggestions would be appreciated.

As per SparX suggestion, I cat'd my sshd_config and there are only three non-comment lines

Protocol 2
SyslogFacility AUTHPRIV
Subsystem sftp/usr/libexec/sftp-server
share|improve this question
    
Adding SSH configuration of target machine will be useful. –  SparX Sep 13 '11 at 17:01

2 Answers 2

up vote 2 down vote accepted

Make sure that the authorized_keys file as well as the .ssh folder and your home folder aren't writable by anyone but yourself. Sshd disregards it otherwise.

share|improve this answer
    
I'm not really a linux guy, so what's the number for that? I definitely screwed this up, as I definitely did a chmod 777 authorized_keys at some point –  WindyCityEagle Sep 13 '11 at 18:44
    
Found it, chmod 600. Thank you so much. –  WindyCityEagle Sep 13 '11 at 19:25

I'd like to add a follow-up answer, just to keep in mind in the future. As of a few years ago, and this is probably still true, there still doesn't exist a perfect mapping of NT/AD style permissions to Unix permissions. I remember having a problem that if my .ssh files resided on a network drive, and were being used under cygwin, the permissions couldn't be set properly on the files, because the permissions model didn't allow for it.

It's possible to get burned by this and have it stump you for hours. However, I am guessing your current case that your files reside on a local drive, and this isn't affecting you.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.