Transfer files from Windows to Linux VM

Need to copy a file from a windows hope to a linux vm? We got you!

Setup Linux

Ubuntu

First, install Openssh on the vm:

sudo apt-get install openssh-server openssh-client

RHEL

Install the SSH server package openssh by using the dnf commands

# Install Package
sudo dnf install openssh-server

# Start the sshd daemon and set to start after reboot
sudo systemctl start sshd
sudo systemctl enable sshd

# Confirm that the sshd daemon is up and running:
sudo systemctl status sshd

# Open the SSH port 22 to allow incoming traffic:
sudo firewall-cmd --zone=public --permanent --add-service=ssh
sudo firewall-cmd --reload

# Optionally, locate the SSH server man config file /etc/ssh/sshd_config and perform custom configuration.
# Every time you make any change to the /etc/ssh/sshd_config configuration file reload the sshd service to apply changes:
sudo systemctl reload sshd


Setup Windows

Get the IP of Linux VM:

ifconfig

Launch WinSCP, and setup the necessary details of the HostName = IP, username, pass

Accept the ssh key

Navigate, Drag & Drop

Last updated