Sometimes I need to pull files from one server to another so I need to use secure copy. This is really simple to do with SSH, but I always seem to forget the command when I need it. SSH allows Unix users to secure their terminal and file transfer connections. Now let’s look at the code:
Once you are where you want to be, the command is:
scp filename.ext ses5909@123.123.123.123:
First type in scp (the secure copy command), then the filename, followed by your username on the other server, the @ sign, and the IP or host name of the other server. The part I always forget is the colon (:) and you need this or it will not work. Once you’ve executed this, you will be prompted for your password on the other server. Once verified things should transfer to your user directory on the other server.
If you need to copy an entire directory be sure to include the -r and you’re set 🙂
scp -r directory ses5909@123.123.123.123:
Hopefully this helps someone else out! Do you have any basic commands that you always forget?
March 15th, 2012 at 5:04 pm
Thanks, I tried but it did not work. Direction is missing how to pick a file from particular directory. I want to move .env file
Below is the output message
“/export/home/tjxy/.env: No such file or directory”.
I tried without directory path and with directory path but did not work. May be I am doing something wrong