Transferring files between server and local machine.

Shankar Sundaram
1 min readOct 10, 2020

--

While maintaining an application in a server, we required to know how to transfer the files between a server and a local machine, and with help of SCP utility, we can easily do that.

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.

Reference — https://linux.die.net/man/1/scp

scp (opt) (from_file_or_directory_loc) (to_file_or_dest_directory_loc)

Remote Server

The remote server should contain some of the mandatory information, like username, host details, file, and folder location. The password is optional and based on the authentication settings, a password will be asked.

user_name@(host_name or ip):(location_of_the_server)

You can find possible use scenarios below:

File from local to a remote machine

scp /users/xxx/test/file.txt root@172.1.23.171:/etc/test/file.txt

File from remote to local machine

scp root@172.1.23.171:/etc/test/file.txt /users/xxx/test/file.txt

Folder from local to a remote machine

scp -r /users/xxx/test/ root@172.1.23.171:/etc/test/

Folder from remote to local machine

scp -r root@172.1.23.171:/etc/test/ /users/xxx/test/

If you have feedback and suggestion feel free to give your comments.

Reach out to me at Twitter, LinkedIn.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Shankar Sundaram
Shankar Sundaram

Written by Shankar Sundaram

Full- Stack Software Consultant

No responses yet

Write a response