Instructions on how to share data between Windows and Linux via LAN

You tried using a flash drive or SD card to transfer files from Linux to a Windows computer and found it annoying, especially when there are too many files to move and will take a long time to complete. .

Don't waste your precious time on using storage devices anymore! You can move files quickly and easily via the local area network (LAN).

The main methods used to do this are:

  1. Set up sharing in Linux to access it from Windows with Samba
  2. Set up sharing in Windows to access it from Linux

How to transfer files between Linux and Windows via LAN

  1. Set up sharing in Linux and access it from Windows with Samba
  2. Set up sharing in Windows to access from Linux
    1. Allow sharing on Windows
    2. Share folder
    3. Access from Linux

Set up sharing in Linux and access it from Windows with Samba

The best and fastest way to do this is to install Samba. Samba is an ideal solution for sharing files between different devices such as Windows, Linux or Mac devices. Machines need to be networked with a common router.

Windows computers have a function that allows them to work with Samba, so just install the package for the Linux computer.

1. On a Linux computer, open the location that contains the files you want to share.

2. Right-click the file and select 'Sharing Options'.

Instructions on how to share data between Windows and Linux via LAN Picture 1

3. If you receive a prompt asking to install Samba services, click 'Install service'.

4. Click Restart session after Samba service is installed to allow sharing.

5. Check the 'Share this folder' boxes and 'Allow others to create and delete files in this folder' .

6. Click 'Create Share' to complete the process.

7. Open Terminal and type the following commands:

 sudo smbpasswd –a USERNAME 

Replace USERNAME with the username.

 sudo cp /etc/ samba/ smb.conf /etc/samba/smb.conf.old sudo nano /etc/samba/smb.conf 

8. Find the Global section and add the following lines:

 encrypt passwords = true wins support = yes 

9. Press Ctrl + O and Ctrl + X to save and exit.

10. Restart Samba:

 sudo service smbd restart 

11. Switch to Windows computer and right-click Start, then select Run.

12. In the Run box , enter the command:

 computer_nameshare_name5 

Note: The computer name in this case may be the IP address of the Linux machine. You can find this address by going to your Linux computer and opening the terminal, then entering ipconfig.

13. Enter the Linux computer name and share the resource name.

14. A prompt will be displayed asking for login information.

15. Enter your Linux username and password, then click OK.

16. Try accessing the share from your Windows computer.

The new server will be displayed in 'My Network Places' on Windows.

Or do the following: Right-click on Start and select Run, then enter: // server. Replace 'server' with the name or IP address of the Samba server computer. A window with browsable shares from the server will open.

Note : To access shared items that cannot be browsed, use this code:

 servershare name 

Set up sharing in Windows to access from Linux

This setting will be done in three steps as follows:

  1. Allow sharing on Windows
  2. Share folder
  3. Access directory from Linux

Allow sharing on Windows

Start by making sure the network settings are configured to allow connection from the Linux system. To do this, do the following:

1. Go to Control Panel and click 'Network and Internet'.

Instructions on how to share data between Windows and Linux via LAN Picture 2

2. Select 'Network and Sharing Center' .

Instructions on how to share data between Windows and Linux via LAN Picture 3

3. The Network and Sharing Center window will open. Click 'Change Advanced Settings' .

Instructions on how to share data between Windows and Linux via LAN Picture 4

4. Activate these two settings: 'Network Discovery' and 'Turn on file and printer sharing'.

Instructions on how to share data between Windows and Linux via LAN Picture 5

5. Click Save changes.

6. Sharing feature has been activated.

Share folder

Create a shared folder for the Linux system to view, connect and access. You can share anything, so follow these steps:

1. Find the folder you want to share and right-click on that folder.

2. Select 'Properties'.

Instructions on how to share data between Windows and Linux via LAN Picture 6

3. In the Sharing tab , click 'Advanced Sharing'.

4. In the Advanced Sharing window , activate the 'Share this folder' option .

5. Click 'Permissions'.

Note : In the 'Permissions' window , you can restrict access to folders for specific users or accounts. Select 'Full Control permission to Everyone' to give any user access. This way, anyone can read and write changes to files in the folder you share.

