# A generic smb.conf (or at least this is what I intended to achieve from this). # This file is strictly for novices who have decided to use linux fulltime and for that they # have decided to take on the formidable task of configuring samba. So, Please don't curse me # for giving one of the worst smb.conf (Yes! I am sure this is not *the worst*) for helping # in configuration. # # I have written this file for sharing only file space. As I don't have printers attached to my machine, I could # not put something for printers. # # Another thing that I wish to point out is that (for those who don't know) I am not using # even 5% of samba. It's such a powerful (and that's why so painful) app that you should be # doing many things to use it properly. # # You can reach me at manasg@inf.com # # Where I have put *, you have to change the values, and then remove * (obviously). # You have to create the directories whose path I have given or change the value of path. # # Don't forget to run testparm for the validity of parameters. # # This is the global section, All the values fixed here are used in other sections. # Note-> You can override them in services provided they are service specific. e.g. managle case [global] # First declare the protocol level that you intend to use. NT1 works for me. In 'man # smb.conf' do /protocol for more info. To tell you frankly, I don't know much about this. protocol = NT1 # Following 5 parameters decide the way file names will be handled between your linux # desktop and the Win* machines. I prefer these settings, you can find more about it in 'man # smb.conf' by doing /MANGLING. mangle case = yes mangled names = yes default case = lower case sensitive = no preserve case = yes short preserve case = yes # This options decides the format of the information about the connection with the remote # printers. Check /"lpq command" in 'man smb.conf'. printing = bsd # Decides the time for which lpq info will be cached. Check out /"lpq cache time" in 'man # smb.conf'. lpq cache time = 0 # Decides the name of by which your machine will be advertised. Make it what you want your # machine to appear as in Netwrok-Neighborhood. For more info, do /"netbios name". * netbios name = ENIGMA # This is the workgroup name in which your machine should appear. Not setting it properly # causes your machine to be found by 'find computer', but not during browsing. DO CHANGE IT. * workgroup = INFOSYSKEC # This is the comment with which your linux box will appear in Network-Neighborhood. server string = A poorly managed Machine # An appropriate comment is to be put for this!! admin users = su # Don't forget this!! When a client connects to your machine, he will get the privildges of # this user. Many people configuring samba for the first time make the mistake of not adding # it and then they wonder "why on earth am I asked for a password for something called $IPC # when I connect to my machine from Win* machines and damn it!! no password seems to work!!! guest account = ftp # This is the service that a client will be connected to if he requests a service that # doesn't exist. default service = lin # Read the howtos for this. All I can say is that this should be fine for you. os level = 2 # Samba logs all the events in this file. log file = /var/adm/log.smb # By 10, I mean (or rather samba understands) 10K. Increase it if you like huge log files. max log size = 10 # Almost no debugging. Minimum log generation. If you are interested in logs, you can set it # for a higher value. Check out the man pages. debug level = 1 # Simulates modes when a file is opened. For explanation, -> man pages. share modes = yes # Specify a directory. lock directory = /var/adm # Copied it from Net. It's claimed to enhance the speed. socket options = TCP_NODELAY SO_KEEPALIVE SO_SNDBUF=8192 SO_RCVBUF=8192 # Specify the IP Address of your WINS server (if any), else delete this line. If you don't # understand what the I mean, contact your sys admin. * wins server = 204.4.54.10 # This is also claimed to be a speed enhancer. read prediction = yes # Don't forget to uncomment this line if you plan to use the service [smbuser] ; username map = /etc/users.map ######## End of Global Section ########## # These are a few services that I have chosen to provide. You can change them according to # your needs. # This service is accessible by all (see guest ok = yes). I generally put things to share # with other users in this. You can change the name of this service from 'tmp' to some other... [tmp] comment = the garbage dump ; A line that describes the service browseable = yes ; Makes this service visible available = yes ; Makes this service available. You can temporarily switch ; off a service by making it no. public = yes ; Equivalent to saying guest ok = yes. The priviledges will ; be of the guest. read only = yes ; Don't allow anybody to write on this. printable = no path = /home/samba/tmp ; This dir will be shown for the service tmp. create mask = 0744 ; Read man pages. # It gives users of my linux box access to their home dirs through Adosi-Padosi. [homes] comment = home directories browseable = no ; This is really interesting. It doesn't show the service but ; it's available. available = yes guest ok = no ; If you want everybody to access all the files on your linux ; box, and so, screw up everything, just make it yes!! read only = no ; I do feel that users should always have write permissions ; on their home dirs. printable = no create mode = 0700 # Well, this one is to make documentation available to users of my machine and only the # users of my machine. [doc-help] comment = documentations, helpfiles, FAQ's browsable = yes available = yes public = no username = @root, @users ; Giving users and root the access to this service. writable = yes ; Giving them write access. read list = @users ; Taking write access back from users. (What did you think? I ; am so stupid that I'll give users write access to /usr/doc) printable = no path = /usr/doc create mode = 0755 # A service that is writable by all. Note-> All the files will be owned by the default user and anybody can # delete anybody's file!! # Uncomment for use. ;[public] ; comment = for public ; browsable = yes ; available = yes ; guest ok = yes ; writable = yes ; path = /home/junk # It creates a service that can be used by some specific people. If a few freinds of yours # have run out of space on their machines and want to use a part of your machine for keeping # /sharing their files among themselves, this service helps you. Add the following line to # your /etc/passwd # smbuser::600:600::: # 600 is uid and gid of smbuser, you can use any value above 500. Make smbuser password # protected by 'passwd smbuser'. Create a file /etc/users.map and add the following line to # that # smbuser = X Y Z # Where X, Y and Z are the names of your freinds that are used for their win* domain. # Uncomment the following if you want this service. And make sure you have uncommented 'username map'. ;[smbuser] ; comment = For smbusers ; browsable = yes ; available = yes ; valid users = smbuser ; ; Restrict the access to smbuser only ; guest ok = no ; writable = yes ; ; Make it no if you wish. ; printable = no ; path = /home/samba/smbusers ; create mode = 0755 # This service is only for manasg and rohita # Uncomment if you want. ;[sharing] ;* comment = For Manas & Rohit ; browsable = yes ; available = yes ;* valid users = manasg rohita ; guest ok = no ; writable = yes ; printable = no ; path = /extra/junk ; create mode = 0765 # This service lets me browse through all the files (except /proc and /tmp) on my system. # Uncomment for use. ;[root] ; comment = Root!! ; browsable = yes ; available = yes ;* valid users = manasg ; writable = no ; printable = no ; path = / ; dont descent = /proc /tmp ; /proc and /tmp won't be available. # This service is for all the users of your system. It may be helpful in the case when you don't want to # create a home directory for a person with whom you want to share filespace only. Add that user in # /etc/passwd file without any home dir and create a dir /usr/users/his_user_name for him/her. # Uncomment for use ;[userdir] ; comment = Directory for users ; browsable = yes ; available = yes ; public = no ; writeable = yes ; ; Make it no if you wish. ; path = /usr/users/%u ; ; %u is replaced by the username. ; create mode = 0755 # When a client asks for a service that does not exist, he is thrown here. This is where I # have put some material on linux and it gives me a chance to promote linux ;-). [lin] comment = Linux All the Way browsable = yes available = yes public = yes writable = no printable = no path = /home/samba/lin ############# End of file ############## #I can keep on making services but it should be OK with you. # # This file is in no way a replacement of howtos and man pages. If you really want to use # samba, you have got to read them. # # My intention to write this file was to help people start samba working with minimum labour. # Also, I have tried that after reading the comments, they should be able to create some # general services. If you think that it falls short of achieving that, just drop me a mail. # I'll be thankful to you!!