2023/02/04
I installed Ubuntu Server 22.04 in an old tablet and I connected a USB solid-state drive that I want to share in my local network via SMB. These are the steps I followed:
sudo apt install samba
sudo nano /etc/samba/smb.conf
The file has lots of comments, but it has a global section, and then you add your own section. Under the global section, I did two things that are optional for you:
a) I set the workgroup to the one I use in my local network.
b) I limited the drive share to only one internet interface. In my case, ethernet (eth0
in this example).
Note: The interfaces item was originally preceded with a ;
character. You need to remove it, then make sure to add the same indentation as the rest of the lines (3 spaces in my case).
[global]
workgroup = MYWORKGROUPNAME
interfaces = 127.0.0.0/8 eth0
[MyShareName]
comment = This is the friendly name of my share
path = /path/to/my/shared/drive
browsable = yes
guest ok = yes
read only = no
create mask = 0777
directory mask = 0777
writeable = yes
force user = myuser
force group = myuser
Note that myuser
is the user that owns the /path/to/my/shared/drive
directory.
sudo service smbd restart
sudo service nmbd restart
For example, in Windows, open a File Explorer window and, assuming the server IP address is 192.168.0.5
go to the location \\192.168.0.5\MyShareName
.
You should be able to create, modify and delete files and folders.