Friday, December 30, 2011

Configuration of Samba Server in RHEL 6


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

 

Package :- samba

Service :-  smb

Server Settings 

Samba Configuration in RHEL with Authantication & when Selinux is Disabled.
 
 1. Install Samba Package
  
 #yum install samba*
 
2.  Create a Directory name “share”
 
#mkdir /share
 
3. Open Configuration file of samba
 
 #vim /etc/samba/smb.conf
    --change workgroup name
 
workgroup=SMBGROUP
 
host allow=127. 192.168.1. 
 
  -- go to last line and type
 
[share]
comment=share by samba
path=/share
writable=yes
validusers=root
browseable=yes
createmask=775
 
 ---save and quit
:wq 
 
#service smb restart
#chkconfig smb on
 
4. Change containt of share directory
 
#chcon –t samba_share_t share
 
#ls –Z     --- to show listed directory containt and properties 

#smbpasswd –a root

  give root password -----------
  confirm password   -----------
 
5. To check ur configuration in ok or not
 
#smbclient //192.168.1.17/share –U root
  give root password -------
 
6. Give permission on share directory
 
#chmod 777 /share
 
When Selinux is enabled then above configuration is same &
below r the steps to enable samba service in selinux.
 
1. To check selinux is enforce or disabled
 
#getenforce
 
2. If enable then 
 
#getsebool –a |grep samba
 
#setsebool –P samba_enable_home_dirs on
 
#setsebool –P samba_export_all_ro on
 
#setsebool –P samba_export_all_rw on
 
#ls –Z
 
#service smb restart
 
#chkconfig smb on
 
 
In Client side:

Start--->Run-->Type
 
\\192.168.1.17 Then,
 
Click ok
 
  give user name = root &
In password = password of root
 
click ok
 
then,..
 
Enjoy it have a great day…

 

 

Tuesday, December 20, 2011

HOW TO CONFIGURE DHCP ON RHEL 6



Dynamic Host Configuration Protocol (DHCP) is a network protocol that automatically assigns TCP/IP information to client machines. Each DHCP client connects to the centrally located DHCP server, which returns that client's network configuration (including the IP address, gateway, and DNS servers).


First configure ipaddress in server then restart his service….

Step 1. You need to install DHCP package.

Example:
[root@localhost ~]# yum install dhcp*

Sample file copy and paste the specified location /etc/dhcp/dhcpd.conf and get the dhcp service.

-Step 2. [root@localhost ~]# cd /usr/share/doc/dhcp-4.1.1

-Step 3. [root@localhost ~]# cp -v dhcpd.conf.sample /etc/dhcp/dhcpd.conf

Open the DHCP configuration file and add the following

Step 4.[root@localhost ~]# vim /etc/dhcp/dhcpd.conf

#Change subnet, netmask, and range

subnet 192.168.
1.0 netmask 255.255.255.0 {
  range 192.168.
1.5 192.168.0.100;
 
#option domain-name-servers ns1.internal.example.org;
 # option domain-name "internal.example.org";
# option routers 192.168.1.1
;
  op
tion broadcast-address 192.168.1.255;
  default-lease-time 600;
  max-lease-time 7200;
}


Step 5. [root@localhost ~]# service dhcpd restart

Step 6. [root@localhost ~]# chkconfig dhcpd on

 
This is all this in DHCP server

Sunday, December 18, 2011

RPM Command in RHEL6


RPM command is used for installing, uninstalling, upgrading, querying, listing, and checking RPM packages on your Linux system.
RPM stands for Red Hat Package Manager
Syntax:-
#rpm -<option> <Package Name>
Option:-
-i = Install the Package
-v = Verbose of the process
-e = Remove the packages
-q = Query of packages
-a = queries all installed packages
-h = Shows process by histograms
-i = View information about an rpm
-U = Update a Package

Examples:-
#rpm -ivh nfs*                      Install nfs package
#rpm –e nfs*                       Remove nfs package
#rpm -q nfs*                       Query nfs package
#rpm -u nfs*                       Update nfs package

Rhel6 YUM Server Configuration


YUM SERVER Configuration

Yum is a yellow dog update manager it is a new package manager introduced by redhat with RHEL5 in year 2007 but now in RHEL6 they also have this facility to manage the packages. By using YUM we can manage the packages in many ways. YUM is always working in Server /Client environment. To configure YUM Server and Client perform the steps given below.


Server Side:--
1)Insert RHEL6 Dvd & mount it on /media directory

2) Copy dvd in /var/ftp/pub directory
#cp –rv /media/RHEL(then press tab) /var/ftp/pub

3) Create server repository in /etc/yum.repos.d/server.repo
#vim /etc/yum.repos.d/server.repo        ------Type in this   file below lines
[server]
name=server repository
baseurl=file:///var/ftp/pub/Packages
gpgcheck=0
save this file by :---> esc, shift+: wq

4) Then Goto
#cd /var/ftp/pub/Packages

5) Then Install   the   createrepo   Package with dependencies
#rpm –ivh createrepo* python-deltarpm* deltarpm*

6) Then Create Repository
#createrepo –v /var/ftp/pub/Packages

7) To check yum server
#yum list                       To check yum server

NOTE : Because YUM only can be configured either by using FTP or HTTP
For ftp you want to install the vsftpd package
# rmp -ivh vsftpd<tab>
#service vsftpd restart
#chkconfig vsftpd on

Client Side:-

1) Create client.repo file in /etc/yum.repos.d/
#vim /etc/yum.repos.d/client.repo

{press i for insert}

[client]
name=Client Repository
base=ftp://ip of server/pub/Packages
gpgcheck=0

save this file by :---> esc, shift+: wq

2) Check yum server
#yum list <PackageName>

For ftp you want to install the vsftpd package
# rmp -ivh vsftpd<tab>
#service vsftpd restart
#chkconfig vsftpd on


To Clear   Previous   Cache   and   Update   Packages---------------->
#Yum clean all
#Yum update <PackageName>

To  See all Packages:---------->
#yum  list all

To See Package Information:-------------->
#yum info <PackageName>


To Install Package :---------->               
#yum  install  <PackageName>
example:->  #yum  install nfs*

By Vinay Bisht