Connect to ec2 Linux instance from mac and file transfer

Follow below steps to connect to ec2 instance and make file transfer from mac terminal. the keypair to mac [ in our case awskeypair.pem ]

2.change the permission to 400
chmod 400 /path/awskeypair.pem terminal on mac by searching on spotlight search
Enter the following command into the terminal.

ssh -i awskeypair.pem

After the first login to the EC2, you do not need to repeat the chmod to change permissions for the key. Every time you start an previously-stopped EC2 instance, there will be a new Public DNS. To connect to the EC2 after the first login, copy and paste that new Public DNS on the above command.

4.Copy the files to ec2 instance . Enter the following command into the terminal.

scp -i awskeypair.pem test.txt

5.Verify the file test.txt transferred to the server .

Related Posts

Leave a Reply

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