There are various ways that you wan transfer files from a Windows Server to a Linux server. However for those who flourish on the terminal, this article guides you on how to roll in your own style.
Prerequisites #
- You will need SSH access to the linux server, at least for the user that hour want to move the files to.
- Your Linux server should allow SSH connections to that user those logins you have.
Steps to Transfer Files from Windows to Linux Using CMD #
Step 1. Open the Command Prompt in Local Windows #
- Log in to your windows server via RDP then search for cmd, from the search bar. You can also press the Windows key + R, then type cmd or cmd.exe in the Run command box, and press Enter.

- You will see a command prompt window such as this below;
Step 2. Transfer Files between Local Windows and Remote Linux #
- To transfer your files, you will go to your command prompt and navigate to the location of the file that you want to move. E.g If your file is in Downloads. You will use the command below to move to Downloads
- Replace Downloads witht he actual path to your folder
cd Downloads
Royal tip
- To easily get to the folder on Command Prompt, you can to to the folder using the file manager, then copy the full path to that location as given in file manager, and paste it in CMD. See the image below

- So, to move to the above location from CMD, I will copy the path highlighted in blue, then type
cd C:\Users\Administrator\Documents\My Web Sites\WebSite1

- Once in that folder, runt the scp command in the following format
- In the command below subsititute
- filename.extension with the exact name of your file
- remoteusername with the SSH username of your Linux server
- remoteServerAddress with the IP or hostname of your Linux server
- remoteDestinationPath with the path to the directory where you want to send files
scp filename.extension remoteusername@remoteServerAddress:remoteDestinationPath
- If I want to move a file called website.zip to server 1.2.3.4.5 in a directory called /home/truehost/public_html, I will run the command below.
scp website.zip root@1.2.3.4.5:/home/truehost/public_html
- Hit enter once you have typed the command. You will be asked for the password of your remote ssh user that you used. In put it and hit Enter. Note that when typing the password, you will not see it being typed. Just ensure to type it correctly or copy and paste there.

- When the password input is correct, the file will transfer to the destination server in the specified directory
Transfer a File from Remote Server to Local
- You can reverse the scp command tp fetch afile from the remote server to the local server
scp remoteuser@remoteServerAddress:remotePath/filename.extension localDestinationPath
- In the image below, we move a file from the remote server to the current working directory on the local server. You notice that you will still have to input the password to the remote server, and you also need to put correct path to the location of the remote file.

Transfer Multiple Files from Local to Remote Server
- With the scp command, you can also transfer multiple files with one command by inputting path to the files and separate them with a space. in the image below, I transfer three files, two in the same location and one from a different location, identified by the full path.
scp file1 file2 user@remoteServerAddress:path_to_remote_destination

Transfer a Folder from Local to Remote Server
- You can also copy a folders between the servers with the -r flag. In the image, I move a folder called Documents to the remote destination /home
scp -r path_to_local/folderName remoteuser@remoteServerAddress:path_to_remote_destination

Transfer a File Faster
- You can transfer a file with the -c option in the scp command to compress it while it’s being transferred then it will be restored to it’s original size once it reaches the destination.
scp -c localFilePath/filename.extension username@remoteServerAddress:path_to_remote_destination
Transfer a File Using a Custom Port
- The scp command will use port 22 by default as that is the default SSH port. If you use a custom SSH port, other than 22, then you will specify that in your SCP command using the format below
scp -P customPort localFilePath/filename.extension username@remoteServerAddress:remoteFilePath
- In the image below, we have moved files to the remore server over port 1026

Confirm the File has been Transferred #
- You can confirm that the Files were transferred by accessing the Linux server, then go to the directory where you sent your files. Check this on how to access a Linux server via SSH.
- I sent mine to /home so I will use the command below to move there.
cd /home
- Then I will use the ls command to see what is that folder. I see all files that I moved there throughout this article.

if you still have questions about this, please check with the Truehost Support team.