samba setup on ubuntu
app samba files: /etc/samba/smb.conf sample sbm.conf in private bin
load changes
allow samba traffic ufw
Security
Disable nmbd
in /etc/samba/smb.conf disable netbios = yes smb ports = 445
Server
Samba directory
create directory for samba suers and give permission to sambashare
Add new users
Create a share
[ShareName] comment = Sahre Descriptio path = /path/to/share/on/server valid users = @sambashare create mask = 0660 directory mask = 2770
@sambashare will allow allow all users of sambashare group create mask will give read write permissions to owner and all members of group directory mask will allow all users to create new directories NOTE: these won’t take effect in certain situation such as an ntfs drive attached to my main linux machine the permissions will not be enforced and the ntfs will take priority ???
Clients
Auto mount share
need cifs-utils,
1 - store credentials in /etc/samba/credentials 2 - make credentials owned by root and read only by root
edit /etc/fstab to mount sambashares
ex: //wannabeengineer/media /media/samba cifs credentials=/etc/samba/credentials,uid=1000,gid=1000,file_mode=0700,dir_mode=0700 0 0
NOTE: fstab must be reloaded for these changes to take affect so if experimenting with fstab and don’t wanna keep rebooting reload daemon to test changes
debugging: mount: /media/mnttest: mount point does not exist. , first create the mountpoint
mount: /media/mnttest: mount(2) system call failed: No route to host. install cifs-utils Auto mount share