Monday, May 25, 2009

Samba configuration

Samba configuration

Prepare the system

If you want LDAP,

yum install openldap-clients perl-LDAP

Check LDAP's access,

ldapsearch -H ldap://LDAP_SERVER -x -b "dc=example,dc=com"

Configuration

Almost from scratch,

mv smb.conf smb.conf.dist

sed -e '/^#/d;/^[[:space:]]*$/d;/^;/d' smb.conf.dist > smb.conf

and adapt it to your needs,

[global]

workgroup = SAMBA2

security = user

load printers = no

username map = /etc/samba/smbusers

passdb backend = ldapsam:ldap://10.91.4.191

ldap suffix = dc=example,dc=com

#ldap machine suffix = ou=machines

#ldap user suffix = ou=users

#ldap group suffix = ou=groups

ldap admin dn = cn=admin,dc=example,dc=com

ldap delete dn = no

#domain logons = yes

#enable privileges = yes

#ldap passwd sync = yes

# domain logons = Yes

# domain master = Yes

[homes]

browseable = no

writable = yes

Check the configuration,

testparm

Configure the LDAP admin password,

smbpasswd -w examplepassword

ERROR: failed to setup guest info.

- Check secrets.tdb.

- Do,

net getlocalsid

net getlocalsid

pdbedit -L

pdbedit -Lv guest

- Check LDAP (ldapsearch uid=guest)

Ref. lists.samba.org/archive/samba/2006-June/121701.html

On the client

Check the service remotely,

smbclient -L SERVER_IP

[root or ldap admin password]

Configure some mountpoint,

//SERVER_IP/folder /destfolder smbfs rw,user,uid=500,gid=500,username=USERNAME,password=PASSWORD 0 0

Note. this works to mount share from Windows machines too.

Samba printing references

Printer driver download : www.mail-archive.com/samba@lists.samba.org/msg31626.html

Samba & CUPS : www.samba.org/samba/docs/man/Samba-HOWTO-Collection/CUPS-printing.html

Samba / LDAP references

IDEALX Howto : download.gna.org/smbldap-tools/docs/samba-ldap-howto/

Another Howto : www.unav.es/cti/ldap-smb/smb-ldap-3-howto.html

Samba / LDAP : www.nomis52.net/?section=docs&page=samldap

Other troubleshooting references

readlist.com/lists/lists.samba.org/samba/3/15742.html

 
Things You Should Know About Linux !!!