Tag Archives: cifs

Samba server and client configuration in Debian

http://www.debianhelp.co.uk/samba.htm
http://julien.herbin.ecranbleu.org/samba_client_howto/

Samba server configuration

apt-get install samba samba-client

Check an smb.conf configuration file for internal correctness.
testparm

Look what services are available on a server.
smbclient -L //server -U username

/etc/samba/smb.conf

[global]
workgroup = WORKGROUP
server string = %h server (Samba %v)
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
security = user
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user
usershare allow guests = yes

[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700

[disk]
path = /disk
browseable = yes
writeable = yes
comment = Shared data
guest ok = no
read only = no
create mask = 0775

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no

Synchronize Samba username with Linux
smbpasswd -L -a username (set a password)
smbpasswd -L -e username (enable user)

Example of a manual mount
mount -t smb //server/share /mnt/somedir

Example of automatic mount a startup
The first one is mounted read-only whereas the second one is mounted read-write. If you have need “user name/password” to authenticate, then add in the “” column "username=your_user_name,password=your_password,ro,user".

//server/share /mnt/somedir smbfs password=,ro,fmask=755,dmask=755
//server/share /mnt/somedir smbfs password=,fmask=777,dmask=777