0

I am sure this has been asked many times, for some reason I have still problem with getting it to work.

I have a generated public and private key on my windows machine and copied the public key:

ssh-copy-id -i ~/.ssh/id_rsa.pub ekamolid@host

then on the server I did:

chmod 700 .ssh
chmod 644 authorized_keys

on local machine I run:

chmod 600 id_rsa

sshd_config file has:

  • RSAAuthentication yes
  • PubkeyAuthentication yes

I restarted ssh server on remote server.

when try:

ssh ekamolid@host

I get following error in /var/log/secure:

Feb 17 06:36:56 bur00cpw sudo: pam_unix(sudo:auth): authentication failure; logname=ekamolid uid=0 euid=0 tty=pts/3 ruser= rhost= user=ekamolid

What am I missing here?

  • authorized_keys contains line from id_rsa.pub ? file is not in dos mod ? chmod 600 id_rsa (not 700) ? – Archemar Feb 17 '17 at 14:46
  • @Archemar I just changed chmod to 600. it is very possible is might be in dos mode, I wonder if changin it to linux on linux server would be fine. What do you think – Elbek Feb 17 '17 at 14:53
  • @Archemar I just tried dos2unix without any luck. – Elbek Feb 17 '17 at 15:03
  • no more idea sorry, yet either use ssh-copy-id or change ownership yourself. – Archemar Feb 17 '17 at 15:09
  • It turned out to be ssh on windows issue, I installed cygwin and issue is gone now. – Elbek Feb 22 '17 at 14:39
0

chmod go-w $HOME is another requirement.

And why not use 600 instead of 644 for the authorized_keys?

Regards, Philipp.

0

It turned out to be ssh on windows issue, I installed cygwin and issue is gone now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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