Score:0

How to setup a LAN Server only accessible inside for files and media?

ni flag

I used Ubuntu and Linux lot about 10 years ago for several years! I was fairly efficient at it.

Fast forward 10 years, I haven't used Linux much lately. At my church, I setup a OpenMediaVault server just for local access to files and storage. I'm discontented with OMV, and figure I can setup my own server easier with Ubuntu. I do have about 3 or 4 users. It would be installed on an old desktop tower with a new harddrive.

We share files on it, backup computers to it, and occasionally play music off it. Samba would be the primary way of sharing files. It should only be accessible from within the network, not outside. We have Macs, and a Windows computer that will access it.

If you could point me in the right direction, that would be great. Ubuntu web pages has changed dynamically, and is far more extensive than back in the day.

in flag
Would you be installing Ubuntu Server and doing everything via a command line? Or would you be installing Ubuntu Desktop and working with a GUI? If it’s Desktop, then a Samba share can be configured by right-clicking a directory and choosing the “Share” option
Nmath avatar
ng flag
This question is too broad and opinion-based for our Q&A format. This kind of question would be more appropriate for Ubuntu Forums.
Score:2
es flag

Samba would be the primary way of sharing files.

The following assumes you are using Ubuntu 22.04 Server or later:

Install samba:

sudo apt install samba

Make it discoverable and accessible to Win7, 8, 10, and 11:

sudo apt install wsdd

Make it discoverable and accessible to MacOS:

sudo apt install avahi-daemon

Notes:

  • wsdd = WS-Discovery is the way Windows discovers other Windows boxes in the network

  • avahi = A modern samba server automatically broadcasts itself to the rest of the LAN using this multicast protocol. You just need to enable it by adding the avahi-daemon package.

Both MacOS and >= WIn7 machines should be able to discover the samba server in their respective file managers. You can also connect to the server explicitly by using it's mDNS host name - host name with a .local attached at the end:

  • Explorer: \\server-host-name.local

  • Finder: Connect to Server > smb://server-host-name.local

I would recommend setting up a Test share until you figure out how you want to set up your shares:

Create a Test folder:

sudo mkdir /Test

Make yourself the owner - I will use my user name as an example:

sudo chown morbius /Test

Then create a share definition at the end of /etc/samba/smb.conf that looks something like this:

[Test]
path = /Test
read only = No
guest ok = yes
force user = morbius

Then restart smbd:

sudo service smbd restart

Notes:

  • Changing read only = No to read only = Yes will make this a read only share.

  • Changing guest ok = yes to guest ok = no will force a credentials prompt on the client which means you will have to create a local Ubuntu user to each client user then add that user to the samba database - for example:

    sudo smbpasswd -a morbius
    
subuntu avatar
ni flag
Thank you! That looks very easy. I'm perfectly fine setting up a server without GUI. I would also need to enable ssh, so I do not need to keep a keyboard or monitor connected. Basically this would be a NAS setup. I just didn't think of that word when I posted my question.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.