To connect to AWS ensure to have the pem file at your disposal.

Check the pem file
ls *.pem
ls -la emailverifier-DC.pem
chmod -w emailverifier-DC.pem
ls -la emailverifier-DC.pem

Appropriate permissions on pem file
ls -la
ls -la emailverifier-DC.pem-~

chmod go-rw emailverifier-DC.pem
ls -la emailverifier-DC.pem
chmod -w emailverifier-DC.pem

chmod 400 emailverifier-dc.pem

-r——– 1 ubuntu ubuntu 1696 Jul 14 11:15 emailverifier.pem

Transfer a file from local system to remote system
scp /path/to/local/file username@hostname:/path/to/remote/file
scp -i emailverifier-DC.pem /home/user/Desktop/emails20170302.csv ubuntu@

Connect to Remote System ssh
ssh -i. emailverifier-DC.pem ubuntu@


Transfer folder from local machine to AWS or To upload a file from your laptop to Amazon instance:

“scp” means “secure copy”, which can copy files between computers on a network. You can use this tool in a Terminal on a Unix/Linux/Mac system.

scp -i pems/Dataentrytool.pem -r datacaptive-data-entry/Data-entry-tool\ val/app/bin/ ec2-user@

scp -r /home/user/Desktop/

Download a file from the remote server by issuing a cat command
scp username1@hostname1:/path/to/file username2@hostname2:/path/to/other/file
user@Sys208:~/Downloads$ ssh -i emailverifier-DC.pem  ubuntu@ ‘cat ~/EmailVerifier/output_files/interesting_emails.csv’ > interesting_emails.csv



1.Loading AWS session in putty


2.Upload SSH key for authentication(emailverify.ppk )




To download file using pem key from AWS to local machie

scp -i <key> root@<host>:<root/dir/subdir/file.pdf-whatever the path is> .

user@LT-201:~/Downloads$ scp -i “myKey.pem” p


At times you would want to have files transferred locally from one machine to the other machine.

The following example would help you transfer nohup.out file from remote machine to the local machine, where the SSH port is different from 22 like 1337 as shown below

user@LT-201:  scp -P 1337 dcserver@ -p 1337 .


To transfer a file from local machine to remote machine on the LAN with different SSH port apart from 22, like 1337

user@Sys-201:~$ scp -P 1337 /home/user/Dataentrytool.pem dcserver@
dcserver@’s password:
Dataentrytool.pem                             100% 1692     1.7KB/s   00:00


At times when transferring large files from the local system to the server, there can be timeout issues on the ssh terminal.

echo 'ServerAliveInterval 30' | sudo tee -a ~/.ssh/config
echo 'ServerAliveCountMax 1200' | sudo tee -a ~/.ssh/config

ServerAliveCountMax by default this is set to 3. 
Therefore once the ServerAliveInterval has sent 3 small packs of info to 
your server it will then automatically log out. Setting it to 1200 means 
this process will have to occur at least 1200 times. In short you should
be connected at least 30*1200 seconds (10 hours).