Files
freeCodeCamp/guide/english/ssh/moving-files-between-servers/index.md
Sindhuri1706 6807d7a8b2 SSH:Move files between servers (#18987)
* added guidelines to move files between servers

* Move and update scp article

This commit moves the file to the correct place and updates the format of the content for correctly displaying content.

The move is in accordance with the new architecture of where the Guide articles are placed within the repository.

* Delete Django change

Appears to be leftover from another commit.
2018-10-17 11:22:56 -07:00

37 lines
1.1 KiB
Markdown

---
title: Moving files between servers
---
## Moving file from local computer to remote server
* First add public key of remote server to known hosts
* The command to copy files from local computer to remote server is
```shell
scp -i <location of servers private key> <file to be transferred> <user>@host:<location where the file has to be transferred>
```
## Moving file from remote server to local computer
* First add public key of remote server to known hosts
* The command to copy files from remote server to local computer is
```shell
scp -i <location of servers private key> <user>@<host>:<location of remote file> <location where the file has to be transferred>
```
## Moving file between remote servers
* First add public key of remote servers to known hosts
* The command to copy files between remote server to local computer is
```shell
scp -i <location of servers private key> <user1>@<host1>:<location of remote file> <user2>@<host2>:<location where the file has to be transferred>
```
## To move entire directory use -r option
```shell
scp -r root@hostname:/source_folder/* /destination_folder/
```