In a network where you have Windows and Linux Ubuntu operating system, it is a bit difficult to share file between Ubuntu and Windows. The best way to share file between Ubuntu and Windows, you need to install and configure Samba as a file server in Ubuntu Linux. The Samba server will simply let you share files with Windows and Linux Ubuntu.
1. Installing Samba in Ubuntu
Samba is a free software re-implementation of the SMB/CIFS networking protocol. Samba provides file and print services for various Windows clients and can integrate with a Windows Server domain, either as a Domain Controller (DC) or as a domain member. So in this article, we are using in Per-to-Per network between Windows clients and Linux Ubuntu clients. If you don’t like reading then watch the video tutorials at the end of this post.
- To install Samba file server in Ubuntu Linux, run the terminal by pressing Ctrl+Alt+T keys to open Linux terminal command line interface.
- Now type the “sudo apt-get install Samba” to install Samba file server. Type the password to start the installation.
Remember; your Ubuntu machine must be connected to the internet. Because this apt-get install command will install software from Ubuntu online software repository.
2. Share File Between Ubuntu and Windows
Let’s do how to share a file in Ubuntu through file explorer? Open the File and create a folder in Home directory. I have created Netdata folder and required to share it.
- Right click the Netdata folder and click Local Network Share. Select Share this folder.
To allow modification to files and folder for users, select Allow others to create and delete files in this folder. Also, select Guest access (for people without a user account) to access files from Windows without requiring user and password.
2. Click Add the Permissions automatically to apply the permission to the shared folder.
If you want to set a password for a shared folder, you shout set a user for Samba file server with “sudo smbpasswd -a Shais” command then type the password twice.
Now it asks you user and password when someone want to access the shared folders. The file sharing from Ubuntu Linux has completed successfully. Let’s test it from Windows 10 client.
3. Access Shared Folders from Windows 10
You can access the Linux shared folders from Windows 10 using Network section. To simply access the shared folders type the \\IP address\Shared folders.
- In Windows 10 type \\192.168.0.104\NetData and press enter to open the shared files of Linux Ubuntu.
2. When prompt for network credential, type the user name and password. If you did not set a password for Samba files server, it would not ask the network credentials.
3. It’s all the contents of a shared folder. You can create and delete files or edit the files.
To access the shared files quickly, create a shortcut link to a shared folder in Windows 10.
Right-click on the desktop and click New then click Shortcut.
Type the network address of shared folder in Type the location of the item: and click Next.
Type a name for shortcut related to the shared folders contents and click Finish to create the shortcut.
Here is the shortcut link to the NetData shared folder of Ubuntu Linux. Double click to open it from your desktop. You can create a network Map drive also. To create network map drive, read this article How to Create Map Network Drive In Windows 10 and Server?
Share File between Ubuntu and Windows 10 – Video Tutorials
We hope this Share File between Ubuntu and Windows article helped you to share file between Ubuntu and Windows 10 easily like a pro Linux user.
Troubleshoot File Sharing Between Ubuntu and Windows
The above article and video are a simple file sharing between Windows 10 and Linux Ubuntu. I didn’t assign a user to Samba file server on Linux. Because of this, a user on Technig Youtube channel asked a good question about sharing files and user permissions.
Asked by Ramsin Eivaz: question if I want a user and password, I assume I have to check only “allow others to create…” and not the guest access. But when I enter the Ubuntu user and password, it is not able to login!! would you have any suggestions thanks.
Answer: You need to create a user account and add the user to Sambashare group. Then when you access the folder from Windows clients, you should use that username and password for viewing the shared files and folders.
1. First, try to create a user in Ubuntu with “useradd” command or another command that help you create a user.
“sudo useradd -M -N -g sambashare Ali”
The -M parameter will not create a home directory for this user and the -N will not create a group with the same username. The -g parameter just specify the group name.
I have created username “Ali” and added to “sambashare” group.
2. Let’s set a password for the Samba user with “smbpasswd” command.
“sudo smbpasswd -a Ali”
[sudo] password for shais:
New SMB password:
Retype new SMB password:
3. Now from Windows 10, type this username and password to access the contents of a shared folder.
Finally, thanks for sharing the feedback, issues, and problems. Your comments help us to make articles better.