AWS : Connect to your Linux instance

Prerequisites:

1. You should know the Public Hostname and Private Hostname of the Linux Instance.
2. You should have a private key (pem file)

Connecting to the Linux Instance:
-------------------------------------------

Open the Source Terminal Window -- use the ssh command to connect to the instance.


ssh -i pvtkey-pair.pem ec2-user@targethostname


Provide "Public Hostname" if you are trying to connect from the Internet. (EC2 Instance in Public Subnet)
Provide Private Hostname of you is trying to connect within AWS Network.(EC2 Instance in Provate Subnet)


Copying the files:
----------------------

Open the Source Terminal Window -- use the scp command to copy the files.


scp -i pvtkey-pair.pem demo.txt ec2-user@targethostname:.


Provide "Public Hostname" if you are trying to connect from the Internet. (EC2 Instance in Public Subnet)
Provide Private Hostname of you is trying to connect within AWS Network.(EC2 Instance in Provate Subnet)


Reference:

https://cloudbasicessentials.blogspot.com/2020/05/aws-connecting-to-your-linux-instance.html

Comments