Do the following steps to prepare your machines for using OpenSSH.
- Install openssh client and server
sudo apt-get install openssh-client
sudo apt-get install openssh-server
- Edit the sshd_config file at location /etc/ssh
- Make sure password authentication is enabled
- Optionally enable key authentication
...
PubkeyAuthentication yes
...
PasswordAuthentication yes
...
- Restart sshd service
sudo /etc/init.d/ssh restart
# or
sudo service ssh restart
-
Download and install OpenSSH Release from GitHub, if required
-
Generate a public/private rsa key pair for the windows user that will connect to the remote host.
ssh-keygen -t rsa -b 2048
Generating public/private rsa key pair.
Enter file in which to save the key (C:\Users\my.username/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in C:\Users\my.username/.ssh/id_rsa.
Your public key has been saved in C:\Users\my.username/.ssh/id_rsa.pub.
- Copy the public key to the remote host using SSH
cat ~/.ssh/id_rsa.pub | ssh my.username@remote_host "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"