Step‑by‑Step Guide to Using WinSCP for Secure File Transfers to a Virtual Machine
Introduction
WinSCP is a free, graphical SFTP/FTP/SCP client that makes transferring files between your local computer and a remote server (such as a virtual machine) simple and secure. This article walks you through launching WinSCP, configuring a connection, saving the session, and performing basic file operations.
Installing and Launching WinSCP
- Download WinSCP from the official website and run the installer.
- After installation, open WinSCP; the first window you see is the Login screen.
Configuring a New Connection
- Select Protocol – Choose one of the supported protocols (SFTP, FTP, SCP). For Linux VMs the common choice is SFTP.
- Enter Host Details
- Host name: Use the IP address of your virtual machine (e.g.,
192.168.56.101). If you prefer a hostname, ensure it resolves correctly. - Port number: Default for SFTP is 22; keep this unless your VM uses a custom port.
- User name: The login name on the VM (e.g.,
rootorubuntu). - Password: The corresponding password, or leave blank if you will use an SSH key.
- Save the Session – Click Save to store these details. Give the session a recognizable name (e.g., "My‑VM"). This avoids re‑entering the IP each time.
- Key Authentication (optional) – If you use an SSH key, WinSCP will prompt you to select the private key file. The key will be stored in the session profile.
Connecting for the First Time
- After saving, select the session and click Login.
- WinSCP may ask to store the server’s host key; accept it to trust the connection.
- Once connected, the interface splits into two panels: the left side shows your local files, the right side shows the remote VM’s filesystem.
Navigating Remote Files
- Use the remote panel to browse directories, just like a file explorer.
- If the remote directory is empty (as shown in the transcript), you can create new files or upload existing ones.
Creating a File on the Remote VM
- Open the Commands menu and choose Open Terminal (or press
Ctrl+T). - In the terminal, run a Linux command such as
touch newfile.txtto create an empty file. - Refresh the remote panel (press
F5) to see the newly created file.
Common Tasks
- Upload a file: Drag and drop from the left panel to the right panel.
- Download a file: Drag from right to left.
- Edit a file: Right‑click a remote file and select Edit; WinSCP will download, open in your default editor, and upload the changes automatically.
- Synchronize directories: Use Commands → Synchronize to keep local and remote folders in sync.
Tips and Best Practices
- Save sessions for each VM to speed up future connections.
- Use SSH keys instead of passwords for stronger security.
- Set default remote directory in the session settings if you always work in a specific folder.
- Enable keep‑alive to prevent idle connections from timing out.
Troubleshooting
- Connection refused – Verify the VM’s IP, port, and that the SSH service is running.
- Authentication failed – Double‑check username/password or key permissions (private key should be
600). - Firewall issues – Ensure port 22 is open on both host and VM firewalls.
Summary of Steps
- Install WinSCP.
- Open the Login window and select SFTP.
- Enter host IP, port 22, username, and password (or key).
- Save the session for reuse.
- Connect and navigate remote files.
- Use terminal commands like
touchto create files. - Perform uploads, downloads, edits, or synchronization as needed.
WinSCP provides a quick, secure, and visual way to manage files on a remote virtual machine; by saving connection profiles and using SSH keys, you can streamline repeated transfers without repeatedly entering credentials.
Frequently Asked Questions
Who is M Prashant on YouTube?
M Prashant is a YouTube channel that publishes videos on a range of topics. Browse more summaries from this channel below.
Does this page include the full transcript of the video?
Yes, the full transcript for this video is available on this page. Click 'Show transcript' in the sidebar to read it.
Helpful resources related to this video
If you want to practice or explore the concepts discussed in the video, these commonly used tools may help.
Links may be affiliate links. We only include resources that are genuinely relevant to the topic.