In this article, we will explain how to upload local files from a Windows-based PC to a Linux VPS (e.g. CentOS, Ubuntu, Debian, etc.). In this case, the Windows PC will be referred to as the source and the Linux VPS will be referred to as the destination.
- For the purposes of demonstartion, we have created a file on the desktop named “test.txt”.
- Open “Run” by pressing the windows key on your keyboard+R or by typing run into the search bar
- In the opened window type cmd and press Enter.
- Enter the file's directory by typing cd followed by the file path. (In this case, the file is on the desktop, so we write cd desktop).
- Use “SCP” command in the same format as shown below to upload the file.
“SCP filename.extension username@server_address:file/path”
- If this is your first time connecting to the server, Windows will ask you to accept the security alert. Please do so.
- Next you will have to enter the destination server's password.
- Once the correct password has been entered, your file will be uploaded.
To verify that file is transferred, open putty and connect to destination server. Use “Nano” or “vi” editor to open file.
As seen below, the file has been uploaded and is available on the server.