Nautilus file manager can share directories/folders of your Ubuntu 24.04 LTS system that you can access from Windows, MacOS, and other Linux devices.
You may not find the file-sharing option in the context menu of the Nautilus file manager in a new Ubuntu 24.04 LTS installation. That’s because the Nautilus file-sharing option is not enabled by default.
In this article, I will show you how to enable the Nautilus Samba/CIFS file-sharing option in a new Ubuntu 24.04 LTS installation. I will also show you how to use the Nautilus file-sharing feature to share a directory/folder of your Ubuntu 24.04 LTS system and access the shared folder from Windows and Linux operating systems.
Table of Contents
- Installing Nautilus File Sharing Plugin on Ubuntu 24.04 LTS
- Adding the Ubuntu Login User to the sambashare Group
- Setting a Samba Share Password for the Login User of Ubuntu
- Sharing a Directory with Nautilus File Manager on Ubuntu 24.04 LTS
- Finding the IP Address of Ubuntu
- Accessing the Samba/CIFS Share from Other Linux Devices
- Accessing the Samba/CIFS Share from Windows 10/11
- How to Solve Nautilus Share Error: ‘net usershare’ returned error 255
- Conclusion
Installing Nautilus File Sharing Plugin on Ubuntu 24.04 LTS
To enable the Nautilus Samba/CIFS file-sharing feature, you must install the Nautilus file-sharing plugin on Ubuntu 24.04 LTS.
First, update the APT package database cache with the following command:
To install the Nautilus file-sharing plugin on Ubuntu 24.04 LTS, run the following command:
$ sudo apt install nautilus-share
To confirm the installation, press Y and then press .
The Nautilus file-sharing plugin is being installed on Ubuntu 24.04 LTS. It will take a while to complete.
At this point, the Nautilus file-sharing plugin should be installed.
Adding the Ubuntu Login User to the sambashare Group
Once the Nautilus file-sharing plugin is installed, you must add the login user of your Ubuntu system to the sambashare group. Otherwise, you won’t be able to share any directory/folder of your Ubuntu system using the Nautilus file-sharing plugin.
To add the login user of your Ubuntu system to the sambashare group, run the following command:
$ sudo usermod -aG sambashare $(whoami)
For the changes to take effect, reboot your Ubuntu system.
Setting a Samba Share Password for the Login User of Ubuntu
You must also set a samba share password for the login user of your Ubuntu system to access the shared directories/folders from other devices.
To set a samba share password for the Ubuntu login user, run the following command:
$ sudo smbpasswd -a $(whoami)
Type in a samba share password for the Ubuntu login user and press .
Retype the samba share password for the Ubuntu login user and press .
A samba share password should be set for the Ubuntu login user.
Sharing a Directory with Nautilus File Manager on Ubuntu 24.04 LTS
To share a directory/folder with the Nautilus file manager on Ubuntu 24.04 LTS, right-click (RMB) on the directory/folder and click on Sharing Options.
To share the directory/folder, tick Share this folder.
You will find a few sharing options:
Share name[1]: The default share name should be the name of the directory/folder being shared. You can also set a custom name for the share.
Comment[2]: An optional short description of the share.
Allow others to create and delete files in this folder[3] and Guest access[4]: If you want to allow everyone (without needing to enter a correct username/password) full access (read+write) to this share, tick both of these options. If you want to allow everyone read access to this share, only tick Guest access[4].
Once you’re done configuring the share options, click on Create Share[5].
Once the directory/folder is shared, you will see a green indicator in the directory/folder as marked in the screenshot below.
Finding the IP Address of Ubuntu
To access the Samba/CIFS share from other devices, you must know the domain name or IP address of your Ubuntu 24.04 LTS system.
To find the IP address of your Ubuntu system, run the following command:
The IP address of your Ubuntu system should be printed.
In my case, the IP address of my Ubuntu system is 10.10.10.111.
Accessing the Samba/CIFS Share from Other Linux Devices
To access a Samba/CIFS share from other Linux devices, you need to access the share URL from the file manager in the following format:
Here, is the domain name or IP address of the Samba/CIFS server and is the name of the Samba/CIFS share you want to access.
For example, to access the Samba/CIFS share MyShare from the Samba/CIFS server (my Ubuntu system) with the IP address 10.10.10.111, you will need to access the share URL smb://10.10.10.111/MyShare from the file manager of your Linux distribution[1].
Once you attempt to access the Samba/CIFS share, you will be prompted for the username and password. Type in the login username and password[2] and click on OK[4].
If you want the file manager to remember the login username and password of the Samba/CIFS share so that you won’t have to type in the username and password in the future, make sure to tick Remember password[3] before clicking on OK[4].
You should be able to access the Samba/CIFS share and all the shared files.
Accessing the Samba/CIFS Share from Windows 10/11
To access a Samba/CIFS share from Windows 10/11, you need to access the share path from the File Explorer in the following format:
Here, is the domain name or IP address of the Samba/CIFS server and is the name of the Samba/CIFS share you want to access.
For example, to access the Samba/CIFS share MyShare from the Samba/CIFS server (my Ubuntu system) with the IP address 10.10.10.111, you will need to access the path \\10.10.10.111\MyShare from the File Explorer of your Windows 10/11 system[1].
Once you attempt to access the Samba/CIFS share, you will be prompted for the username and password. Type in the login username and password[2] and click on OK[4].
If you want Windows 10/11 to remember the login username and password of the Samba/CIFS share so that you won’t have to type in the username and password in the future, make sure to tick Remember my credentials[3] before clicking on OK[4].
You should be able to access the Samba/CIFS share and all the shared files.
How to Solve Nautilus Share Error: ‘net usershare’ returned error 255
If you see the following error message while sharing a directory/folder from the Nautilus file manager on Ubuntu 24.04 LTS, it means you don’t have the necessary permissions to create Samba user shares. To obtain the necessary permissions to create Samba user shares from the Nautilus file manager on Ubuntu 24.04 LTS, you must add your login user to the sambashare group.
You do not have permission to create a usershare. Ask your administrator to grant you permissions to create a share.
Conclusion
In this article, I have shown you how to enable the Samba/CIFS file-sharing feature in the Nautilus file manager on Ubuntu 24.04 LTS. I have also shown you how to use the Nautilus Samba/CIFS file-sharing feature to share a directory/folder of your Ubuntu 24.04 LTS system and access it from other Linux and Windows devices. I have shown you how to solve the Nautilus share error “’net usershare’ returned error 255” as well.
Source link