Created
October 10, 2018 21:03
-
-
Save jjhidalgar/e2b4d4cd4e73e9526e0e61ef5787fc76 to your computer and use it in GitHub Desktop.
Make SSH work in WSL [Windows subsystem for Linux] (Tested in Ubuntu Oct 2018)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Reinstall open ssh server | |
sudo apt-get purge openssh-server | |
sudo apt-get install openssh-server | |
# 2. Install public key | |
# vim .ssh/authorized_keys blabla | |
chmod 400 .ssh/authorized_keys | |
# 3. Edit open ssh server config files | |
# Some settings are not needed, but these will help for sure to make it work | |
vim /etc/ssh/sshd_config | |
--------------------------- | |
AllowUsers yourusername | |
UsePrivilegeSeparation no | |
Port 2222 | |
PubkeyAuthentication yes | |
ListenAddress 0.0.0.0 | |
PubkeyAuthentication yes | |
PasswordAuthentication no | |
PermitEmptyPasswords no | |
--------------------------- | |
# 4. Restart service fully | |
sudo service ssh --full-restart | |
# 5. Connect from remote machine | |
ssh yourusername@ip -p 2222 -i .ssh/id_rsa |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it's work for me, thanks soo much