Quantcast
Channel: Linux n Unix Help
Viewing all articles
Browse latest Browse all 20

samba server configuration in rhel5 step by step

0
0
Samba configuration in Linux Machines

Samba is a suite of utilities that allows your Linux Machines to share files and other resources.
such as printers with Windows Machines.

Before configuring Samba server in Linux you need to have the following Pre-requests.

1. Linux System with network Configured

Here i was configured My IP as 192.168.10.111

2. Windows System with network configured in Same network.
   here my System is having  192.168.10.108
  
3.Your Linux System firewall should be disabled.

Main Configuration:

1. Check your linux system wheather the samba package is installed or not with the following command.

[root@localhost ~]# rpm -qa samba*


2. If the packages are not installed in your system, use the following command to install from the internet.

[root@localhost ~]# yum install samba*
Note: Above command is for installing the packages from the internet only. So you should have the internet connection.

3. After installing the Packages
   Make sure that xinetd and Portmap service should be run.
   For checking those services are running or not, use the following commands.
  
   [root@localhost ~]# /etc/init.d/xinetd status

   [root@localhost ~]# /etc/init.d/portmap status

For starting the above service use the following services use the following commands.
  
   [root@localhost ~]# /etc/init.d/xinetd restart
  
   [root@localhost ~]# /etc/init.d/portmap restart


    After that Make sure that these services to be run completely. For that use the following commands.
  
   [root@localhost ~]# chkconfig xinetd on
  
   [root@localhost ~]# chkconfig portmap on
    Check the services is running or not. These services should be running condition.

4. Create 2 users in your linux System i.e: sri and Gani

   [root@localhost ~]# useradd sri
   [root@localhost ~]# passwd sri
   Changing password for user sri.
   New password:
   Retype new password:
   passwd: all authentication tokens updated successfully.

   [root@localhost ~]# useradd Gani
   [root@localhost ~]# passwd Gani
   Changing password for user Gani.
   New password:
   Retype new password:
   passwd: all authentication tokens updated successfully.

5. Now create the share directory. i.e which directory you want to share.
   Here iam creating directory called 'Sambashare' in the following Path. i.e /opt
   and give the full Permissions to the directory.

   [root@localhost ~]# mkdir /opt/sambashare/
   [root@localhost ~]# chmod 777 /opt/sambashare/
   [root@localhost ~]# ls -l /opt/
   total 360
   drwx------. 2 root root  16384 Feb  1 11:01 lost+found
   drwxrwxrwx  3 root root   4096 Feb  6 18:12 sambashare
   -rwxrwxrwx. 1 root root 344558 Jan 30 15:41 sysstat-10.0.3-1.i586.rpm


6. Now enter the configuration into following file. i.e /etc/samba/smb.conf
   In the above file enter the following configuration. Here iam giving permission to one user only.
Add the configuration at end of the file.
  
   Note: Better to take the backup of the configuration file.

   [root@localhost ~]# vi /etc/samba/smb.conf
  
   # My Sharing directory
   [data]
       comment = personal share
       path    = /opt/sambashare
       public  = no
       writable = yes
       printable = no
       browseable = yes
       write list = sri
  
     :wq!
    
     Use these to save the configuration file
     
      :wq!


7. Now add the user to the samba user's List
 
  [root@localhost ~]# smbpasswd -a sri
   New SMB password:
   Retype new SMB password:
   Added user sri.
   [root@localhost ~]#


8. Now we did the all the configurations. so start the samba service and check its status.

   [root@localhost ~]# chkconfig smb on
   [root@localhost ~]# /etc/init.d/smb restart
   Shutting down SMB services:                                [  OK  ]
   Starting SMB services:                                     [  OK  ]
   [root@localhost ~]# /etc/init.d/smb status
   smbd (pid  3686) is running...


Client side configuration for Samba server.

1. Check from your windows System to samba server whether Ping command is working or not.
  
   Start--> run--> cmd --> Ping 192.168.10.111
  
   If you are getting ping with proper reply then your server is working fine or else check the network connectivity
   and Linux System firewall.


2. Now access your samba server in the following way.
  
   Start --> Run --> \\192.168.10.111 -->Press enter. (Here IP address is your samba server IP address)

3. It is asking for samba user's username and password.


4. This is your samba server Main Screen.


5. Now you can Copy or Paste your data.

  
Now enjoy Data transfer through Linux and Windows easily.......

Viewing all articles
Browse latest Browse all 20

Latest Images

Trending Articles





Latest Images