Reputation: 43
Would anyone please be able to assist me with a detailed guide in how to set up a SSHD server on a Windows 7 host along with Keybased authentication.
I am attempting to have the communication setup between an Linux Mint and the Windows 7 host.
Using the OpenSSH 7.2p2-1-v1 : setupssh-7.2p2-1-v1.exe provided by Link: http://www.mls-software.com/opensshd.html
I have already generated my Public and private keys for the Linux host. I followed some other guides and generated the keys for the OpenSSH server as well using the >ssh-keygen -t rsa, to the .ssh folder and copied my Linux public key to the authorized-hosts file as well.
The interactive key (Password) based authentication works fine. But when I disable the password authentication on the sshd_config file, and try to ssh form the Linux host using key based authentication is gives the error #Connection Refused (Publickey Authentication) - Something similar to this.
I have been struggling with this for days. My simple requirement is that I be able to SSH from my Linux machine using keybased authentication and similarly from my Windows host to the Linux host.
Please be kind enough to assist me in anyway possible.
Upvotes: 0
Views: 3182
Reputation: 43
I was able to solve the issue, as well as test it on both Windows 7 and Windows Server 2003 Standard, therefor I think the same can be achieved in any of the MS distributions 2003 and above.
Below are the steps to set up an SSH server on your windows host machine and configuring it to your Windows login user account, using OpenSSH. (Keybased Authentication)
Edit / uncomment the following lines in the sshd_config file.
C:\Program Files\OpenSSH\etc\sshd_config
Add the public key of the host which you wish to access the SSH server from to the authorized_keys file.
C:\Users\[USER]\.ssh\authorized_keys
Change ownership of the folder \empty to your logon [USER]
C:\Program Files\OpenSSH\var\empty
These steps will lead to the following possibilities. The hosts public key which was put in the authorized_keys file will be able to SSH without any password authentication. Any other host will be able to SSH using the [USER]'s local login password.
Upvotes: 0