[Step-by-Step Guide} How to Transfer Files via PuTTy
PuTTy is an open-source program that allows users to transfer files between computers via an SSH connection securely. Its PSCP utility (the PuTTY Secure Copy client) is a command line to copy files and folders from Windows to Linux or reverse.
The process is slightly trickier, especially if you’re using PSCP for the first time. Keeping this in view, this article provides comprehensive details on how to copy files from local Windows to a remote Linux via PuTTy and vice versa. Let’s dive in!
What to Know about PuTTy File Transfer
PuTTy is a powerful open-source program that works seamlessly with many network protocols including SSH and Telnet. PSCP is the name of the PuTTy Secure Copy Client which is the tool for copying files between your devices using an SSH connection.
To use PuTTy file transfer between Windows and Linux, you need:
- Windows OS
- Linux OS
- Putty was installed and added to the system path in Windows PC. download Putty here
If you find transferring files using PuTTy difficult, get assistance from a PuTTy file transfer alternative for a more friendly experience.
How to Copy Files from Local Windows to Remote Linux via PuTTy PSCP
Step-by-step Guide
Here are the detailed steps to transfer file from your Windows PC to a remote Linux.
Step 1: Install PSCP.Exe
First of all, download pscp.exe from its official website. During installation, make sure the PSCP utility is installed.
Step 2: Add to Path
The system might not recognize the PSCP command, so it’s crucial to add it to the System’s PATH. For that:
- Navigate to the location of the pscp.exe which is (C:\Program Files\PuTTY\ or C:\Program Files (x86)\PuTTY\).
- Copy the directory path from the top bar. On Windows 11, right-click the top bar and hit Copy Address.
- Now, go to This PC, right-click anywhere, and select Properties.
- Go to Advanced System Settings > Environment Variable.
- Choose Path under System Variables, and hit Edit.
- Add the copied path here. If there are already entries, use the semi-colon (;) to separate them.
Step 3: Execute PSCP in Command Prompt
Now, you can proceed to transfer files from local to server via PuTTY PSCP. Search “command prompt” in the Start menu and run it as Administrator.
The basic command syntax is:
pscp [options] source_file username@remote_server:/destination/
first use the “cd” parameter to change the directory to the desktop.
Here is the breakdown of the above cmdlet:
pscp: It’s the command to invoke PuTTY Secure Copy.
[options]: To enter the optional parameters such as port number (often 22).
source_file: Enter the path to the files you want to transfer from the local Windows to Linux.
username@remote_server: The username and the IP address (or hostname) of the remote Linux.
/destination/: It’s the destination path where you intend to save the copied file.
(“): Use quotation marks if there’s a space in the file name.
Example
Suppose if you want to transfer a file named “testfile.txt” from your Windows desktop to a remote Linux with IP address 192.168.1.100. Its username name is “user” and the desired destination path is /home/username/ directory.
The command would look like this:
pscp "C:\Users\YourUsername\Desktop\testfile.txt" user@192.168.1.100:/home/user/
Replace the parameters according to your requirements.
Step 4: Entering Password
After executing the command, the system will prompt you to enter the password for the remote Linux. Type it to begin the PuTTy SSH file transfer process.
Transfer the Complete Directory from Local to Remote Via PSCP
Do you wish to transfer the whole folder or directory from Windows to Linux? The basic cmdlet is almost similar, except with the addition of the -r (recursive) parameter.
Example
Suppose you want to copy all the contents of “myfolder” located in My Documents on your desktop. The cmdlet is:
pscp -r "C:\Users\YourUsername\Documents\myfolder" user@192.168.1.100:/home/user/
And that’s how to copy files from local Windows to remote Linux via PuTTy SSH.
How to Copy Files from PuTTy to the Desktop Via PSCP
Below are the detailed steps to transfer files from a Linux server to a remote desktop via PuTTy conveniently:
Step 1: Install PUTTy.exe
First install full PuTTy suite on Linux.
Step 2: Check SSH Server Status on Windows
Now, make sure the SSH server is enabled on the remote Windows. For that:
- Head to Settings > Apps > Optional Features.
- Search “OpenSSH Server” and hit Install.
- Check its status in PowerShell (Run as Administrator) using the cmdlet:
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Server*'
- Once the program is installed, execute the below command to ensure it’s always active on your Windows PC:
Start-Service sshd
pscp /localpath username@windows_IP: remotedestination/'Automatic'
Now, you can start transferring files from a Linux to a remote Windows using the PUTTy SSH connection.
Step 3: Execute PSCP command
The basic cmdlet to copy or transfer files from PuTTy Linux to a remote desktop is:
sudo nano /etc/ssh/sshd_config;
Example
Suppose, you want to copy the file named text.1 located in the home directory of your Linux machine to a remote Windows desktop. The basic cmdlet will be:
pscp /home/linuxuser/text.1 user@192.168.1.50:C:/Users/windowsuser/Desktop
Here is the breakdown of this command:
/home/linuxuser/text.1: It indicates the current path of the file on your Linux.
user@192.168.1.50: The IP address and username of your Windows. Here it’s “user.”
C:/Users/user/Desktop: The intended path on the Windows PC where you want to place the copied file.
Step 4: Enter Password
When it prompts, type in the password of your desktop to begin the process. Go to the destination path and verify the PuTTy file transfer.
Easiest Tool to Transfer Files Between Windows and Linux
Not everybody out there is a tech geek! So, if you’re having problems dealing with file transfer via PuTTy, use a tool like AirDroid Personal. This powerful transfer tool to makes it super-easy to copy files from your Windows to Linux or reverse them within seconds.
What it does is establish a wireless connection between both devices. After that, sharing files is just a click away. Unlike its peers, AirDroid supports file transfer to both Nearby and Remote devices. This feature alone makes it stand out as the best file transfer application.
Here are the key features of this tool:
Features
- Ease of Use: Using AirDroid is very easy, even for a beginner.
- Remote Transfer: With its Friend” feature, you can connect to a remote device via email and start sharing files instantly.
- Advanced File Transfer Capabilities: It allows users to share files to multiple devices in one go.
- Universal Compatibility: Supports cross-platform file transfer between iOS, Android, Windows, Mac, and Linux.
- Wide Range of Features: Besides file transfer, AirDroid allows you to manage your phone’s SMS, notifications, calls, and other tasks remotely from a PC.
FAQs
Q1: What is the best alternative to PuTTy PSCP?
If you prefer a graphical interface to command-line tools, try WinSCP. It offers a simple drag-and-drop GUI to copy files between Windows and Linux – with an SSH connection.
Q2: Why PuTTy is not copying files from Linux to a remote Windows?
If you encounter connectivity issues:
- Confirm the default SSH port (22) is open on the server. Your firewall settings on Windows are not blocking it.
- In case you’re using the private key authentication instead of a password, use the “i” parameter to specify the key. The basic cmdlet is:
pscp -i C:\private_key.ppk "C:\Desktop\testfile.txt" user@192.168.1.100:/home/
Final Remarks
This article has provided the basic cmdlet syntax with practical examples to help you transfer files from PuTTy to a desktop or vice versa. Now, just change the variables to proceed with the PuTTy file transfer.
To get more control over the transfer process, use AirDroid Personal. This feature-rich software supports nearby and remote file transfer without any hassle. It also supports remote file and SMS management to assist users in multitasking.
And that’s all for today.