Upload
hardzone
View
233
Download
0
Embed Size (px)
Citation preview
8/17/2019 Rhel 6 Server
1/22
How To Install YUM Server in RHEL 6
Step By Step Confgration o Yu Server
1. mount /dev/cdrom /mnt
2 rpm -ivh /mnt/Server/Packages/vsftpd*
3. cp -rv /mnt/* /var/ftp/pub/4. rpm -ivh /mnt/Server/Packages/delta*
. rpm -ivh /mnt/Server/Packages/P!then-delta*
". rpm -ivh /mnt/Server/Packages/createrepo*
#. vi /etc/!um.repos.d/server.repo
$!um-server%
name& 'his is m! (P) store
baseurl&le+///var/ftp/pub/
enable&1
gpgcheck&,
. createrepo -v /var/ftp/pub
. rm -rf /var/ftp/pub/.olddata1,. !um clean all
11. !um update
o0 our um Server is ongured
S!MB! SER"ER
Samba Server -> It is basically used for sharing file and directory on windows and Linux machine. Using it you can share printers, files and
directories on window machine and Linux machine.
ote -> !isabled "irewall
ote -> #efore configuring the samba server first install the samba rpm pac$age from using %U& or using rhel ' !(!.
Using %um -> yum -y install samba)
------------------------------------------------------------------------------
*n Server Side
+fter installing of samba rpm, login as root and open the samba configuration file in editing mode. he configuration file is
vi etcsambasmb.conf
In etcsambasmb.conf file go to the line number / and edit it li$e that
host allow 0 123. 142.15.1
Uncomment the line and leave it.
ow go to end of file and add these lines
6est7 8 9ere 6est7 is shared filename of directory
comment 8 any thing you li$e
path0homelinux 8 9ere path is your shared directory
validuser0&ichal 8 &ichal is a user name through which you can access shared
directory on linux machine.
read list0&ichal 8 :ermission for reading directory for user &ichal
write list0&ichal 8 :ermission for writing share director for user
8/17/2019 Rhel 6 Server
2/22
#rowsable0yes 8 :ermission for browse samba share on clients end.
Save ; !isabled "irewall
ote -> "or "S rpm you must need a rhel ' !(! *= %um configure
*n your system *= an active internet connection to download
"S rpm.
If %um is configure on your system then login as a
=oot and type,
C %um -y install nfs) >If you have a rhel ' !(! then mount the !(! on any
!irectory. "or e.g., I mount a !(! on mnt directory. ow login
+s a root and type,
C rpm -ivh mntServernfs) >
ow "S pac$age is installed on your system.
"S wor$s on :ort number 2/A4tcp -- o chec$ :ort number file is etcservices
---------------------------------------------------------------------------
Server Side Donfiguration
8/17/2019 Rhel 6 Server
3/22
*n Server Side the configuration file is
C etcexports >
*pen the etcexports file in any Linux editor. I suggest you open it in
(I&.
(I etcexports
"ile is blan$. ow write in the file you want to share on the networ$ for
8/17/2019 Rhel 6 Server
4/22
et0ork information service S5 centrall! manages authentication and
identit! information such as users and pass0ords6 hosts and P addresses6 and
P7S8 groups. 'his 0as originall! called Yellow Pages 'a((reviate% Y)5 because
of its simple focus on identit! and authentication lookups.
#IS SER"ER C*#$I+UR!TI*#
Re,uire% )a&-ages
$root9server1 :esktop%; yu install yp. a-e. &a&/. 0inet% 1y
"eriy t/e installation pa&-ages
$root9server1 :esktop%; rpm -"4
nfs-utils-lib-1.1.-4.el".=">"4
nfs-utils-1.2.3-1.el".=">"4
$root9server1 :esktop%; rpm -"4
!pserv-2.1-22.el".=">"4
!pbind-1.2,.4-2.el".=">"4
$root9server1 :esktop%; rpm -"4
makebootfat-1.4-1,.el".=">"4
8/17/2019 Rhel 6 Server
5/22
$root9server1 :esktop%; rpm -"4
$root9server1 :esktop%; rpm -"4
C/e&- t/e &onfguration fle
$root9server1 :esktop%; rpm -
8/17/2019 Rhel 6 Server
6/22
$root9server1 :esktop%; !pdomainname
none5
$root9server1 :esktop%; vi 2et&2yp3&on
ypserver 7836933::
+0u+obGect>r+home>root>t+s, /home
$root9server1 :esktop%; ll -dF /nishome
dr0=r-=r-=. root root unconned>u+obGect>r+default>t+s, /nishome
$root9server1 :esktop%; &/&on ;;reeren&e 2/oe 2nis/oe 1R
$root9server1 :esktop%; ll -dF /nishome
dr0=r-=r-=. root root s!stem>u+obGect>r+home>root>t+s, /nishome
$root9server1 :esktop%; usera%% ;% 2nis/oe2nisuser nisuser
$root9server1 :esktop%; usera%% ;% 2nis/oe2nisuser8 nisuser8
8/17/2019 Rhel 6 Server
7/22
$root9server1 :esktop%; passw% nisuser
hanging pass0ord for user nisuser1.
e0 pass0ord+
HD: PDSS@7(:+ it is @D too short
HD: PDSS@7(:+ is a palindrome
(et!pe ne0 pass0ord+
pass0d+ all authentication tokens updated successfull!.
$root9server1 :esktop%; passw% nisuser8
hanging pass0ord for user nisuser2.
e0 pass0ord+
HD: PDSS@7(:+ it is @D too short
HD: PDSS@7(:+ is a palindrome
(et!pe ne0 pass0ord+
pass0d+ all authentication tokens updated successfull!.
S/are t/e #IS /oe %ire&tory
$root9server1 :esktop%; vi 2et&2e0ports
/nishome 12.1".1.,/24r06s!nc5
+0
8/17/2019 Rhel 6 Server
8/22
/nishome 12.1".1.,/24r060dela!6root>ssubtree>check5
$root9server1 :esktop%; servi&e ns start
Starting IS services+ $ 7A %
Starting IS
8/17/2019 Rhel 6 Server
9/22
$root9server1 !p%; a-e
gmake$1%+ ?ntering director! J/var/!p/nisserverK
Lpdating pass0d.b!name...
Lpdating pass0d.b!uid...
Lpdating group.b!name...
Lpdating group.b!gid...
Lpdating hosts.b!name...
Lpdating hosts.b!addr...
Lpdating rpc.b!name...
Lpdating rpc.b!number...
Lpdating services.b!name...
Lpdating services.b!servicename...
Lpdating netid.b!name...
Lpdating protocols.b!number...
Lpdating protocols.b!name...
Lpdating mail.aliases...
gmake$1%+ Meaving director! J/var/!p/nisserverK
$root9server1 !p%; 2usr2li(6
8/17/2019 Rhel 6 Server
10/22
ne=t host to add+ station3e0aple3&o
ne=t host to add+ presss &trl=%
'he current list of S servers looks like this+
server1.e=ample.com
station1.e=ample.com
s this correctN $!/n+ !% y
@e need a fe0 minutes to build the databases...
Huilding /var/!p/nisserver/!pservers...
(unning /var/!p/)akele...
gmake$1%+ ?ntering director! J/var/!p/nisserverK
Lpdating pass0d.b!name...
Lpdating pass0d.b!uid...
Lpdating group.b!name...
Lpdating group.b!gid...
Lpdating hosts.b!name...
Lpdating hosts.b!addr...
Lpdating rpc.b!name...
Lpdating rpc.b!number...
Lpdating services.b!name...
Lpdating services.b!servicename...
Lpdating netid.b!name...
Lpdating protocols.b!number...
Lpdating protocols.b!name...
Lpdating mail.aliases...
8/17/2019 Rhel 6 Server
11/22
gmake$1%+ Meaving director! J/var/!p/nisserverK
server1.e=ample.com has been set up as a S master server.
o0 !ou can run !pinit -s server1.e=ample.com on all slave server.
$root9server1 :esktop%; servi&e yppassw%% start
Starting P pass0d service+ $ 7A %
$root9server1 :esktop%; servi&e yp(in% start
Starting S service+ $ 7A %
Hinding S service+ . $ 7A %
$root9server1 :esktop%; servi&e yp0r% start
Starting P map server+ $ 7A %
$root9server1 :esktop%; servi&e 0inet% start
Starting =inetd+ $ 7A %
$root9server1 :esktop%; &/-&onfg yppassw%% on
$root9server1 :esktop%; &/-&onfg yp(in% on
$root9server1 :esktop%; &/-&onfg yp0r% on
$root9server1 :esktop%; &/-&onfg 0inet% on
8/17/2019 Rhel 6 Server
12/22
#IS CLIE#T C*#$I+UR!TI*#
Re,uire% pa&-ages
$root9station1 :esktop%; rpm -"4
!pbind-1.2,.4-2.el".=">"4
$root9station1 :esktop%; aut/&onfg;tui
8/17/2019 Rhel 6 Server
13/22
heck mark $*% Lse S O e=t O:omain $nisserver% O 7A
Server $12.1".1.1,,%
$root9station1 :esktop%; vi 2et&2auto3aster
2nis/oe 2et&2auto3is&
auto.master
+0
8/17/2019 Rhel 6 Server
14/22
$nisuser29station1 Q%R logout
$nisuser19station1 Q%R logout
$root9station1 :esktop%; reboot
How to install lan card driver in Linux
Most Linux drives come in zip format. You can extract them with tar utility. You can obtain LAN
driver directly from manufactures sites or form other media like motherboard C.
!e assume that you have LAN driver and copied it in your root directory.
"xtract driver file with tar utility and chan#e directory to extracted folder
"very LAN driver have a readme file tellin# the way to install that driver
$ Note%& driver will compile only if you have proper compiler' we recommended that you install
#cc compiler durin# installation. (
http://computernetworkingnotes.com/network-administrations/how-to-install-lan-card-driver-in-linux-location-of-networking-files-and-descriptions.htmlhttp://computernetworkingnotes.com/network-administrations/how-to-install-lan-card-driver-in-linux-location-of-networking-files-and-descriptions.html
8/17/2019 Rhel 6 Server
15/22
)o install driver execute these commands as shown here or use readme files
Now we are #ivin# you the location of some important network confi#urations file cram these
files
2et&2resolv3&on
)his file contain information about N* server. you can set N* ip in this files. "ach
nameserver line represents a N* server' and the search line specifies domain names to try if
only the first part of a hostname is used.
2et&2o%pro(e3&on
)he first line assi#ns the e+,, kernel module to the eth, network device. -f the network card is
supported' the module is automatically confi#ured durin# installation or by udzu the first time
the system is booted with the new card.
8/17/2019 Rhel 6 Server
16/22
2et&2/osts
file lists -/ addresses and hostnames that should resolve to the -/ addresses. )he first one listed'
+01.,.,.+' is referred to as the loopback interface and should never be removed. -f some
hostnames can not be resolved by the N* servers' list them with their -/ addresses after the
loopback device.
2et&2sys&onfg2networ-ing2%evi&es
2ile contain the list of all detected and install LAN card. )his is the location of all networkin#
scripts. you can create new virtual LAN card in this directory. even you can chan#e -/
confi#urations and default bootin# behavior of LAN card by directly editin# in files.
2et&2sys&onfg2networ-
)his file is mostly used to chan#e hostname permanently. -f the N")!34-N5 option is set to
yes' the networkin# subsystem is enabled but not necessarily started at boot time. )he value of
the 63*)NAM" option is the hostname for the system. -f one is not set' the default hostname is
localhost. 4efer to the file 7usr7share7doc7initscripts&8version97sysconfi#.txt for additional
options for this file.
8/17/2019 Rhel 6 Server
17/22
2et&2sys&onfg2networ-;s&ripts2
-n the 7etc7sysconfi#7network&scripts7 directory' each network device has its own confi#uration
file with the filename ifcf#&8devicename9 such as ifcf#ð, for the first "thernet device. -f the
device is confi#ured for a static -/ address' the interface confi#uration file looks similar to ima#e
#iven below. -f the 3N:33) option is set to yes' the device is activated at boot time usin# the
network initialization script.
File Descriptions
7etc7modprobe.conf Assi#ns a kernel module to each network device.
7etc7sysconfi#7network *ets the hostname and whether the networkin# is enabled. -/v; isenabled or disabled in this file.
7etc7hosts Lists hosts and their -/ addresses for hostnames that can
8/17/2019 Rhel 6 Server
18/22
How to configure IP address in Linux
"very node participatin# in networkin# needs a valid -/ address. 3n Linux command prompt -/
address is assi#ned by a network confi#uration window. )his window can be invoked by
selectin# network configuration sub menu form setup command or directly executin# system-
config-network commands.
4un setup command form root user
#setup
this will launch a new window select network configuration
now a new window will show you all available LAN card select your LAN card $ if you don=t
see any LAN card here mean you don=t have install driver(
http://computernetworkingnotes.com/network-administrations/basic-networking-commands.htmlhttp://computernetworkingnotes.com/network-administrations/basic-networking-commands.html
8/17/2019 Rhel 6 Server
19/22
assi#n -/ in this box and click ok
click on ok' >uit and a#ain >uit to come back on root prompt.
Alternately you can use system-config-network command directly to invoke this setup window
#system-config-network
whatever chan#e you made in network confi#uration will not take place till you restart the LAN
card
#service network restart
8/17/2019 Rhel 6 Server
20/22
i&onfg
)he ifconfig command will display the confi#uration of all active "thernet card. !ithout
specifyin# any parameter this command will show all active "thernet card. if you want to see the
confi#uration of any specific "thernet card then use the name of that card as the command line
ar#uments. for example to show the -/ confi#uration on loop back -nterface execute this
command
#ifconfig lo
iup2i%own
8/17/2019 Rhel 6 Server
21/22
"ach installed network adapter has a correspondin# ifcfg-* file in /etc/sysconfig/network-
scripts You can activate or deactivate that adapter with the ifup and ifdown commands. "ither of
the followin# commands will activate the eth, network adapter%
#ifup ifcfg-eth0 #ifup eth0
netstat
)he netstat pro#ram provides real&time information on the status of your network connections' as
well as network statistics and the routin# table. )he netstat command has several options you can
use to brin# up different sorts of information about your network.
arp
)he Address 4esolution /rotocol associates the hardware address of a network adapter with an
-/ address. )he arp command $in the 7sbin directory( displays a table of hardware and -/
addresses on the local computer. !ith arp' you can detect problems such as duplicate addresses
on the network' or you can manually add arp entries as re>uired.
ii;tool
mii&tool command is used to check the link is activated or not. Most use of mii&tool command is
to check to physical link of "thernet card on command line. !ith this command you can check
on command prompt that cable is plu##ed in LAN card or not.
ping
pin# command is used to check the physical connectivity. -f you #et reply mean everythin# is ok.
-f you #et re>uest time out response means there is some problem it could be unplu##ed cable
power off switch or enabled firewall on destination node. -f you #et estination host unreachable
means remote node is not in your network. !se "#$L%" to a&ort t'e ping se(uence
8/17/2019 Rhel 6 Server
22/22
servi&e networ- restart
!hatever chan#e you made in network confi#uration files will not take place until you restart the
network services. )o implement chan#e this command is used.