Saturday, May 19, 2012

Public Share on Samba Server

1 comments

Goal of this tutorial is to show you how to set up a public share on your Samba server that can be used by everyone on your network with all rights. This will enable everyone on a Windows machine to access this without a password.  Of course, this has security implications but it is a good way to get something working.  The next article will show you how to create a share for one user in which that one user is the only one who can access the share.

1. Install Samba
yum install samba samba-client samba-common
chkconfig  – -level 35 smb on
service smb start
2. Create a New smb.conf file
First,  change the  default smb.conf file to a backup copy, and then create a whole new one.
# mv smb.conf smb.conf.backup
# vim smb.conf
Here’s the new smb.conf file:
Note the workgroup should be the workgroup that you are using on your Windows machines.
[global]
netbios name = linuxserver
workgroup = WORKGROUP
server string = Public File Server
security = user
map to guest = bad user
guest account = smbguest
[public]
path = /public
guest ok = yes
read only = no
3. Test with testparm
This will help you determine if you have any major problems with the set up you placed in smb.conf.
# testparm
Load smb config files from /etc/samba/smb.conf
Processing section “[public]”
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
[global]
server string = Public File Server
map to guest = Bad User
guest account = smbguest
[public]
path = /public
read only = No
guest ok = Yes
4. Create a public user
Since the purpose is to  map the users to a special guest account,  open the /etc/passwd file for editing, and add the following line to the end of the file.
smbguest:x:525:525:Samba Guest Account:/dev/null:/bin/false
This creates the guest account.  Now, create a smbguest group with a group ID, here the GID of 525 was used, it does not matter which number as long as it is not used and over 500.
groupadd -g 525 smbguest
Now, change to the root of the file system, and create the new directory that  to share.
# mkdir public
# chown -R smbguest:smbguest public
ls -l 
drwxr-xr-x 2 smbguest smbguest 184 2007-08-03 15:18 public

1 comments:

Admin said...

http://www.cyberciti.biz/faq/redhat-fedora-enable-ntfs3g-support/

Post a Comment