Samba Configuration

Setting up a new user

Follow the instructions at:

http://www.linuxheadquarters.com/howto/networking/samba.shtml

If they're not there, the key thing is you must create the entries in the smbpasswd file for each user.

Run the following as root to create an initial smbpasswd file. Note: later installations may expect the destination to be /etc/samba/smbpasswd. The actual location is set in smb.conf.

  • cat /etc/passwd | mksmbpasswd.sh > /etc/smbpasswd.

This does not create the passwords for each user, so you must run smbpasswd for each user.

# smbpasswd -a username

Checking Server

$ smbclient -L localhost

Firewall

Enable tcp ports 139 and 445, udp 137 and 138 inbound to the Samba server

Mounting in Linux

Create a file containing your samba user credentials, e.g. /etc/samba/auth.smb. Make sure it's not readable by others.

# umask 0077
# cat >> /etc/samba/auth.smb <<EOF
Password:
username=myname
password=mypassword
EOF

# mkdir /mnt/smb
# sudo smbmount //server/share /mnt/smb -o "credentials=/etc/samba/auth.smb,uid=username,gid=groupname,fmask=664,dmask=775"

-- Frank Dean - 13 Sep 2007


-- Frank Dean - 31 Jan 2004