How to transfer files between a server and a computer
Many times you need to transfer files to/from server. For example, you want to remove the backup file or import a file from your system to the server. There are several methods for this.
prerequisites
To do this, open one of the following programs according to your operating system.
- Windows:
PowerShell
- Mac:
Terminal
- Linux:
Terminal
Note: In Windows, if SSH is not installed, run the following command in PowerShell to install it.
Viewing the list of backup files on the server
To be able to see the list of backup files on the server, first SSH to the server and run the following command.
The output of this command is as follows.
Select one of the backup files to transfer.
Transfering the file from the server to the system via scp command
Use this command in the terminal.
scp <user>@<Server's IP>:<path/to/your/file> "Path\in\your\PC"
For example, if the user of your server is root
and its IP is 1.1.1.1
, you want to remove the backup panel file from your server and enter it into the Backup
folder in the C
drive of your system, in this case you must enter the following command.
The work is done. The desired file was copied to the Backup folder.
Transfering the file from the system to the server via scp command
For this, suppose your server user is root
and its IP is 1.1.1.1
. Also suppose that the text.txt
file is located in C:\File
and you want to transfer it to the server. In this case, use the following command.
text.txt
file will be copied on the server in the desired path and you can view it with the following command.
Using the web to transfer files
Another way to transfer files is to use SSH service sites. To do this, first enter the details of your server for SSH, and after connecting, the File Manager of the system will open. You can easily transfer your desired files through the web.