Can samba be run as non-root user?

Advertisements

I’ve set up a service to run samba as non-root user, where the config file for the daemon and the service are on my home directory (on the proper subdirectories). But I keep getting samba starts and samba stops and the process exists without any information. (Both on systemctl or journalctl).

Can samba be run as a service and non-root user?

>Solution :

No.

Samba listens to ports below 1024 (135, 445 namely), and convention requires that only root can bind ports below 1024.

However, Linux has a capability interface that can be used to allow services to bind to ports that are below 1024 without root:

sudo /sbin/setcap 'cap_net_bind_service=ep' /usr/sbin/smbd

Leave a ReplyCancel reply