How to Transfer Files to or from Linux Servers with WinSCP
Follow the below steps to execute
- Step 1 : Connecting to linux instance
- Step 2 : Install net-tools, ssh/openssh(if it is not installed) on linux machine
- Step 3 : Install winscp/ run winscp portable on windows machine
- Step 4 : Connect to linux machine
- Step 5 : Start using
Step 1 – Connecting to linux instance :
You can connect to a linux machine by using ssh with pem key pair or putty with ppk .Now I am connecting with a pem key using ssh terminal.
ssh -i <keyfilepath> <username>@<IP/endpoint> |
ssh -i “amzlinux-keypair.pem” ec2-user@ec2-54-227-206-152.compute-1.amazonaws.com |
Step 2 – Install net-tools, ssh/openssh :
Install both net-tools and ssh packages in your machine
If your linux machine is redhat , amazon linux, centos them use yum as repository
If your linux machine is ubuntu use apt-get or apt
sudo <repo> install <package-name> -y |
sudo yum install net-tools -y |
sudo yum install openssh -y |
In my case i am using amazon linux so yum is my repository
Both the packages are already installed on my machine.
Step 3 – Install winscp/ run winscp portable on windows machine :
1. Download the winscp portable using the below link
|
https://winscp.net/download/WinSCP-5.21.7-Portable.zip |
2. UNZIP/Extract All the WinSCP-5.21.7-Portable.zip file to a new folder
3. Open the folder where you extracted it ! and click WinSCP Application shows in that folder
4. After click on it WinSCP Application opens, next we need to connect with linux instance
Step 4 – Connect to linux machine :
1. Enter the below details
- Enter Hostname : with endpoint
- Port number : 22
- Username : your linux username
- Password : if you have enter
2. Click on Advanced > SSH > Authentication , Select the ppk key or if you do not have ppk select pem key it auto converts to ppk, select it . then next click on ok and click on login
3. On the next step It Asks for permission, click on Yes to continue.
4. It’s connected !
Step 5 – Start using :
1. Left side is windows files and right side is linux files are showing,
We can drag and drop any file/files from one side to another means linux to windows or windows to linux
Now i am copying files from linux to windows by creating a folder linux files , i simply selected files and drag on dropped to windows folder.
2. Files are copied !