How to install and configure SAMBA on Debian Squeeze

From LQWiki
Jump to: navigation, search
sudo apt-get install libcupsys2 samba samba-common

Workgroup/domain name:

WORKGROUP
#vi /etc/samba/smb.conf

activate line security = user, to enable linux system users to access samba

[...]
# “security = user” is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
security = user
[...]
/etc/init.d/samba restart

Add samba shares for "allusers"

mkdir -p /home/samba-share/allusers
chown -R root:users /home/samba-share/allusers/
chmod -R ug+rwx,o+rx-w /home/samba-share/allusers/
#vi /etc/samba/smb.conf
[allusers]
comment = All Users
path = /home/samba-share/allusers
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
writable = yes

If you want all users to be able to read and write to their home directories via Samba

[...]
[homes]
comment = Home Directories
browseable = no
valid users = @users
writable = yes
create mask = 0700
directory mask = 0700
#/etc/init.d/samba restart
  • By default, the home directories are exported read-only. Change the# next parameter to 'no' if you want to be able to write to them.
read only = no

Add and menage samba users:

useradd  samba-user -m -G users

Set user password:

passwd samba-user

Add samba user to database:

smbpasswd -a samba-user