How to connect to AWS EC2 instance via SSH/Putty from windows using a key-pair?

Share

In this article, you will see how we can connect AWS EC2 instance via SSH/Putty from windows using a key-pair.

In previous article, we already learn how to launch an instance. Please click the below link.

Let’s start the process of connecting EC2 instance via SSH/Putty.

https://youtu.be/o0W9okBCwSg

Step 1: Sign In to AWS Management Console and open EC2 Service.

* Sign In to AWS Management Console by using your credentials.

* In top search bar, you can write โ€˜EC2โ€™. It will show โ€˜EC2โ€™ service and after you click on it, it will redirect you to the EC2 Dashboard.

Step 2: Select the instance which you want to connect via SSH/Putty.

After entering the EC2 dashboard, you will be given an overview of all EC2 resources for your chosen region.

* Click on the instance which you want to connect via SSH/Putty.

EC2 Dashboard

Step 3 : Download WinSCP and Putty.

If you have Windows operating system installed in your computer. Then you will need two basic software which will help you to connect the instance easily.

1. WinSCP : This will help you to upload and download files easily on the instance. You can use FileZilla as well in place of WinSCP.


2. PuTTY : This will help you to install required packages in your instance like LAMP, node.js etc.

If you have Linux operating system installed in your computer, then you can use terminal to connect instance.

1. Open your terminal, go to the directory where you placed your pem file(key-pair).
cd folder-name
2. Type SSH command with this syntax:
ssh -i key-pair.pem username@ip-address

So, terminal(Linux/Ubuntu) will work like PuTTY(in Windows) to install required packages in your instance like LAMP, node.js etc.

3. You can use FileZilla to upload and download files and folders. Here you need to configure ssh key-pair in FileZilla settings.


Step 4 : After Installing WinSCP and PuTTY, create new session in WinSCP.

* Open WinSCP and click on ‘New Session’.

WinSCP Software

* Use AWS EC2 Instance public IP as a host and enter rest of the details as below screenshot. ‘ec2-user’ will be the username because it is default for the Linux instance.

* Keep the password fields blank, because we are going to use key-pair in place of password.
Click on ‘Advanced’ button, then select Authentication. Under Authentication tab, you will need to select private key file as shown in below image.
If you have pem file but don’t have ppk file, then puTTy will automatically generate the ppk from the pem file. For this you need to select pem file by enabling the option to ‘All files’.

* After that please click in ‘Login’ and you will get Logged-In in 2-3 seconds.

Step 5 : Connect Instance in PuTTY.

In below image of WinSCP, you can see an icon in the middle marked in red. It is PuTTY icon, which is already enabled by WinSCP.

When you click on that it will automatically logged you in, because key is already configured.

2 thoughts on “How to connect to AWS EC2 instance via SSH/Putty from windows using a key-pair?”

  1. Pingback: How to install a LAMP web server on Amazon Linux 2? - The Technical Diaries

  2. Pingback: How to create AWS EC2 instance step by step Linux 2022. - The Technical Diaries

Leave a Comment

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

 - 
Afrikaans
 - 
af
Albanian
 - 
sq
Amharic
 - 
am
Arabic
 - 
ar
Armenian
 - 
hy
Azerbaijani
 - 
az
Basque
 - 
eu
Belarusian
 - 
be
Bengali
 - 
bn
Bosnian
 - 
bs
Bulgarian
 - 
bg
Catalan
 - 
ca
Cebuano
 - 
ceb
Chichewa
 - 
ny
Chinese (Simplified)
 - 
zh-CN
Chinese (Traditional)
 - 
zh-TW
Corsican
 - 
co
Croatian
 - 
hr
Czech
 - 
cs
Danish
 - 
da
Dutch
 - 
nl
English
 - 
en
Esperanto
 - 
eo
Estonian
 - 
et
Filipino
 - 
tl
Finnish
 - 
fi
French
 - 
fr
Frisian
 - 
fy
Galician
 - 
gl
Georgian
 - 
ka
German
 - 
de
Greek
 - 
el
Gujarati
 - 
gu
Haitian Creole
 - 
ht
Hausa
 - 
ha
Hawaiian
 - 
haw
Hebrew
 - 
iw
Hindi
 - 
hi
Hmong
 - 
hmn
Hungarian
 - 
hu
Icelandic
 - 
is
Igbo
 - 
ig
Indonesian
 - 
id
Irish
 - 
ga
Italian
 - 
it
Japanese
 - 
ja
Javanese
 - 
jw
Kannada
 - 
kn
Kazakh
 - 
kk
Khmer
 - 
km
Korean
 - 
ko
Kurdish (Kurmanji)
 - 
ku
Kyrgyz
 - 
ky
Lao
 - 
lo
Latin
 - 
la
Latvian
 - 
lv
Lithuanian
 - 
lt
Luxembourgish
 - 
lb
Macedonian
 - 
mk
Malagasy
 - 
mg
Malay
 - 
ms
Malayalam
 - 
ml
Maltese
 - 
mt
Maori
 - 
mi
Marathi
 - 
mr
Mongolian
 - 
mn
Myanmar (Burmese)
 - 
my
Nepali
 - 
ne
Norwegian
 - 
no
Pashto
 - 
ps
Persian
 - 
fa
Polish
 - 
pl
Portuguese
 - 
pt
Punjabi
 - 
pa
Romanian
 - 
ro
Russian
 - 
ru
Samoan
 - 
sm
Scots Gaelic
 - 
gd
Serbian
 - 
sr
Sesotho
 - 
st
Shona
 - 
sn
Sindhi
 - 
sd
Sinhala
 - 
si
Slovak
 - 
sk
Slovenian
 - 
sl
Somali
 - 
so
Spanish
 - 
es
Sundanese
 - 
su
Swahili
 - 
sw
Swedish
 - 
sv
Tajik
 - 
tg
Tamil
 - 
ta
Telugu
 - 
te
Thai
 - 
th
Turkish
 - 
tr
Ukrainian
 - 
uk
Urdu
 - 
ur
Uzbek
 - 
uz
Vietnamese
 - 
vi
Welsh
 - 
cy
Xhosa
 - 
xh
Yiddish
 - 
yi
Yoruba
 - 
yo
Zulu
 - 
zu