Originally Posted by DJOtaku
I've been reading and trying to follow everyone else's examples on here and nothing appears to work. Samba seems to be one of those things where you can't take someone else's examples and it works for you. Point in case - I tried to make this samba configuration off of a working samba configuration I have working on another machine - and it doesn't work! I must have done some voodoo in addition to the smb.conf file and now I don't remember what I did.
You really only a couple lines to get to working. In the vast majority of installations you don't need to worry about 90% of the options. You can add them once you get it working. I suggest you don't use the guest logon. It's horribly insecure, even with a working firewall. Just enter a password once and check the 'remember' box and forget it. Or attach the share to a drive letter. If other people attach to your share, then share it themselves...
First, you need to decide if you want Root WRITE access. You do copy videos to the linux box, don't you? If you rename your current config, create a new, minimal configuration it will allow root access. The usual package smb.cong has a line that prevents root from gaining access to your disk.
Look for this line:
; invalid users = root
Then you need to set up samba users to match the valid users
names in your shares. Be aware that the user must exist before you can create a SAMBA password for them. Linux comes with a "nobody" user but I don't know if you need to set up a separate smb user name if you use the guest option.
New SMB password:
Retype new SMB password:
There is a configuration checker that can also lead you to useful information called testparm. It can even show you a working configuration stripped from the original.
Basically you need only a couple lines to make it work.
#change this to your workgroup
workgroup = SIGGMA
#Name in Windows Network
server string = %h server
#no DNS for host names
dns proxy = no
#This line says use the 'hosts' file first for machine names
name resolve order = host lmhosts bcast wins
#Important lines here, this says use regular pam authentication
security = user
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
#I added this to chew up memory so directories are retrieved a bit faster.
#Default is 8K (8192) I think
socket options = TCP_NODELAY SO_RCVBUF=32768 SO_SNDBUF=32768
##Shares go here #
#A working CD share, notice the preexec and postexed?
#I don't use my webserver to burn media but I'll bet it will work if you make it writeable...
comment = Linux server's CD-ROM
writable = no
locking = no
path = /cdrom
public = yes
preexec = /bin/mount /cdrom
postexec = /bin/umount /cdrom
path = /var/www
writable = yes
admin users = www-data
write list = www-data
valid users = www-data
comment = Webserver root, creates new files as webserver
path = /var/www
writeable = yes
write list = root
valid users = root
comment = Webserver root, creates new files as root
Don't forget to restart samba. It's like this on Deb, Ubuntu etc.
You MAY also need to restart the windows box if authentication has failed and to reset share names in XP. Vista is a bit more dynamic. Not sure if that's good or not...
I just tested a new install from Debian lenny. The only thing I changed in the distribution config was the Workgroup line then I uncommented the allow root line, the three cd rom lines, added a writable [root] section for the drive root and added smbusers.
The most common issue I had was forgetting to create smb users. Then came thinking things needed to be changed and not reading the documentation. If you need LDAP or some other authentication, read the docs and there are tons of articles on the web, like this:
Hope this helps.