Friday, October 19, 2018

Using Windows 10 built in bash to ssh to ec2 instance

Using Windows 10 built in bash to ssh to ec2 instance


detailed steps to install bash on windows here: https://www.thewindowsclub.com/run-bash-on-windows-10

Summary:

0- enable windows subsytem for linux
1- open cmd
2- type bash
3- accept and create a unix user account
4- wait to finish
6- you may need to reboot

reopen cmd and type bash, you should see your cmd prompt changed.

5- to ssh to ec2 you need .pem key file that you download when you create the instance
6- copy that file under /home or something else but not under /mnt/* (windows files) because the next step will not work, the file has to be in a linux directory (bash in windows can't change windows files permissions)
7- we have to run this command :
$ chmod 400 pem_file.pem
because otherwise you will get an error that this key permissions are too open (not secure enough).
8- the command is ssh -i "pem_file.pem" ec2-user@123.456.897  (replace the pem file name and ip with your values).

now you can connect from windows terminal without ssh client/PuTTy  and this bash can be used for other bash command and tools like telnet etc.. fun :)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Istio —simple fast way to start

istio archeticture (source istio.io) I would like to share with you a sample repo to start and help you continue your jou...