One of the neat things about taking computer networking courses is learning how to do things I more or less already know how to do, but learning how to do them better and more simply. I've been considering replacing my Thinkcentre M920Q running OpenMediaVault and CasaOS, and instead using my Raspberry Pi 5 running an Arch Linux distro and just set up a samba server.
There's certainly advantages to using OMV - it's got a user-friendly GUI that makes setting up a NAS easier. However, I wonder if an Intel Core i7 is a bit overkill for what I use a home server for. The RPI5 is more power efficient, physically smaller, and great for these kinds of simple tasks. Of course, I could simply install OMV on an SD card, pop it into the RPI5, and manage my NAS that way, but 1) I love doing things myself and 2) I don't like having multiple machines doing tasks that could easily be done by one.
Right now, the RPI5 is running the Arch-based distribution EndeavourOS and it's only job at the moment is to be a torrent seed box. But now I'd like to give it more responsibilities like providing NAS services on my home network. Below are the steps I used to set up a Samba share, inspired by one of the lab assignments in my Linux server course.
sudo pacman -Sy samba
, but any package manager will have samba.sudo systemctl enable smb nmb
.sudo firewall-cmd --add-service=samba --permanent
. Then run sudo firewall-cmd --reload
to reload the firewall.net user [username] [password] /add
.sudo useradd -M -s /sbin/nologin [username]
.sudo passwd [username]
.sudo groupadd [group share name]
and add the user account to this group withsudo usermod -aG [group share name] [username]
.sudo smbpasswd -a [username]
and enter a password./home/[user]/share
.sudo chown root:[group share name] /home/[user]/share -R
.sudo chmod 777 /home/[user]/share -R
.sudo semanage fcontext -a -t samba_share_t "/home/[user]/share(/.*)?"
.restorecon -R -v /home/[user]/share
.sudo vim /etc/samba/smb.conf
.[global]
" and add the following:workgroup = WORKGROUP
netbios name = myserver
security = user
map to guest = bad user
[share]
comment = restricted access read/write share
path = /home/[user]/share
read only = No
valid users = @[group share name]
sudo systemctl start smb nmb
.Now connect with your machine. I'm using GNOME, so I'll connect to the new server by opening my file manager (Nautilus), click on "Other Locations" in the sidebar, and in the server address field enter smb://[ip address of server]/share/
. From there, I am prompted with the username and password created in step 2. If all went well, you should be able to access the shared folder from your Linux server.
Thanks for reading. Feel free to send comments, questions, or recommendations to hey@chuck.is.