Enroll Course

100% Online Study
Web & Video Lectures
Earn Diploma Certificate
Access to Job Openings
Access to CV Builder



Online Certification Courses

How To Transfer And Share Files Across Linux And Windows

How to Transfer and Share Files Across Linux and Windows. 

Ways to Transfer Files from Windows to Linux

Transferring data between Windows and Linux operating systems is easier than you think. We’ve compiled three ways for you to do this:

  1. Share network folders
  2. Transfer files with FTP
  3. Securely copy files via SSH

With each of these methods, you’ll be able to easily (and in some cases, effortlessly) move files between operating systems.

Let’s look at them in turn and find out which one suits you best.

1. Share Network Folders Between Linux and Windows

The most obvious way to share files between Linux and Windows is to take advantage of network shares. This term refers to folders on one PC that are available to users on other machines. On a Windows-only network, this is easy to set up. Adding a Linux device complicates matters slightly, although this can be overcome.

Starting on the Windows machine, right-click the network connection icon in the system tray and select Open Network & Internet Settings. Next, click Sharing options and for the current profile enable

  1. Turn on network discovery
  2. Turn on file and printer sharing

Click Save changes to confirm, then browse to the folder containing the files you wish to share. Right-click the folder, select Properties, and open the Sharing tab. Here, click Advanced Sharing then check the Share this folder box.

You can manage access to the folder via Permissions; this refers to local Windows users, not network devices. 

Click OK to confirm the change, then open the Security tab in Properties. Configure this to mirror the settings in the Permissions box previously. You shouldn’t need to do too much here as Windows 10 should include a group called Authenticated Users. This is used for remote access to your computer.

Again, click OK when you’re done.

To find the Windows share from your Linux PC, simply open the file browser and select Network. From here, navigate to the Windows-hosted folder, and start exchanging data.

Access a Linux Share From Windows

To move data in the other direction, you’ll need to install Samba on your Linux computer. 

  1. sudo apt install samba
  2. Next, set a username for the samba share
  3. smbpasswd -a username
  4. You’ll be prompted for a password for the new account (don’t call it “username”!).
  5. Next, create a directory to share the data from.
  6. mkdir /home/[username]/Share
  7. Next, edit the smb.conf file in your text editor:
  8. sudo nano /etc/samba/smb.conf

Add the following to the end of the configuration file:

  1. path = /home/[username]/[folder_name]
  2. available = yes
  3. valid users = [username]
  4. read-only = no
  5. browsable = yes
  6. public = yes
  7. writable = yes

Make the required changes to suit your own needs, then hit Ctrl + X to exit, tapping Y to save. Next, restart Samba:

sudo service smbd restart

You’ll then be able to access the share from Windows. Open File Explorer or your browser and input the IP or hostname of the remote Linux device, followed by the folder name. In our example, this is

\\192.168.1.233\Share

2. Copy Files via SSH From Windows to Linux

With SSH enabled on your Linux device, you can send data via the command line from one computer to another. For this to work, however, you will need to set up an SSH server on your Linux machine.

Start by opening a terminal and updating and upgrading the OS.

sudo apt update

sudo apt upgrade

Once complete, install the SSH server. The OpenSSH server is a good option.

sudo apt install openssh-server

Wait while it installs. To check at any time if the OpenSSH server is running, use

sudo service ssh status

To transfer data from Windows, use an SSH client like PuTTY. This needs the PSCP tool downloading to your Windows system to run alongside PuTTY. 

Note that while PuTTY will need installing, PSCP won’t. However, it should be saved in the root of the C:\ drive or else set up as an environment variable. You’ll also need to confirm the IP address of the Linux device. Check this on the box with

ifconfig

With a connection established, you can send data like this:

c:\pscp c:\some\path\to\a\file.txt user@remoteIP:\home\user\some\path\newname.txt

You’ll be prompted for your password for the Linux computer before the transfer commences.

Want to copy data from Linux to Windows in the same SSH session? This command will download the specified file to the current directory:

c:\pscp user@remoteIP:\home\user\some\file.txt .

Note the lone period, in the end, including this or the transfer will not work.

3. How to Transfer Files From Linux to Windows Using FTP

A file transfer protocol (FTP) application with SSH support can also be used. Transferring files via SFTP in a mouse-driven user interface is arguably easier than relying on typed commands.

Again, an SSH server must be running on the Linux machine before you start. You should also ensure you have installed an FTP app like FileZilla, which has SFTP support.

To use this method, run FileZilla, then open File > Site Manager.  Create a New Site, taking care to set the Protocol to SFTP. Add the target IP address in Host, then the username and password, setting the Logon Type to Normal.

Click Connect when ready, then use the FTP interface to drag and drop files between the two computers.

Related Courses And Certification

Linux Course and Certification

Windows OS Course And Certification

Basics of Computer Science - Course and Certification

Computer Networking Course and Certification

Basics of Computer Science - Course and Certification

Corporate Training for Business Growth and Schools