However, if you want to restrict access to specific user accounts, delete 'Everyone' , add desired users and then assign related rights to them. User accounts are accounts on Windows systems (not Linux systems).

6. Click OK to close the Permissions window .

7. Click OK to close the Advanced Sharing window .

8. Go to the Security tab in the main Properties window.

Note : Configure the same permissions as in sharing permissions so that Linux users can access the shared folder.

If the permissions do not match, the most restrictive settings apply.

However, if the user you intend to share has security rights, close the window and go to the third step. If not, click 'Edit' to add users, click 'Add' in the Permissions window and enter user details.

9. Click OK on all windows. The folder will be shared with the network.

Access from Linux

Users can mount the shared folder using the Linux GUI or use a command line. In this example, we will use Terminal because this tool works on many distributions and is faster than using the Linux GUI.

To do this, we need the cifs-utils package to mount the SMB shares. Follow these steps.

1. In the terminal, enter:

 sudo apt-get install cifs-utils 

2. Create a folder.

3. Mount share to the folder.

4. Create a folder on the desktop. (Will be easier to access from the desktop).

5. Create and mount directories with the following commands:

 mkdir ~/Desktop/Windows-Share sudo mount.cifs //WindowsPC/Share/home/username/Desktop/Windows-Share –o user=username 

Note : If prompted to enter the Linux system root password and password for the user account on Windows, enter each password and run the command.

You should now see the content of Windows share and will be able to add data to it.

Do you know how to transfer files from a Linux system to Windows and vice versa? If there is another method, please share with us in the comment section below!

Hope you are succesful.

3.5 ★ | 2 Vote

May be interested

  • How to share data between 2 computers via LAN?How to share data between 2 computers via LAN?
    normally, when you need to share data between two computers, we often choose the option of using an intermediary tool, usb or portable hard drive. in addition, you can use the internet. however, if you do not have a usb connection and the network connection fails, what should you do? do not worry. we will show you how to share data between 2 computers via lan (network system used to connect computers in a small range) in the article content below.
  • How to share data, drives, folders in Windows 10How to share data, drives, folders in Windows 10
    with lan system, computers can easily share data easily with fast speed. the following article of tipsmake.com will guide in detail how to share / share drives and folders in windows 10. this article is very useful.
  • 6 reasons why users turn away from Linux6 reasons why users turn away from Linux
    linux is becoming the real rival of windows. however, when comparing market share, 'penguin' is still far below the super product of microsoft.
  • 5 Linux tools to recover data from damaged drives5 Linux tools to recover data from damaged drives
    when the hard drive fails, it will often be unusable, but don't hurry to throw it away immediately, try the 5 linux tools introduced by tipsmake.com to restore the data. and put your digital life back on track.
  • How to Share Health Data on iPhoneHow to Share Health Data on iPhone
    users can securely share data in the iphone health app with family, friends, or their doctors.
  • 7 ways to run Linux software on Windows7 ways to run Linux software on Windows
    linux users want to run windows software on linux, whereas windows users want to use linux software. even if you are looking for a better development environment, more powerful command-line tools, you can run linux software without removing windows.
  • How to Share Files Between Linux Computers Using NFSHow to Share Files Between Linux Computers Using NFS
    nearly all linux distributions come with the ability to set up a network file system (nfs) that allows the different linux computers on the network to easily share files. nfs is only suitable for networks comprised entirely of linux...
  • Guide to share drives and folders in Windows 7 to share data in LANGuide to share drives and folders in Windows 7 to share data in LAN
    to save time sharing without the need for external devices or computers connected to the internet, you can quickly share folders to many other computers on the same lan.
  • How to share folders, drives in WindowsHow to share folders, drives in Windows
    the following article details how to share / share drives and folders in windows. this article is very useful for those who work in lan using shared data.
  • Instructions for installing Kali Linux on Windows 10 are easier than everInstructions for installing Kali Linux on Windows 10 are easier than ever
    you can download and install kali linux directly from the microsoft app store on windows 10 as easily as installing any other application. this is a guide to installing kali linux on windows 10, without usb boot, virtualization software at all.