Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've setup an OpenSSH server on my windows machine and have been able to successfully SSH from windows box to my Linux machine (and vice-versa) successfully.

Although, I am not able to set up key authentication for the same... here are the steps that I followed

On Windows - OpenSSH

C:\OpenSSH\bin> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/Arpit/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/Arpit/.ssh/id_rsa.
Your public key has been saved in /home/Arpit/.ssh/id_rsa.pub.
The key fingerprint is:
b9:0c:33:15:9f:8a:bf:02:cf:80:43:7c:6e:42:07:52 Arpit@Windows-HOST

C:\OpenSSH\bin> scp "C:\Documents and Settings\Arpit\.ssh\id_rsa.pub" Arpit@Linux-HOST:

Tried ssh after these steps but it was asking password to connect

On Linux

[arpit@Linux-HOST ~]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/arpit/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/arpit/.ssh/id_rsa.
Your public key has been saved in /home/arpit/.ssh/id_rsa.pub.
The key fingerprint is:
e8:ac:43:a5:52:d5:ca:11:ea:2f:ae:b9:b0:cb:ba:8e arpit@Linux-HOST
[arpit@Linux-HOST ~]$ ssh-copy-id -i /home/arpit/.ssh/id_rsa.pub arpit@Windows-HOST
arpit@Windows-HOST's password:
Now try logging into the machine, with "ssh 'arpit@Windows-HOST'", and check in:

  .ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

Still no luck. Can anybody help me with the same?

share|improve this question

migrated from stackoverflow.com Jun 17 '13 at 16:46

This question came from our site for professional and enthusiast programmers.

    
It might just be asking for the passphrase to decrypt the key. –  Oliver Salzburg Jun 17 '13 at 17:00

2 Answers 2

Have you copied the public key into authorized_key file in your linux machine?:

Open the "C:\Documents and Settings\Arpit.ssh\id_rsa.pub" file with notepad, copy the content and append to .ssh/authorized_key in your Linux machine. Then try again

share|improve this answer
    
Yes, did it. Still asking for password :( –  Arpit Jun 17 '13 at 10:02

Well, it looks like apart from the user directory (C:\Documents and Settings\[username]\.ssh) directory, we need to copy the authorized_keys file to the following location:

[OpenSSH Installation Directory]\etc\

Key authentication started working once I copied the remote host's public keys at the above mentioned location.

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.