If you want to use SFTP server with WinSCP to transfer any files, of course you need to follow some ways. Those ways definitely will guide you to configure WinSCP to SFTP server. Like using FTP, SFTP also needs some configurations to set before you run it to any purposes.
How to Configure WinSCP to SFTP Server
However, to configure WinSCP to SFTP server is actually the same when you configure FTP or SCP server with WinSCP. The difference is just in the way of choosing the protocol option that will show on the WinSCP Login window. Here, you just have to choose “SFTP” on protocol options. Well, the next way that you have to follow is absolutely the same as FTP or SCP does.
Step 1: Download and Install WinSCP
The primary step that you have to do is to download the WinSCP. Without downloading this, don’t hope that you can use WinSCP to connect to SFTP server.
- Well, to get the file of WinSCP, you definitely can visit this site at http://winscp.net/download/winscp418.exe.
- Once you visit this page, the WinSCP will be automatically downloaded and stored on your computer.
- After the downloading process is completed, it is time to install WinSCP on your computer.
- Double-click the downloaded WinSCP file, click Accept or Run.
- In the next screen, there will be Setup Type option, specify the type of set up as desired. It is recommended to choose Typical Installation. Then click the Next button.
- Next, choose the interface style for the user, in this case you can use the Commander style. Then click the Next button.
- Then, the window will show the Ready to Install button. Hit the Install button.
- Wait until the installation process is completed.
- Press the Finish button, the WinSCP will be ready to use.
Those are the ways that you can follow to download and install the WinSCP program on your computer.
Step 2: Configure SFTP server with WinSCP
Once you have downloaded and installed the WinSCP program on your computer, you can continue to configure the SFTP server with WinSCP program.
To configure SFTP server, at least you need to enter some credentials as follow:
- File protocol: SFTP (choose SFTP from the dropdown menu)
- Hostname:(your domain name)
- Port number: 22
- User name: (your cPanel username)
- Password: (your cPanel password)
Once you enter the credentials above, click the Save button.
- Next, the Save session as site form will appear, which is to determine the name of the login session itself or in other words a shortcut if it is on the Windows desktop. For example agoaga.
- Then click the Ok button to finish.
- After that, click the Advanced button.
- Then, a dialog box will appear. You have to choose the “SFTP” option on the left under the Environment category.
- Ensure that you untick the Allow SCP fallback checkbox.
- Hit the OK button and go back to the WinSCP window.
- Click on the Login button to connect SFTP with WinSCP.
Now, you already configure WinSCP to SFTP Server.
How to Use SFTP for File Transfer?
At least, there are two ways that you can do it if you use SFTP to transfer the file. Here are they:
- Transfer Files from Localhost to Remote Server
To copy files from localhost to remote server, use get command below. For this context, the command syntax looks like this:
get file.txt /RemoteDirectory
To move the example.txt file from localhost to a remote server, add this command:
put /home/user-name/example.txt /root
The files will be stored in the remote server’s root directory. You can also transfer multiple files with the mput command. The way it works is almost the same as mget:
mput /home/user-name/*.txt /root
The command above will move all files with .txt extension in / home / user-name from localhost to the remote / root directory.
- Remote File Transfer from Server to Local System
First, check the current local directory and remote directory. Run this command:
sftp> lpwd
Local directory: /LocalDirectory
sftp> pwd
Remote directory: /RemoteDirectory
Use the get command to transfer files from remote server to localhost. Here’s the basic syntax:
get /RemoteDirectory/filename.txt
For example, to copy /etc/xinetd.conf file from remote server to localhost, use this command:
get /etc/xinetd.conf
The xinetd.conf file is now stored in the / user / home directory localhost.
To download multiple files using SFTP, use the mget command. To download all files in the / etc directory with a .conf extension and move them to the current directory, run the following command:
mget /etc/*.conf
All * .conf files that have been downloaded are stored in the / user / home directory on your computer.
File Protocols on WinSCP
The first time WinSCP is opened after installation, the display will appear to log in which contains the File protocol feature, Host name, Port number, User name, Password then the Save and Advanced buttons. In the File Protocol there are 6 types that can be served by WinSCP, namely; SFTP, SCP, FTP, WebDAV, Amazon S3. Here are they:
- SFTP stands for Secure File Transfer Protocol which definitely refers to the SSH File Transfer Protocol. SFTP is a variation of the FTP that is one of the oldest internet apps.
- FTP stands for File Transfer Protocol as an internet protocol which can run on an app for sending computer files between machines. Moreover, the users can send files to the computer (download) or send files to the server (upload). FTP is currently widely used to exchange data, because it is easier than using a wired or physical device.
Both FTP And SFTP are standard definitions, not programs. However, it is up to the others to write an SFTP program, but they have to follow the SFTP standar to make it compatible with other SFTP programs.
- SCP stands for Secure Copy as a network file transfer protocol which can secure the file transfer process between localhost and remote.
- WebDAV stands for Web Distributed Authoring and Versioning as an extension of the Hypertext Transfer Protocol. It allows the clients to run remote Web content writing operations.
- Amazon S3 stands for Simple Storage Service as an object storage built to store and retrieve any amount of data from anywhere on the Internet. It is a storage service which offers a highly availability, durability, and scalable data storage infrastructure infinitely at a very low cost.
AUTHOR BIO
On my daily job, I am a software engineer, programmer & computer technician. My passion is assembling PC hardware, studying Operating System and all things related to computers technology. I also love to make short films for YouTube as a producer. More at about me…