I will shortly describe here how to setup and use PSFTP – SFTP client PuTTY for Windows. То же по-русски.
PSFTP is SFTP client PuTTY for Windows. One can use this program to transfer files in secure mode between the host computer with OS Windows and a server on the Linux/Unix with working service OpenSSH (or similar). It works only in command line mode.
PSFTP reminds ftp program for Windows. With it You can view the contents of folders on both computers, surf the file system, transfer multiple files using a single command.
Before start using PSFTP, one have to make all the steps I wrote in post “SSH client PuTTY for Windows” (Of course, if they were not done):
- generate private and public keys;
- setup SSH client PuTTY for windows;
- save session;
- and create a connection to the server via ssh protocol.
Once we have successfully connected to the server using SSH client for Windows PuTTY (Fig. 1), we can run PSFTP.
To do this, You have to run the Windows command line terminal (Start -> All programs -> Accessories -> Command Prompt) and move to the folder where You unzipped downloaded file PuTTY.
To connect to a server, type in the command line
where session_name is the name of a stored PuTTY session to connect to this server (On the example in Fig. 1 marked by the red line).
Then you have to enter your password for your secret key without errors and sftp connection to the server will be established (Fig. 2).
Then you can safely transfer files to the server and download them from there using the commands:
File transfer commands
- put file_name transfers file file_name to the server;
- put file_name new_file_name transfers file file_name to the server and renames it to new_file_name;
- put -r folder_name transfers recursively the contents of the folder folder_name to the server;
- get downloads file (folder contents) from the server to the local computer. The syntax is similar to the syntax of the command put.
The names of files or folders can contain an asterisk as a symbol that replaces several other characters to simplify transferring multiple files with a single command, for example:
put a* sends to the server all files from current folder that start with the letter “a”.
- help – lists all the program commands with brief descriptions;
- quit, close, bye, exit – terminate the session and close the secure connection to the server;
- !command – executes Windows command command on the local computer.
Remote computer commands
- cd folder_name moves to the folder folder_name;
- dir prints the contents of the folder;
- mkdir folder_name creates folder folder_name on the server;
- pwd shows the current folder path on the server;
- del file_name removes file file_name on the server;
- rmdir folder_name removes folder folder_name on the server. USE with CAUTON!
Local computer commands
- lcd folder_name moves to the folder folder_name;
- lpwd shows the current folder path on the the local computer;
Good advice. To use the sftp client to do anything, other than file transfer, in my opinion, is not the best idea. Usually, in parallel with the sftp session I open one or more ssh sessions and perform all necessary operations with files and folders in the ssh terminal, which is much more convenient.
This article describes how to configure and use PSFTP – SFTP client PuTTY for Windows.