It is really freaking cool that they've made an ubuntu subsystem for Windows. It makes the machine worth more than just gaming and watching videos.
Unfortunately the terminal used for the bash shell leaves something to be desired.
There is, however, a really nice terminal program for Windows you can download called PuTTY. If you are reading this I will assume you know what that is.
I am going to expect that you know a handful of things and will not be covering them. Perhaps later I'll make a page about them but in the mean time if you don't know any of these things you might want to google them to learn about them.
Open your Ubuntu bash shell. The following commands should install everything you need.
sudo apt-get update
sudo apt-get install openssh-server
By default, the sshd config is likely perfect for what you need. The following is a very trimmed down example of what you will want it to look like:
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
The important bit in this example is PasswordAuthentication no
.
This requires anyone connecting to have a valid ssh key.
Here are some optional config lines you may want.
Port 22 # You can set this to a non-standard port. (Advanced)
AddressFamily inet # This forces it to ignore IPV6 connections.
ListenAddress 127.0.0.1 # This tells it to only listen on localhost.
I know some people will only want to allow access on localhost which is why I added that last bit.
There is likely a way to do this so that it gets run at start-up. It hasn't pained me enough to figure it all out so I just restart sshd once per reboot by hand.
Open your Ubuntu bash prompt and run the following.
sudo service ssh restart
If you see no error messages, all is probably good. If you do see error messages you probably messed up your sshd_config so give it a look-over.
Your Windows machine may have a heart attack and throw up all sorts of warnings that some nefarious process started listening on port 22.
Just approve it and allow access through the firewall.
Open your favorite terminal program such as PuTTY. Set up a session to connect to server 'localhost' with your windows login. If you've set everything up correctly it will plop you into your Ubuntu setup and your life will be totally enriched.
Yeah, I'm not here to really hold your hand but here's where to start looking when...
Hopefully this makes your life so much better. If you have recommendations on changes I should make to this document or if you are less lazy than I and have automated the starting of sshd on boot, then, by all means, let me know and I'll update my documentation.