Created at 2018-02-05 Updated at 2019-04-04
It was another day on the office desk. I got a task in which a file needed to upload to server. I was not in the mood to use filezilla or any other gui ftp client. Those who have no idea about ftp you can read about here.
I started searching about the different ways to upload file to a server. Then i came across scp (security copy). It uses ssh for authentication and to copy the file from source to destination.
man describes it as :
scp copies files between hosts on a network. It uses ssh for data transfer, and uses the same authentication and provides the same security as ssh. scp will ask for passwords or passphrases if they are needed for authentication.
Copy files in local dir to remote service : also you must be in local bash terminal
scp /Users/username/Desktop/11.jpeg [email protected]:/home/xxx/xxx
Copy files on service to local dir: You must be in local bash terminal to conduct this command, not when you are in ssh!
scp [email protected]:/home/xxx/xxx/11.jpeg /Users/username/Desktop/
Hope this information would be useful for someone.