Linux Networking samba

samba – how to install and administrate a samba server

Reading Time: < 1 minute

Last Edited: 8/29/2022

WARNING! This document is unfinished. I am going to get the common bits out first. Then I can go back and add detail.

This is going to be a very short introduction on how to deploy “samba” on Linux. The goal of this is to use a Linux deployment in order to share out data in a fashion that a “Microsoft” client will accept.

How to Install:

The way to install samba is very simple and has remain unchanged for a period of time.

sudo apt update
sudo apt install samba

Administrate Samba:

In the next bit we are going to talk about how to create users for use in Samba, and how that administratively maps back to our Linux users and groups. Administrating a samba server can be done with a few simple commands.

How to add a user to Samba

sudo smbpasswd -a ubuntu

Note: The username “user” not accepted. The username “ubuntu” is accepted.

Note: Enable the user

sudo smbpasswd -e ubuntu

Now we are going to review one of the one important tasks of samba administration. We are going to learn how to edit the /etc/samba/smb.conf file. This file is used to declare which portions are made available through smb/cif.

A simple example is below which maps the linux space /mnt/lvnfs to a “shared” named “DATA” (shared as stated caps and all).

[DATA]
path = /mnt/lvnfs
valid users = @editors
browsable = yes
writable = yes
read only = no

Restart Samba with the command:

sudo systemctl restart smbd

Create the group:

sudo newgrp editors
sudo newgrp editors

Add yourself to the group:

sudo usermod -aG editors $USER
sudo chgrp -R editors: /mnt/lvnfs
sudo chmod -R g+rw /mnt/lvnfs

For web based administration you might consider using “webmin”.

references:

https://www.techrepublic.com/article/how-to-create-a-samba-share-on-ubuntu-server-20-04
https://en.wikipedia.org/wiki/Samba
https://en.wikipedia.org/wiki/Server_Message_Block
https://www.webmin.com/

Related posts

SAMBA – How to install the Samba Client

Tom Hamilton

Grub2 error during rebuild…

Tom Hamilton

ISCSI – Linux

user