7

This question already has an answer here:

Now that Windows 10 has the Windows Subsystem for Linux is it possible to connect to it remotely via SSH? With the Bash shell up and running I tried connecting Putty (running on the same Machine) to localhost but the connection was refused. Has anyone gotten this to work?

marked as duplicate by random Nov 29 '16 at 5:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • You would have to be running a SSH server within the environment. Is that the case? – Ramhound May 21 '16 at 2:26
  • Yes OpenSSH server is running – Chris May 24 '16 at 20:00
  • Are you sure that you are running bash on Windows as administrator? This is often required. I can't be sure about SSH, but it should work as I've used VNC localhost connect and also posted a video about it here: m.youtube.com/watch?v=pWhacnDrrV0 I will try to get it working when I go home and post an answer. – PulseJet Aug 16 '16 at 9:46
  • 2
    Yes: superuser.com/questions/1111591/… – Mick Oct 7 '16 at 17:35
  • 1
    I have sloved this problem today. Please see the question here: superuser.com/questions/1111591/…, and follow @Master Azazel answer, it works on me, otherwise, you need to add a rule on windows firewall to allow access ssh port 22. – RayJoy Nov 23 '16 at 8:53
-1

From what I have read, the Linux subsystem is localized (outside of directory/file searching) and doesn't really understand that it exists within a Windows environment. It doesn't "speak" to Windows binaries and API's. So, you can't connect externally to the SSH server running inside of Ubuntu on Windows. Which is a fail in my opinion...but anyway.

However, there is a way to get SSH running on Windows and I have it functioning perfectly. I can do WinSCP and SSH from Putty (including reverse tunneling socks proxy) from the internet through my public and port forwarded to my local machine. Or of course on my LAN as well. Make sure you permit port 22 on Windows FW.

Here are the instructions I followed. If you have any trouble I will try to detail out any steps I took.

https://winscp.net/eng/docs/guide_windows_openssh_server

-2

ssh to a Windows computer with WSL will log you into your Windows home directory (e.g. C:/Users/rhm aka /mnt/c/Users/rhm) running cmd.exe. Executing '/windows/system32/bash.exe ~ --login' will log you into your Linux home directory (e.g. /home/rhm) runing Bash on Ubuntu on Windows and execute your .profile.

Not the answer you're looking for? Browse other questions tagged or ask your own question.