scp memo

SCP command required the password of the remote system. In case you need to configure scp command in script and run with scheduler, you need to configure key based ssh login.

  • Use the following command to copy the folder from remote to local recursively
scp -r user@remote.example.net:/path/to/folder /path/to/local 

In case, SSH is running on a different port, use -P to define port number with the SCP command:

scp -P 2222 -r user@remote.example.net:/path/to/folder /path/to/local

If the authentication is configured with a pem file. you can use the pem as below:

scp -i auth.pem -r user@remote.example.net:/path/to/folder /path/to/local