1

I'm trying to switch from Windows to Ubuntu Desktop.

I want to be able to share folders between other computers on the local network whether they be Windows or Ubuntu.

From help I found the option to share the Public folder but I still couldn't access the folder from Windows. I also want to share other folders, not just public.

I found some instructions online for other forms of sharing but don't seem to have the "Local Network Share" option that some mention.

What is simplest alternative to Windows sharing?

johna
  • 171

4 Answers4

2

Welcome to AskUbuntu!

If you do not need anything too complicated, you can set up sharing of directories in Settings. Here's how:

  1. Open Settings
  2. Click the "Sharing" option on the left: Sharing in Gnome is too hard
  3. Click the "Media Sharing" item to open a small modal: Slide that Toggle
  4. Click the "Media Sharing" toggle to activate it.
  5. If you do not want to share your Music, Videos, or Photos directories, click the trash can to remove permissions. If you would like to share a specific directory, click the little plus and choose the location you'd like to share: Add any Directory
  6. Close the modals and test on a different networked machine.

That's all there is to it if you just need basic sharing. If you have needs like passwords, custom views, multiple shares, and the like, then Samba or something similar will need to be installed and configured.

matigo
  • 24,752
  • 7
  • 50
  • 79
1

Samba is the server application that implements client terminal access to folders, printers and disks through the SMB/CIFS protocol.

To install and configure Samba server for Ubuntu, follow these steps.

Update the repository information and install any updates:

 sudo apt update

sudo apt full-upgrade

Install Samba:

 sudo apt install -y samba samba-client smbclient cifs-utils

Make a copy of the configuration file:

 sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_sample

Create a folder to share between users:

 sudo mkdir /media/samba

sudo mkdir /media/samba/public

Grant the necessary access rights to the folder:

 sudo chmod -R 0755 /media/samba/public

Create a directory for a given number of users:

 mkdir /media/samba/private

Create the user group for samba:

 sudo groupadd smbgrp

Add the Samba users you need:

 sudo useradd user1

Repeat for each user

Add the created users to the group:

 sudo usermod -aG smbgrp user1

Repeat for each user

Change the group that owns the limited users directory:

 chgrp smbgrp /media/samba/private

Create a password for each added user:

 sudo smbpasswd -a user1

Repeat for each user

Edit the previously backed up samba configuration file with nano:

 nano /etc/samba/smb.conf

Delete all lines from the file. Insert the following:

 [global]

workgroup = WORKGROUP

security = user

map to guest = bad user

wins support =

no dns proxy = no

[public]

path = /media/samba/public

guest ok = yes

force user = nobody

browsable = yes

writable = yes

[private]

path = /media/samba/private

valid users = @smbgrp

guest ok = no

browsable = yes

writable = yes

Save with Ctrl + X.

global — general Samba server settings

public and private — description of configuration directories.

global has five parameters:

workgroup — workgroup. WORKGROUP is specified as the default group.

ONLINE — The value user means authorization by the username/password pair; map for guests — defines how requests are processed. ;

wins support — • enable or disable WINS support;

proxy dns — ability to send requests to a DNS.

Directory settings

path — full path to the directory on your hard drive;

guest ok — ability to access the folder without a password (guest);

browsable — whether to display the folder on the server

force user — the user who is working with the folder. To increase server security, "nobody" is usually used.

write — yes allows the user to perform actions on files inside the folder

valid users — list of users who have access to the folder. If there are multiple users, their names are separated by commas. If access is required for users belonging to a group, the “at” symbol (@) is placed before the group name.

kyodake
  • 17,808
1

After trying various options I came across this post about installing and configuring Nautilus file sharing on Ubuntu 24.04.

Although it still requires a few Terminal commands it was simple to set up and enabled the Sharing Options right-click menu option.

However these instructions did not work at first and I found an answer here.

So the instructions I followed were:

sudo apt update

sudo apt install nautilus-share (Press y when asked to confirm installation)

sudo usermod -aG sambashare $(whoami)

Reboot the PC.

sudo smbpasswd -a $(whoami) (create a new password for the share)

You should now have Sharing Options available when right-clicking on a folder where you can control sharing and who has access.

I then followed the advice in the second link above. Open a File window find your way to the folder /etc/samba/ (you can start by going to Other Locations) and open the file smb.conf in the text editor just by double-clicking.

Find the line workgroup = WORKGROUP and add a few line below it: force user = John (replace John with your username) Then save and exit.

Then restart Samba with: sudo service smbd restart

You can now access the share from a Windows PC with the IP address (eg. \\192.168.0.99) or PC name (eg. \\LinuxPc).

johna
  • 171
0

For virtualbox, device > share folder works, ref this tutorial