samba library

1.  list users
2.  add user
3.  delete user
4.  list shares
5.  populate share options
        sharename
		guest
		browseable (default to yes)
		writeable (default to yes)
		valid users (default to everyone)
		read only = no
6.  restart samba server



example:
[allaccess]
    path = /media/common
    read only = no
    writeable = yes
    browseable = yes
    guest ok = yes
    valid users = one, two, three, four


list shares
grep ^\\ /etc/samba/smb.conf |grep ^\\[ |grep -v \; |grep -v homes | grep -v print |grep -v global

list items in profile
awk "/sharename/{flag=1;next}/\\[/{flag=0}flag" /etc/samba/smb.conf

restart server (systemd and sysVinit
service smbd restart

to disable service
systemd (check if systemctl is present, not systemd running)
systemctl disable smbd
systemctl disable nmbd
systemctl mask smbd
systemctl mask nmbd

sysvinit
update-rc.d nmbd remove 
update-rc.d smbd remove

to enable

systemd (check if systemctl is present, not systemd running)
systemctl unmask smbd
systemctl unmask nmbd
systemctl enable smbd
systemctl enable nmbd

sysvinit
update-rc.d nmbd defaults 
update-rc.d smbd defaults

create users
smbpasswd -L -a username (asks for user password twice)

delete users
smbpasswd -L -x username (does not ask for a password)

change password
smbpasswd -L -U username (asks for old password, and new one twice)

list samba users
pdbedit -L
