Knowledgebase

Email to friend
* Your name:
* Your email:
* Friend's email:
Comment:


Configuring Samba to share local resources

Samba: is an Open Source/Free Software Suit that has, Since 1992 provided File and Print Services to all manners of SMB/CIFS clients, Includeing the numerous versions of Microsoft Windows Operating Systems. Samba is freely available under the GNU Public License.

Samba is natively installed on Debian Etch and seems to connect to windows shares out of the box. but if you want to allow windows machines to connect to your linux server via Samba you must make a couple of Configurations.

First you must tell Samba whom (what user) is allowed to log in remotely. this is done via the smbpasswd  in a shell or CLI.

            # smbpasswd -a UserID
            Enter New Password: #
            Confirm New Password: #

The Trigger -a tells Samba to add the user to the smbpasswd file. in this case you would replace UserID with the name the user will use to log in.

**NOTE** default samba settings only allow a system user to be allowed to log in. The password for that system user may be diffrent from the samba password you create. and for security issues, root is by default, not allowed to be a Samba User. these settings and more may be changed by editing the smb.conf file (/etc/samba/smb.conf) as usual, if you edit the smb.conf file you must restart the samba server for your changes to take effect

            # /etc/init.d/samba restart


The defualt settings for samba share only a users home directory to that user (/home/UserID) which if your a user like me is a bit less than adiquite. I wanted to share a group of drives to my user accounts for use remotely (Mp3's, Software, Movies, etc.) In order to do this. one must make the following changes to their smb.conf (/etc/samba/smb.conf)

To enable Linux system users to log in to the Samba server. Under the global section, remove the ";" at the front of the line security = user so it looks like this:
           
           
security = user

To tell the truth, I'm not really certain that this is necessary, but the instructions I came across said so. so I kinda went with the flow on it. I really don't know why my Samba Shares worked in the first place without making this change. (It would share the home directory of the user only, but it did allow login)


In the section [homes] change writable = no to:

            writable = yes

This actually seems important if you want your shared drives to be writable by the remote user. again I didn't really test it out to see if leaving this option to no locked that function out. but it sounds logical.


Add and Configure this at bottom of file (I deleted 'Force Group' line)

            [allusers]
              comment = All Users
              path = /home/shares/allusers
              valid users = @users
              force group = users 
              create mask = 0660
              directory mask = 0771
              writable = yes

I created this for each drive I wished to Share. e.g. I had one for /mnt/DataA, one for /mnt/DataB and so on... I think the options Are pretty self explanatory. I did remove the Force Group line from my entries with no ill effects.

again, after editing smb.conf you must restart your server for changes to take effect.

            # /etc/init.d/samba restart


This information is here to serve primarily as notes for Kinetic Bands internal uses, they are web accessible only in hopes that the information contained may be useful to others, this data was copied in part from the following source, you will find additional information and troubleshooting info there.

samba.org




RSS