Transfering files with Putty

This blog introduces how to use `Putty` to transfer files from Windows OS to Linux OS and reverse.

During my daily working, I do the development on Windows OS; besides, we have a Debian server for running different jobs automatically, file storage, etc. Sometimes, we also need to transfer files from Windows OS to Linux OS, or reverse; in this case, we use Putty to realize the transfering. Today, I will talk about how to use Putty for transfer files with the following points:

  • What is Putty ?
  • Requirements
  • Transfering files from Windows to Linux
  • Transfering files from Linux to Windows

What is Putty ?

PuTTY is a free and open-source terminal emulator, serial console and network file transfer application. It supports several network protocols, including SCP, SSH, Telnet, rlogin, and raw socket connection. It can also connect to a serial port. The name “PuTTY” has no official meaning.

Requirements

  • Windows OS
  • Linux OS
  • Putty installed: download Putty here
  • Putty PSCP installed: download Putty PSCP here

Transfering files from Windows to Linux

To transfer files from Windows OS to Linux OS, we will apply PSCP. Before we start, let’s have a general understanding of it. PSCP means “PuTTy Secure Copy Protocol (PSCP)”, is a tool for transferring files securely between computers using an SSH connection. To use this utility, we should be comfortable working in the Windows Command Prompt.

Now, let’s start to transfer files to Linux:

  • Open Windows Command Prompt.
  • Type pscp source_path user_name@host:target_path at the prompt
pscp weekly_report.xlsx xxx@123.456.789.0:reporting

Wins to Linux 1

Here, ./weekly_report.xlsx specifies the path of source file, xxx is user’s account for accessing the Linux server, 123.456.789.0 is the host address, /reporting presents target path.

  • After the bash script above, we also need to type the password for accessing the Linux server.

Wins to Linux 2

Transfering files from Linux to Windows

Transfering files from Linux OS to Windows OS is similar to the steps above:

  • Open Windows Command Prompt.
  • Type pscp user_name@host:source_path target_path at the prompt
pscp xxx@123.456.789.0:reporting/weekly_report.xlsx ./

Linux to Wins 1

  • Same as above, after the bash script above, we also need to type the password for accessing the Linux server.

Linux to Wins 2

Conclusion

In this blog, I introduced how to use Putty to transfer files from Windows OS to Linux OS and reverse. Hope it’s useful for you.

Reference