Thursday, October 13, 2016

setup ssh server on windows 7

1- downlad msys2 from the link below and install it
https://msys2.github.io/

2- run the msys2, then install openssh from the msys2 terminal with the following command
$ pacman -S openssh

3- update the configuration file of sshd,  /etc/ssh/sshd_config, with the following content

Port 22223
UsePrivilegeSeparation no
AuthorizedKeysFile      .ssh/authorized_keys
Subsystem       sftp    /usr/lib/ssh/sftp-server


4- generation host keys for sshd
$ ssh-keygen.exe -t dsa -f /etc/ssh/ssh_host_dsa_key
$ ssh-keygen.exe -t rsa -f /etc/ssh/ssh_host_rsa_key
$ ssh-keygen.exe -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key
$ ssh-keygen.exe -t ed25519 -f /etc/ssh/ssh_host_ed25519_key



5- now start the sshd server with the following line
$ /usr/bin/sshd.exe


6- don't use the username/password for authentication, use private key instead follow the lline below to authenticate with private key
http://www.atechnote.com/2016/10/how-to-login-to-ssh-server-using.html

7- after we done the step 6, we can use the following command to login
$  ssh -i tohttpserver.key test1@192.168.56.23 -p 22223

No comments:

Post a Comment