How I got linux SSH to work on windows 10…

So one of the biggest issues I personally have had with windows is the in-ability to emulate a decent Linux terminal. Sure I could dual boot, run a VM or any Os virtualization. But for me, it all seemed very…detached. Well, herein is a solution I have found to be very congruent to my goal:

Step 1 Follow the directions

Provided by http://www.windowscentral.com/how-install-bash-shell-command-line-windows-10 to get bash on Windows 10 (they have images as well).

However if you like me and just want the TL;DR:

  • Settings -> Update & Security -> Enable Developer Mode, Click Yes
  • Control Panel -> Program Features -> Turn Windows Feature ON -> Enable ‘Windows Subsystem for Linux’
  • Restart

After restart completes:

  • open a CMD prompt
  • run the command bash
  • provide a username for the linux system -> press enter
  • You should now be back on the CMD promtp -> close window
  • Open a new cmd -> type bash

Gaze in amazement as you now have linux terminal running on windows without the use of a VM.

Now that we are 1/2 way to our goal of SSHing into a remote linux machine, lets move onto the magic part!

Step 2: The fancy footwork

These instruction will not cover how to make a SSH keypair (that is covered at length elsewhere). For this example I had to log into an AWS EC2 instance.  Ensure an instance is running, we have access to the public IP, and a copy of the *.pem key saves on the windows machine somewhere.

 

  • Copy the AWS *.pem file from windows into ~/.ssh:  cp /mnt/c/me/Documents/pem/example.pem ~/.ssh/example.pem
  • chmod 0600 ~/.ssh/example.pem
  • ls -la`-r-x------ 1 root root 1692 Feb  8 21:09 example.pem to ensure the permission did infact change
  • ec2-user@12.34.56.78 -i ~/.ssh/example.pem

If all went well you should be greeted with a welcome message from the remote machine.

Conclusion

Overall not that complicated once the steps are sorted out, but ugg, sorting out all the step on two different platforms. Remindes me of the time we go *AMP running on WindowsXP alongside IIS/.NET/SQL back in my college days. #donotwant

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.