Error connecting from Mac to Linux via SSH (Permission denied (publickey...

Hello together,

I have a perfectly working setup with my XP machine, Putty and my Suse Linux server that allow for remote login via SSH. I use Public Key authentication.

However, when I try to login from my Mac, all I get from the Mac side is a

"Permission denied (publickey,keyboard-interactive)."

And I can't establish the connection. On the server in 'messages' I get:

"sshd{6046}: Accepted publickey for {userName} from {myHomeIP} port 38335 ssh2"

What could be wrong here?

I would like to use the same keys on my PC and my Mac so I just copied the key files into the .ssh directory on the Mac, did a chmod 600 on them and then tried to remote log-on with the follwoing from the terminal:

"ssh -l {userName} {host} -i {keyFile}"

My questions are:

1) How am I sure that the Mac uses the right key files? (or uses them at all)
2) How come my server says "accept publickey" and no connection is established?
3) Do you have any other idea on how I might get this to work? What I need is a method to copy files (not via FTP) to my server and let the process run without supervision / user interaction.

Thanks a lot for all your help!

Cheers

Message was edited by: Sebastian_R (some typos)

Posted on Jan 11, 2009 7:14 PM

Reply
4 replies

Jan 12, 2009 5:28 AM in response to Sebastian_R

If you copied your files from Windows, I would check to make sure your lines are <LF> terminated. I have not played with Putty so I do not know the way it line terminates its ssh key files, but Windows has a long tradition of using <CR><LF> to terminate its lines.

cat -v ~/.ssh/id_rsa # or whatever your file names are

If there are <CR> characters in the file, they will show up as ^M

Next get more diagnostic information from ssh using an *ssh -v -v -v*

If you know how to tell Putty to do the same thing, do it from Putty as well.

Now compare the debug output from the working vs the non-working ssh commands. The differences will tell you a lot.

If you look at *man ssh* and search for permissions it will tell you what files need restrictive permissions. You can get a permissions denied error if your home directory allows Group or Other write access. The $HOME/.ssh directory needs to be set so ONLY the Owner is allowed to access it. And some of the files in $HOME/.ssh require specific permissions. The ssh man page details this.

Jan 12, 2009 1:05 PM in response to Sebastian_R

I have svnserve running on my Mac Pro. When I try to connect to Mac Pro via ssh I get the following prompt and can't figure how to gain full access:

( success ( 1 2 ( ANONYMOUS EXTERNAL ) ( edit-pipeline svndiff1 absent-entries ) ) ) and anything I type followed by a return, the connection closes.

My ~/.ssh/authorized_users starts out with a command for my SVN repositories. Is there a way to bypass the command to gain full access?

// Sal

Jan 12, 2009 7:24 PM in response to BobHarris

Hi there,

firstly THANK YOU! I didn't really expect so fast and good Unix advice here, so thanks again.

Tried what you said: The key was indeed having the wrong CRLF characteres, so I removed them properly.
Still didn't really work: I was required to enter as passphrase for my key which I didn't have (or can't remember).

I finally solved it by creating a new identiy on the mac. Added that to the authorized keys on the linux machine and that worked.

It now seems kindda obvious to but your help really directed me into the right direction so thanks again!

Cheers, Sebastian

PS: And no, I'm not the other guy, I'm just me...

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Error connecting from Mac to Linux via SSH (Permission denied (publickey...

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.