Installation and Configuration of Samba Server in RHEL5/Fedora



Hi All,

Here I am explaining you about Samba Server Installation and configuration .

Samba server will helps us to share the files between Linux and Windows Computers.
Step 1 : Package : Samba*
             Port       :  445

Step 2 : yum install samba* -y

(if any issues with your yum repository use yum install samba* --skip-broken -y)

Step 3 : Configuration file : /etc/samba/smb.conf

Step 4 :  chkconfig smb on

By default it will start the smb service in the 3 4 & 5 run levels.

Now, We are done with the installation.

In the configuration file at line number 75 give your work group name but becareful with the spaces.

workgroup = myworkgroup

at line number 81 mention the first three octets of your IP

eg : if you are using 192.168.0.0/24 network use the first three octets in it as follows :

hosts allow = 192.168.0.

at line number 235 copy the 7 lines...

if you are in insert mode press esc to come out of that. then at line number 235 press 7yy to copy the below 7 lines.

Paste the copied lines at the end of the configuration file by pressing p

the 7 lines will be as follows :

[public]     ---> defines the share name
comment = Public Stuff   ---> comment of the shared folder
path = /home/samba  --->  path of the shared directory
writable = yes  -------> whether the users will have write permissions or not
printable = no  -------->  whether the users are able to print or not
write list = +staff  -------> groups which have write permissions

now you can modify the above lines as per your requirements

[rhce]
comment = rhce stuff
path = /rhce
writable = no
printable = no
write list = +staff

Note : after modifying the lines do not forget to remove the comment mark" ; " before each line.

In the above scenario we have shared the folder rhce and it is not writable to the users and it is permissible to all the members who are in staff group

# useradd a1
# smbpasswd -a a1
# useradd a2
# smbpasswd -a a2
# mkdir /rhce
# groupadd staff
# chgrp staff /rhce
# chmod g+w /rhce
# usermod -G staff a1
# usermod -G staff a2
# service smb restart
# testparm

the testparm will show you the output which has shared through the samba server

# findsmb

The above command will search for the samba service in the network.

Now try to access the linux machine from the windows computer  click on start --> Run --> in the text box type  \\<ipaddress of the linux machine>

Now you can see the shared folders on the linux machine in your windows computer.





Comments

Popular posts from this blog

[SOLVED]* Please wait for the system Event Notification service

Rebuild the initial ramdisk image in Red Hat Enterprise Linux

Python reference Interview questions