Archive for July 21st, 2007

Samba – Network Access Denied

Saturday, July 21st, 2007

Samba is a linux application that allows for directory paths and printers on a linux operating system to be shared on a network. One of the most common uses for Samba, and most frustrating to setup, is accessing a samba shared directory path from linux to a Windows computer. While I have read many a web post about the benefits of learning all about Samba, I really do not have an interest in becoming a Samba expert. I just want my file path shares to work!

I have literally spent hours researching and trying different configurations to get this setup to work properly. The benefits of accessing linux files from Windows is especially true when you are dealing with a webserver and you want to edit scripts and html files on the fly. Since most development tools and workstations are windows based, it speeds up the development time incredibly if you can instantly access your public_html directory, or for that matter, all of your linux operating systems folder paths from your windows workstation.

For my own setup, I choose just to access the /homes/ directory where I have my website stored. I prefer not to have direct write access to configuration files stored in /etc/ or /var/ for fear of accidentally deleting or overwriting one of these important files. Also, make sure that you keep proper backup files of your public_html directory before you start directly editing your web files!

So, without further explaining, here is my sample Samba configuration file that you can use for your own purposes. This is the smb.conf file:

[global]
obey pam restrictions = Yes
passwd program = /usr/bin/passwd %u
dns proxy = No
netbios name = NAME ON THE NETWORK
server string = DESCRIPTION OF LOCATION
printing = cups
password server = None
default service = homes
path = /home/HOME DIRECTORY
workgroup = NAME OF NETWORK
os level = 20
security = SHARE
max log size = 0
guest ok = yes
guest account = root
pam password change = Yes

[homes]
comment = Home Directories
valid users = %S
writeable = yes
create mask = 0664
directory mask = 0775
browseable = No 

[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No 

[LINUX USER NAME]
guest account = root
writeable = yes
write list = nobody
allow hosts = WINDOWS IP

If this configuration file helps you with your samba share issues, then please let me know.

Also, one important note about encrypted passwords. You do not need to turn off encrypted passwords to get a samba share to work in Windows. This is commoningly done by editing the registry. If you have enabled plaintextpasswords, then go back into the windows registry, search for enableplaintextpasswords, and set the value to 0.

Good Luck with your Samba Share adventures!