0% found this document useful (0 votes)
152 views48 pages

Sam

The document discusses Redhat Enterprise Linux Server configuration. It provides steps to configure Yum package management, install packages, create repositories, and perform remote package installation. It also discusses DNS and DHCP server configuration on the primary and secondary servers, and client-side configuration.

Uploaded by

Janaki Raman
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
152 views48 pages

Sam

The document discusses Redhat Enterprise Linux Server configuration. It provides steps to configure Yum package management, install packages, create repositories, and perform remote package installation. It also discusses DNS and DHCP server configuration on the primary and secondary servers, and client-side configuration.

Uploaded by

Janaki Raman
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 48

RedhatEnterpriseLinuxServerConfiguration

YumPackageConfiguration Step1: copyallpackagesfromallcd'stoanylocation #mount/dev/cdrom/mnt #cpvr/mnt/Server/var/ftp/pub #eject Step2: installcreatereporpm #rpmivh/var/ftp/pub/Server/createrepo0.4.42.noarch.rpm Step3: createyumdatabase #createrepog/var/ftp/pub/Server/repodata/compsrhel5server core.xml/var/ftp/pub/Server/ #rmrf/var/ftp/pub/Server/.olddata #createrepog/var/ftp/pub/Server/repodata/compsrhel5server core.xml/var/ftp/pub/Server/ Step4: createyumrepositoryfilein/etc/yum.repos.d/directory #vim/etc/yum.repos.d/sample.repo [Server] name=serverpackages baseurl=file:///var/ftp/pub/Server gpgcheck=0 Step5: cleanyumcacheandlistallpackages #yumcleanall #yumlistall Remotepackageinstallconfiguration Client: Step1: createyumrepositoryfile #vim/etc/yum.repos.d/sample.repo [Server] name=serverpackages baseurl=ftp://192.168.0.10/pub/Server gpgcheck=0 Step2: cleanyumcacheandlistallpackages #yumcleanall #yumlistall Install,RemoveandListPackagesUsingYum List: Listinstalledpackages #yumlistinstalled Listavailablei.enotinstalledpackages #yumlistavailable Listinstalledandavailablepackages #yumlistall GroupList: #yumgrouplistall #yumgrouplistavailable #yumgrouplistinstalled

Install: installsinglepackage #yuminstallvimX11 GroupInstall: #yumgroupinstallWebServer Remove: removesinglepackage #yumremovevimX11 GroupRemove: #yumgroupremoveWebServer QueryPackages Packageusage: #yuminfopackagename SearchingFiles: #yumwhatprovidesfilename DNSServerConfiguration PrimaryDNSServer

Serverside Step1: #yuminstallbindbindchrootbindutils Step2: creatednsconfigurationfilein/var/named/chroot #vim/var/named/chroot/etc/named.conf optional{ directory/var/named; }; zoneleena.com{ typemaster; fileleena.com.db; }; zone0.168.192.inaddr.arpa{ typemaster; file192.168.0.db; }; Step3: checkSyntaxofconfigurationfile #namedcheckconft/var/named/chroot Step4: createzoneforwardlookupzonefileunder/var/named/chroot #vim/var/named/chroot/var/named/leena.com.db $TTL86400 @[email protected].( 1;serialno 10M;slaverefreshinterval 10M;slaveretryinterval 1W;expireinterval 1D);Minimumttl @INNSsystem1.leena.com. @INA192.168.0.10 system1IN A sys1 IN A sys2 IN A 192.168.0.10 192.168.0.1 192.168.0.2

Step5: checksyntaxofforwardlookupzonefile #namedcheckzoneleena.com./var/named/chroot/var/named/leena.com.db Step6: createzonereverselookupzonefileunder/var/named/chroot #vim/var/named/chroot/var/named/leena.com.db $TTL86400 0.168.192.INADDR.ARPA.INSOAsystem1.leena.com. [email protected].( 1;serialno 10M;slaverefreshinterval 10M;slaveretryinterval 1W;expireinterval 1D);Minimumttl @INNSsystem1.leena.com. 10.0.168.192.INADDR.ARPA.INPTRsystem1.leena.com. 1IN PTR sys1.leena.com. 2IN PTR sys2.leena.com. Step7: checksyntaxofreverselookupzonefile #namedcheckzoneleena.com./var/named/chroot/var/named/192.168.0.db Step8: adddnsserverentryin/etc/resolv.conf searchleena.com nameserver192.168.0.10 Step9: startthenamedserviceandloadrecords #chkconfignamedon #servicenamedstart #rndcreload Step10: checkthednsresolvation #nslookupleena.com;nslookup192.168.0.10 ClientSide: Step1: adddnsserverentryin/etc/resolv.conf searchleena.com nameserver192.168.0.10 Step2: checkthednsresolvation #nslookupleena.com;nslookup192.168.0.10

SecondaryDNSServer System2 Step1: #yuminstallbindbindchrootbindutils Step2: creatednsconfigurationfilein/var/named/chroot #vim/var/named/chroot/etc/named.conf optional{ directory/var/named; }; zoneleena.com{ typeslave; masters{192.168.0.10;}; fileslaves/leena.com.db; }; Step3: checkSyntaxofconfigurationfile #namedcheckconft/var/named/chroot System1 Step4: addtheslaveserverentryinmasterdnsserver #vim/var/named/chroot/var/named/leena.com.db $TTL86400 @[email protected].( 1;serialno 10M;slaverefreshinterval 10M;slaveretryinterval 1W;expireinterval 1D);Minimumttl @INNSsystem1.leena.com. @INA192.168.0.10 @INNSsystem2.leena.com. system2INA192.168.0.20 system1IN A 192.168.0.10 sys1 IN A 192.168.0.1 sys2 IN A 192.168.0.2 Step5: checksyntaxofforwardlookupzonefile #namedcheckzoneleena.com./var/named/chroot/var/named/leena.com.db Step6: startthenamedserviceandloadrecords #servicenamedrestart #rndcreload system2: Step7: adddnsserverentryin/etc/resolv.conf searchleena.com nameserver192.168.0.20 Step8: startthenamedserviceandloadrecords #chkconfignamedon #servicenamedstart #rndcreload Step9: checkthednsresolvation

#nslookupleena.com ClientSide: Step10: adddnsserverentryin/etc/resolv.conf searchleena.com nameserver192.168.0.20 Step11: checkthednsresolvation #nslookupleena.com #nslookup192.168.0.20 ForwardDNSServer system3: #yuminstallbindbindchrootbindutils Step1: creatednsconfigurationfilein/var/named/chroot #vim/var/named/chroot/etc/named.conf optional{ directory/var/named; }; zoneleena.com{ typeforward; forwarders{192.168.0.10;}; }; Step2: checkSyntaxofconfigurationfileandstarttheservice #namedcheckconft/var/named/chroot #chkconfignamedon #servicenamedrestart;rndcreload allowquery: FromMasterorSlaveDNStoClientforresolvation system1: allowsys2toresolvednsentries Step1: #vim/var/named/chroot/etc/named.conf aclfriend{192.168.0.1;}; options{ directory/var/named; }; zoneleena.com{ typemaster; fileleena.com.db; allowquery{friend;}; }; Step2: restarttheserviceandchecktheresolvation #servicenamedrestart #rndcreload allowtransfer: FromMastertoSlaveDNStotransferzoneentries system1: allowsystem2totransferzoneentries Step1: #vim/var/named/chroot/etc/named.conf AccessControllistInDNS

aclslaveserver{192.168.0.20;}; options{ directory/var/named; }; zoneleena.com{ typemaster; fileleena.com.db; allowtransfer{slaveserver;}; }; Step2: restarttheserviceandchecktheresolvation #servicenamedrestart #rndcreload allowrecursion: Fromforwarddnsservertoclientforresolvation system3: allowsystem2totransferzoneentries Step1: #vim/var/named/chroot/etc/named.conf aclclient{192.168.0.3;}; options{ directory/var/named; }; zoneleena.com{ typeforward; forwarders{192.168.0.10;}; allowrecursion{client;}; }; Step2: restarttheserviceandchecktheresolvation #servicenamedrestart #rndcreload DHCP system1: Step1: installdhcppackage #yuminstalldhcp Step2: copysampleconfigurationfileto/etc/dhcpd.conf #cp/usr/share/doc/dhcp3.0.5/dhcpd.conf.sample/etc/dhcpd.conf Step3: editdhcpconfigurationfile #vim/etc/dhcpd.conf ddnsupdatestylenone; subnet192.168.0.0netmask255.255.255.0{ optionrouters192.168.0.10; optionsubnetmask255.255.255.0; optiondomainname"leena.com"; optiondomainnameservers192.168.0.10; defaultleasetime21600; maxleasetime43200; range192.168.0.1192.168.0.20; # hoststation1{ # hardwareethernet00:a0:cc:3c:80:c5; # fixedaddress192.168.0.1;

# } } Step4: startdhcpservice #chkconfigdhcpdon #servicedhcpdstart ClientSide: Step5: enabledhcpinclientside #neattui #servicenetworkrestart Step6: checktheipaddressofmachine #ifconfig DynamicDNS system1: Step1: generatednssecuritykey #dnsseckeygenahmacmd5b512nHOST/root/sample itcreatestwofilestheyare K%2Froot%2Fdns%2Fsample.+157+34209.key K%2Froot%2Fdns%2Fsample.+157+34209.private insertkeyinnamed.conffile #catK%2Froot%2Fdns%2Fsample.+157+34209.private>> /var/named/chroot/etc/named.conf Beforechanging: Step2: #vim/var/named/chroot/etc/named.conf options{ directory/var/named; }; zoneleena.com{ typemaster; fileleena.com.db; }; Privatekeyformat:v1.2 Algorithm:157(HMAC_MD5) Key:kvoh9N29HICRNt6awesddKFH4x3aczaEgT Afterchanging: #vim/var/named/chroot/etc/named.conf keysample{ algorithmhmacmd5; secret kvoh9N29HICRNt6awesddKFH4x3aczaEgT }; options{ directory/var/named; }; zoneleena.com{ typemaster; fileslaves/leena.com.db; allowupdate{any;}; };

Step3: Addkeyindhcpd.conffile #vim/etc/dhcpd.conf ddnsupdatestylenone; keysample{ algorithmhmacmd5; secretkvoh9N29HICRNt6awesddKFH4x3aczaEgT }; subnet192.168.0.0netmask255.255.255.0{ optionrouters192.168.0.10; optionsubnetmask255.255.255.0; optiondomainname"leena.com"; optiondomainnameservers192.168.0.10; defaultleasetime21600; maxleasetime43200; range192.168.0.1192.168.0.20; # hoststation1{ # hardwareethernet00:a0:cc:3c:80:c5; # fixedaddress192.168.0.1; # } } Step4: startdhcpandnamedservice #servicenamedrestart #rndcreload #servicedhcpdrestart ClientSide: Step5: Editdhclienteth0.conf #vim/etc/dhclienteth0.conf sendhostnamesys11; Step6: enabledhcpinclientside #neattui #servicenetworkrestart Step7: checktheipaddressofmachine DHCPReservation Clientside: CheckthemacaddressofEthernetcard #ifconfigeth0 system1: Step1: installdhcppackage #yuminstalldhcp Step2: copysampleconfigurationfileto/etc/dhcpd.conf #cp/usr/share/doc/dhcp3.0.5/dhcpd.conf.sample/etc/dhcpd.conf Step3: editdhcpconfigurationfile #vim/etc/dhcpd.conf ddnsupdatestylenone; subnet192.168.0.0netmask255.255.255.0{ optionrouters192.168.0.10;

optionsubnetmask255.255.255.0; optiondomainname"leena.com"; optiondomainnameservers192.168.0.10; defaultleasetime21600; maxleasetime43200; range192.168.0.1192.168.0.20; hostsys11{ #entertheclientmachinemacaddressex.00.a0.cc.3c.80.c5 hardwareethernet00:a0:cc:3c:80:c5; fixedaddress192.168.0.11; } } Step4: startdhcpservice #chkconfigdhcpdon;servicedhcpdstart Sys11: Step5: enabledhcpinclientside #neattui #servicenetworkrestart Step6: checktheipaddressofmachine DHCPRelayServer System1: Step1: installdhcppackage #yuminstalldhcp Step2: copysampleconfigurationfileto/etc/dhcpd.conf #cp/usr/share/doc/dhcp3.0.5/dhcpd.conf.sample/etc/dhcpd.conf Step3: editdhcpconfigurationfile #vim/etc/dhcpd.conf ddnsupdatestylenone; sharednetworksample{ optionrouters192.168.0.10; optionsubnetmask255.255.255.0; optiondomainname"leena.com"; optiondomainnameservers192.168.0.10; defaultleasetime21600; maxleasetime43200; subnet192.168.0.0netmask255.255.255.0{range192.168.0.1 192.168.0.20;} subnet10.0.0.0netmask255.0.0.0{range10.0.0.110.0.0.20;} } Step4: CreatealiasEthernetdeviceandassignip10.0.0.10 #yuminstallnetconfig #netconfigdeth0:1 #servicenetworkrestart Step5: startdhcpservice #chkconfigdhcpdon #servicedhcpdstart

ClientSide: Step6: enabledhcpinclientside #neattui #servicenetworkrestart Step7: checktheipaddressofmachine Apacheconfiguration system1: Step1: Configuredns Step2: Installhttppackages #yuminstallhttpd Step3: Createhtmlfile #vim/var/www/html/main.html <html> <head><title>SampleWebPage</title></head> <body> <fontsize=40color=FF0000> <marquee>ThisisHomePageofLeena.com</marquee> </font></body></html> Step4: Addhtmlpagetohttpconfigurationfile #vim/etc/httpd/conf/httpd.conf Lineno:390 DirectoryIndexmain.htmlindex.htmlindex.html.var Step5: restartthehttpservice #chkconfighttpdon #servicehttpdrestart sys1: adddnsentriesin/etc/resolv.conf #vim/etc/resolv.conf searchleena.com nameserver192.168.0.10 Step6: openfirefoxandtypethefollowingurlinaddressbar http://system1.leena.com ApacheAuthentication system1: Step1: Configuredns Step2: Installhttppackages #yuminstallhttpd Step3: Createhtmlfile #vim/var/www/html/main.html <html> <head><title>SampleWebPage</title></head> <body> <fontsize=40color=FF0000>

<marquee>ThisisHomePageofLeena.com</marquee> </font></body></html> Step4: Addhtmlpagetohttpconfigurationfile #vim/etc/httpd/conf/httpd.conf Lineno:326 AllowOverrideAuthConfig Lineno:390 DirectoryIndexmain.htmlindex.htmlindex.html.var Step5: create.htaccessfileindocumentrootofwebpage #vim/var/www/html/.htaccess AuthNameRestrictedWebSite AuthTypeBasic AuthUserFile/etc/httpd/conf/.htpasswdsystem1 requirevailduser Step6: changegroupandpermissionsofthefile #chgrpapache/var/www/html/.htaccess #chmod640/var/www/html/.htaccess Step7: create.htpasswdfile #htpasswdmc/etc/httpd/conf/.htpasswdsystem1user1 #htpasswdm/etc/httpd/conf/.htpasswdsystem1user2 Step8: restartthehttpservice #chkconfighttpdon #servicehttpdrestart sys1: Step9: adddnsentriesin/etc/resolv.conff #vim/etc/resolv.conf Step10: openfirefoxandtypethefollowingurlinaddressbar http://system1.leena.com System1: Step1: installmod_sslandhttpdpackage #yuminstallhttpdmod_ssl Step3: Createhtmlfile #vim/var/www/html/main.html <html> <head><title>SampleWebPage</title></head> <body> <fontsize=40color=FF0000> <marquee>ThisisHomePageofLeena.com</marquee> </font></body></html> Step4: Addhtmlpagetohttpconfigurationfile #vim/etc/httpd/conf/httpd.conf Lineno:390 DirectoryIndexmain.htmlindex.htmlindex.html.var Lineno:lastline ApacheEncryptedWebServer

SSLEngineon SSLCertificateFile/etc/pki/tls/certs/localhost.crt SSLCertificateKeyFile/etc/pki/tls/private/localhost.key thesethreeentriesarespecifiedin/etc/httpd/conf.d/ssl.conf Lineno:95 Lineno:112 Lineno:119 Step5: restartthehttpservice #chkconfighttpdon #servicehttpdrestart sys1: adddnsentriesin/etc/resolv.conf #vim/etc/resolv.conf searchleena.com nameserver192.168.0.10 Step10: openfirefoxandtypethefollowingurlinaddressbar http://system1.leena.com theerroroccursthentypetheurl #https://system1.leena.com Apachevirtualhostingconfiguration Hostbasedvirtualhosting: system1: Step1: addhosttheentriesindns #cat>>/var/named/chroot/var/named/leena.com.db wwwINCNAMEsystem1.leena.com mailINCNAMEsystem1.leena.com <control+d> reloadthednsentries #rndcreload Step2: Installhttppackages #yuminstallhttpd Step3: Createhtmlfiles #vim/var/www/html/main.html <html> <head><title>SampleWebPage</title></head> <body><fontsize=40color=FF0000> <marquee>ThisisHomePageofLeena.com</marquee> </font></body></html> #mkdir/var/www/mail #vim/var/www/mail/mail.html <html> <head><title>SampleWebPage</title></head> <body><fontsize=40color=00FF00> <marquee>WelcomeMailPageofLeena.com</marquee> </font></body></html> Step4: Addhtmlpagetohttpconfigurationfile #vim/etc/httpd/conf/httpd.conf

Lineno:390 DirectoryIndexmail.htmlmain.htmlindex.htmlindex.html.var Lineno:998orLast NameVirtualHost192.168.0.10:80 <VirtualHost192.168.0.10:80> Servernamewww.leena.com. DocumentRoot/var/www/html </VirtualHost> <VirtualHost192.168.0.10:80> Servernamemail.leena.com. DocumentRoot/var/www/mail </VirtualHost> Step5: restartthehttpservice #servicehttpdrestart sys1: adddnsentriesin/etc/resolv.conf #vim/etc/resolv.conf searchleena.com nameserver192.168.0.10 Step6: openfirefoxandtypethefollowingurlinaddressbar http://www.leena.com http://mail.leena.com IPbasedvirtualhosting: system1: Step1: createethernetaliasipaddressis10.0.0.10 #netconfigdeth0:1 #servicenetworkrestart addhosttheentriesindns #cat>>/var/named/chroot/var/named/leena.com.db songsINA10.0.0.10 <control+d> reloadthednsentries #rndcreload Step2: Installhttppackages #yuminstallhttpd Step3: Createhtmlfiles #mkdir/var/www/songs #vim/var/www/mail/songs.html <html> <head><title>SampleWebPage</title></head> <body><fontsize=40color=0000FF> <marquee>WelcometoSongsPageofLeena.com</marquee> </font></body></html> Step4: Addhtmlpagetohttpconfigurationfile #vim/etc/httpd/conf/httpd.conf Lineno:390 DirectoryIndexsongs.htmlmail.htmlmain.htmlindex.html Lineno:998orLast

NameVirtualHost192.168.0.10:80 <VirtualHost192.168.0.10:80> Servernamewww.leena.com. DocumentRoot/var/www/html </VirtualHost> <VirtualHost192.168.0.10:80> Servernamemail.leena.com. DocumentRoot/var/www/mail </VirtualHost> NameVirtualHost10.0.0.10:80 <VirtualHost10.0.0.10:80> Servernamesongs.leena.com. DocumentRoot/var/www/songs </VirtualHost> Step5: restartthehttpservice #servicehttpdrestart sys1: adddnsentriesin/etc/resolv.conff #vim/etc/resolv.conf Step6: openfirefoxandtypethefollowingurlinaddressbar http://www.leena.com http://mail.leena.com http://songs.leena.com ApacheCGIScripts system1: Step1: enablethecgibinentriesinhttpd.conffile #vim/etc/httpd/conf/httpd.conf Lineno:563 ScriptAlias/cgibin//var/www/cgibin Step2: createcgibinscript #vim/var/www/cgibin/sample.sh #!/bin/bash echoContentType:text/html echo echo<pre> echoMyUsernameis whoami echo echoMyidis id echo echoMyshellsettingsare set echo echo</pre> Step3: changepermissionsofthecgiscript #chmod777/var/www/cgibin/sample.sh restartthehttpservice #servicehttpdrestart

sys1: Step4: openfirefoxandtypethefollowinglineinaddressbar http://system1.leena.com/cgibin/sample.sh SquidProxyServer System1: Step1: install,configureandstartthehttpdservice installsquidpackages #yuminstallsquid Step2: editsquid.conffile #vim/etc/squid/squid.conf Lineno:73 http_port1324 Lineno:2395addthefollowingentries aclsamplesrc192.168.0.1 aclenemysrc192.168.0.11 Lineno:2505addtheentries http_accessallowsample http_accessdenyenemy Step3: startthesquidservice #chkconfigsquidon #servicesquidstart sys1: Step4: openfirefoxclickedit>preferences>connectionsettings choosemanualproxyconfiguration httpproxy:192.168.0.10port:1324 clickokandtypetheurlinaddressbar http://system1.leena.com. sys11 Step5: openfirefoxclickedit>preferences>connectionsettings choosemanualproxyconfiguration httpproxy:192.168.0.10port:1324 clickokandtypetheurlinaddressbar http://system1.leena.com. MailServer Serverside: System4: Step1: installandconfiguredns #yuminstallbindbindchrootbindutils Step2: creatednsconfigurationfilein/var/named/chroot #vim/var/named/chroot/etc/named.conf optional{ directory/var/named; }; zonepriya.com{ typemaster; filepriya.com.db;

}; Step3: createzoneforwardlookupzonefileunder/var/named/chrootandadd MX recordinthiszone #vim/var/named/chroot/var/named/leena.com.db $TTL86400 @[email protected].( 1;serialno 10M;slaverefresh 10M;slaveretryinterval 1W;expireinterval 1D);Minimumttl @INNSsystem4.priya.com. @INMX10system4.priya.com @INA192.168.0.40 system4IN A sys4 IN A sys44 IN A 192.168.0.40 192.168.0.4 192.168.0.44

Step4: adddnsserverentryin/etc/resolv.conf searchpriya.com nameserver192.168.0.40 Step5: startthenamedserviceandloadrecords #chkconfignamedon #servicenamedstart #rndcreload Step6: checkthednsresolvation #nslookuppriya.com #nslookup192.168.0.40 #hosttMXpriya.com SendmailServer System4: Step1: installpackages #yuminstallsendmailsendmailcfsendmaildoc Step2: editconfigurationfile #vim/etc/mail/sendmail.mc Lineno:116(disabletheline)thatis dnl#DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1,Name=MTA)dnl Lineno:160 MASQUERADE_AS(`priya.com) Lineno:164 FEATURE(masquerade_envelope)dnl Lineno:168 FEATURE(masquerade_entire_domain)dnl #vim/etc/mail/localhostnames priya.com system4.priya.com

system4 Step3: restartthesendmailservice #chkconfigsendmailon #servicesendmailrestart Step4: sendmailtouser #[email protected] samplemail . cc: InboundMail(TochangetheToaddressforsending) System4: Step1: #vim/etc/mail/sendmail.mc Lineno:79 FEATURE(`virtusertable',`hasho/etc/mail/virtusertable.db')dnl Step2: editvirtusertablefile #vim/etc/mail/virtusertable [email protected] [email protected] Step3: restartthesendmailservice #servicesendmailrestart Step4: #[email protected] samplemailforvirtualusertable . cc: Step5: #suuser1 $mail $exit #supriya $mail OutboundMail(TochangetheFromaddressforsending) System4: Step1: addthefollowingentriesinsendmail.mcfile #vim/etc/mail/sendmail.mc Lineno:104 FEATURE(genericstable)dnl FEATURE(`always_add_domain')dnl GENERICS_DOMAIN_FILE(`/etc/mail/localhostnames')dnl Step2: #hostnamesystem4.priya.com editgenericstablefile #vim/etc/mail/genericstable [email protected] [email protected] Step3: addthehostnameentriesinlocalhostnamesfile #vim/etc/mail/localhostnames

priya.com system4.priya.com system4 Step4: restartthesendmailservice #servicesendmailrestart Step5: Fromuser1tosendamailtoanotheruser [email protected] samplemailforgenericsusertable . cc: Step6: checkrootmails #mail SMTPRestrictions Step1: editsendmail.mcfile #vim/etc/mail/sendmail.mc Lineno:102 FEATURE(`blacklist_recipients')dnl Step2: addentriesinaccessfile #vim/etc/mail/access Lineno:last From:[email protected] REJECT To:[email protected] OK Connect:sys44 OK Step3: restartthesendmailservice #servicesendmailrestart sys4: Step4: adddnsentry #vim/etc/resolv.conf searchpriya.com nameserver192.168.0.40 Step5: testtherestrictionsfromsys4 #echotestemail|[email protected] theemailwillnotsend PostfixServer Step1: installpostfixpackages #yuminstallpostfix switchthepostfixmtaformail #alternativesconfigmta selectpostfixandstoptheservice #servicesendmailstop Step2: editpostfixconfigurationfile #vim/etc/postfix/main.cf Lineno:69

myhostname=station4.priya.com Lineno:77 mydomain=priya.com Lineno:93 myorigin=$mydomain Lineno: mydestination=$myhostname,localhost.$mydomain,localhost,$mydomain Lineno:last masquerade_exceptions=root Step3: Restartthepostfixservice #chkconfigpostfixon #servicepostfixrestart #netstattulpn|grepmaster Step4: Sendemailtouser #[email protected] Subject:testemail Samplemailfromuserroot . Cc: Step5: Loginasmanchecktheemail #suman $mail InboundMail Step1: Edittheconfigurationfile #vim/etc/postfix/main.cf Lineno:last virtual_alias_maps=hash:/etc/postfix/virtual Step2: Editvirtualfile #vim/etc/postfix/virtual Lineno:last [email protected] [email protected] Step3: Restartthepostfixandreloadvirtualfile #servicepostfixrestart #postmap/etc/postfix/virtual Step4: Sendemailtomanuserthatemailissendtosanuser #echovirtualusertablemailtesting|mailstest [email protected] Step5: Loginassanandcheckmail #susan $mail OutboundMail Step1: Edittheconfigurationfile #vim/etc/postfix/main.cf Lineno:last smtp_generic_maps=hash:/etc/postfix/generic

Step2: Editvirtualfile #vim/etc/postfix/generic Lineno:last [email protected]@priya.com Step3: Restartthepostfixandreloadvirtualfile #servicepostfixrestart #postmap/etc/postfix/generic Step4: Addtheleena.comdnsentriesinSystem4 #vim/etc/resolv.conf searchpriya.comleena.com nameserver192.168.0.40 nameserver192.168.0.10 System1: Addthepriya.comdnsentriesinSystem1 #vim/etc/resolv.conf searchpriya.comleena.com nameserver192.168.0.10 nameserver192.168.0.40 Sendemailfromleena.comthatissystem1userisroot #[email protected]|[email protected] System4: Step5: Loginasrootfromsystem4andcheckthemail #mail Postfixsmtprestariction Step1: editthemain.cffile #vim/etc/postfix/main.cf Lineno:Last smtpd_client_restrictions=check_client_access hash:/etc/postfix/access Step2: edittheaccessfile #vim/etc/postfix/access Lineno:Last 192.168.0.4 REJECT Step3: restartthepostfixserviceandreloadtheaccessfile #postmap/etc/postfix/access #servicepostfixrestart sys4: Step4: sendmailtosystem4 #mailssamplev [email protected] sampleemailforaccesstesting cc: Step5: theemailisreturnedtothesender checkthemailforrootuserfromsys4 Step1: ProcmailConfiguration

installandconfiguresendmailorpostfixandinstallprocmail #yuminstallprocmail Step2: edittheprocmailconfigurationfile #vim/etc/procmailrc LOGFILE=/var/spoll/mail/procmail.log VERBOSE=yes :0c *^Subject.*rhce /var/spool/mail/procmail.test #whichprocmail #chmodg+s/usr/bin/procmail Step3: Postfixprocmailconfiguration #vim/etc/postfix/main.cf mailbox_command=/usr/bin/procmaill (or) Sendmailprocmailconfiguration #vim/etc/mail/sendmail.mc Lineno:175 MAILER(procmail)dnl Step4: restartthesendmailorpostfixservice #servicesendmailrestart(or) #servicepostfixrestart Step5: createaemptyfileandchangethepermission #touch/var/spool/mail/procmail.test #chgrpmail/var/spool/mail/procmail.test #chown770/var/spool/mail/procmail.test Step6: sendemailtoanyusersubjectisrhce #[email protected] Subject:rhce sampleemailforprocmailtesting cc: Step6: checktheemailformanuser #suman $muttf/var/spool/mail/procmail.test Dovecotconfiguration Dovecotisusedforimapandpop3configuration Step1: installandconfiguresendmailorpostfix Step2: installthedovecot #yuminstalldovecot Step3: editthedovecot.conffile #vim/etc/dovecot.conf enablethefollowinglines Lineno:17 protocols=imapimapspop3pop3s Lineno:87 ssl_cert_file=/etc/pki/dovecot/certs/dovecot.pem

Lineno:88 ssl_key_file=/etc/pki/dovecot/private/dovecot.pem

Step4: restartthesendmailorpostfixanddovecot #servicepostfixrestart #chkconfigdovecoton #servicedovecotrestart #netstattulpn|grepdovecot Sys4: Step5: #muttfimap://[email protected] #muttfimaps://[email protected] #muttfpop://[email protected] #muttfpops://[email protected] Graphicalmailclientconfiguraion Usingtheevolutionorthunderbird sys4: Step1: installthethunderbirdpackage mountthepackagelocationfromserver #mount192.168.0.254:/Client/Client//mnt #rpmivhthunderbird1.5.0.96.el5.i386.rpmnodeps Step2: #thunderbird(or) Applications>Internet>Thunderbird Step3: configurationinthunderbird clickemailaccount>yourname:newemailaddress:[email protected] selectimaporpop3andenterthefollowingdetails>next incomingserver:priya.com outgoingserver:priya.com Incomingusername:new Accountname:[email protected] clicknext>finish enterthepasswordfornew checktheemailfornewuser Spammail system4: Step1: installspampackages #yuminstallspamassassin Step2: restartthespamservice #chkconfigspamassassinon #servicespamassassinrestart sys4: Step3: installandconfiguresendmailorpostfixandthunderbirdor evolution Step4: addspamfiltersinthunderbird ToolsMessageFiltersFiltername:filter1 Subjectcontains:hai Movemessageto:[email protected]

clickok step5: #[email protected] Subject:hai samplemail cc: thisisemailismovedjunkfolderforusernew SquirrelMailConfiguration Squirrelmailisawebmailclient System4: Step1: installandconfigurethedns,sendmailorpostfix,dovecot,http and php #yuminstallpostfixdovecothttpphp*bind* configurethedns,postfix,httpanddovecot Step2: restartthedns,postfix,httpanddovecot #servicenamedrestart #rndcreload addthednsentriesin/etc/resolv.conf #servicehttpdrestart #servicepostfixrestart #servicedovecotrestart Step3: installthesquirrelpackage #chkconfigsquirrelmailon #yuminstallsquirrelmail Step4: runthescriptfile #/usr/share/squirrelmail/config/conf.pl SquirrelMailConfiguration:Read:config.php(1.4.0) MainMenu 1.OrganizationPreferences 2.ServerSettings 3.FolderDefaults 4.GeneralOptions 5.Themes 6.AddressBooks 7.MessageoftheDay(MOTD) 8.Plugins 9.Database 10.Languages D.SetpredefinedsettingsforspecificIMAPservers CTurncoloroff SSavedata QQuit Command>>2 SquirrelMailConfiguration:Read:config.php(1.4.0) ServerSettings General

1.Domain:localhost 2.InvertTime:false 3.SendmailorSMTP:Sendmail A.UpdateIMAPSettings::143(uw) B.ChangeSendmailConfig:/usr/sbin/sendmail RReturntoMainMenu CTurncoloroff SSavedata QQuit Command>>A SquirrelMailConfiguration:Read:config.php(1.4.0) ServerSettings General 1.Domain:localhost 2.InvertTime:false 3.SendmailorSMTP:Sendmail IMAPSettings 4.IMAPServer: 5.IMAPPort:143 6.Authenticationtype:login 7.SecureIMAP(TLS):false 8.Serversoftware:uw 9.Delimiter:/ B.ChangeSendmailConfig:/usr/sbin/sendmail H.HideIMAPServerSettings RReturntoMainMenu CTurncoloroff SSavedata QQuit Command>>4 ThisisthehostnamewhereyourIMAPservercanbecontacted. []:priya.com SquirrelMailConfiguration:Read:config.php(1.4.0) ServerSettings General 1.Domain:localhost 2.InvertTime:false 3.SendmailorSMTP:Sendmail IMAPSettings 4.IMAPServer:priya.com 5.IMAPPort:143 6.Authenticationtype:login

7.SecureIMAP(TLS):false 8.Serversoftware:uw 9.Delimiter:/ B.ChangeSendmailConfig:/usr/sbin/sendmail H.HideIMAPServerSettings RReturntoMainMenu CTurncoloroff SSavedata QQuit Command>>s Datasavedinconfig.php Pressentertocontinue... SquirrelMailConfiguration:Read:config.php(1.4.0) ServerSettings General 1.Domain:localhost 2.InvertTime:false 3.SendmailorSMTP:Sendmail IMAPSettings 4.IMAPServer:priya.com 5.IMAPPort:143 6.Authenticationtype:login 7.SecureIMAP(TLS):false 8.Serversoftware:uw 9.Delimiter:/ B.ChangeSendmailConfig:/usr/sbin/sendmail H.HideIMAPServerSettings RReturntoMainMenu CTurncoloroff SSavedata QQuit Command>>q Exitingconf.pl. Youmightwanttotestyourconfigurationbybrowsingto http://yoursquirrelmaillocation/src/configtest.php HappySquirrelMailing! Step5: createasoftlinkinhtmldirectory #lns/usr/share/squirrelmail//var/www/html/webmail restartthehttpservice #servicehttpdrestart Sys4 Step6: openthefirefoxandtypethefollowinglineinaddressbar http://priya.com/webmail Username: Password: NFSServerconfiguration system2: Step1:

installnfspackages #yuminstallnfsutils Step2: editexportsfileToshareafolderex:/share #vim/etc/exports /share *(rw) Step3: restartthenfsservice #chkconfignfson #servicenfsrestart sys2: Step4: listservershares #showmounte192.168.0.20 Step5: mountthesharefolderinlocal #mount192.168.0.20:/share/mnt Ftpserverconfiguration Server1(ip192.168.0.254) Step1: installftppackage #yuminstallvsftpd Step2: restarttheservice #chkconfigvsftpdon #servicevsftpdrestart ClientSide Step3: Userlogin [root@sys5~]#lftpupriya192.168.0.254 Password: [email protected]:~>ls drwxrxrx2202320231024Aug1207:02Desktop drwxrxrx2001024Sep3009:58dir1 rwrr1000Sep3009:58priya1 rwrr1000Sep3009:58priya2 [email protected]:~>getpriya1 [email protected]:~>!ls anacondaks.cfgDesktopinstall.logpriya1 xorg.conf [email protected]:~>putanacondaks.cfg 976bytestransferred [email protected]:~>ls drwxrxrx2202320231024Aug1207:02Desktop rwrr120232023976Sep3010:10anaconda ks.cfg drwxrxrx2001024Sep3009:58dir1 rwrr1000Sep3009:58priya1 rwrr1000Sep3009:58priya2 [email protected]:~>mgetddir1/* Total2filestransferred [email protected]:~>!ls anacondaks.cfgdir1install.logpriya1 [email protected]:~>quit Guestlogin [root@sys5~]#lftp192.168.0.254

lftp192.168.0.254:~>ls drwxrxrx15004096Sep2411:13pub lftp192.168.0.254:/>quit Denyusersloginviatheftp Server: Step1: edittheconfigurationfile #vim/etc/vsftpd/vsftpd.conf Lineno:115 userlist_enable=YES Step2: addtheuserentryinuser_listfile #vim/etc/vsftpd/user_list priya Step3: restarttheftpservice #servicevsftpdrestart Client Step4: root@sys5~]#lftpupriya192.168.0.254 [email protected]:~>ls Loginfailed [email protected]:/>quit Denyusersloginviatheftp Server: Step1: addtheuserentryinftpusersfile #vim/etc/vsftpd/ftpusers priya Step2: restarttheftpservice #servicevsftpdrestart Client Step3: root@sys5~]#lftpupriya192.168.0.254 [email protected]:~>ls Loginfailed [email protected]:/>quit SambaServerConfiguration StandaloneServer Serverside: Step1: installsambapackages #yuminstallsambasambacommonsambaclient Step2: editsmb.confconfigurationfile #vim/etc/samba/smb.conf Lineno:26 workgroup=MAN Lineno:29 serverstring=SambaServersystem4 Lineno:34 security=user

Lineno:105 localmaster=yes Lineno:273(addthesharedirectory) [sharedir] comment=sampleshare path=/sample public=yes writable=yes printable=yes Step3: checkthesystaxofconfigurationandtesttheserverrole #testparm Step4: addtheusersinsamba #smbpasswda NewSMBpassword: RetypenewSMBpassword: Addeduserroot. #smbpasswdapriya NewSMBpassword: RetypenewSMBpassword: Addeduserpriya. Theseusersaddedin/etc/samba/smbpasswdfile Step5: restartthesambaservice #chkconfigsmbon;servicesmbrestart ToaccessthelinuxfilesinWindows Step1: windowsworkgroupispriya startrun\\system4\user1 User:user1 Password:****** ToaccessthewindowsfilesinLinux Graphical: PlacesNetworkServersWindowsNetWorkPriyaPc6 Username:administrator Password:******** CommandLine: Step1: Listtheshareddirectories #smbtreea Password:[Enter] PRIYA \\PC6 \\PC6\C$Defaultshare \\PC6\SYSVOLLogonservershare \\PC6\ADMIN$RemoteAdmin \\PC6\NETLOGONLogonservershare \\PC6\c \\PC6\IPC$RemoteIPC MYGROUP \\SYSTEM4SambaServer \\SYSTEM4\rootHomeDirectories \\SYSTEM4\IPC$IPCService(SambaServer)

Step2: accessthewindowsfiles #smbclient//192.168.0.2/cUadministrator Password:<administratorpasswd> Domain=[PRIYA]OS=[WindowsServer20033790]Server=[WindowsServer 20035.2] smb:\>ls AUTOEXEC.BATA0ThuAug719:07:272008 boot.iniAHS192ThuAug719:03:112008 CONFIG.SYSA0ThuAug719:07:272008 DocumentsandSettingsD0ThuAug719:16:082008 IntelD0ThuAug719:17:112008 IO.SYSAHSR0ThuAug719:07:2720 08 MSDOS.SYSAHSR0ThuAug719:07:272008 NTDETECT.COMAHSR47548ThuApr317:30:002003 ntldrAHSR277152ThuApr317:30:002003 pagefile.sysAHS1598029824TueSep3011:49:562008 ProgramFilesDR0ThuSep410:59:152008 RECYCLERDHS0SunAug1000:21:562008 SystemVolumeInformationDHS0TueSep3011:49:582008 TempEI4D0FriAug812:39:172008 WINDOWSD0FriSep1910:31:462008 wmpubD0ThuAug719:07:492008 40005blocksofsize262144.24428blocksavailable smb:\>quit MounttheWindowsDirectory Step1: TemporaryMount: #mount//192.168.0.2/c/mnt/ouser=administrator Password:<adminpassword> PermanentMount: #vim/etc/fstab Lineno:last //192.168.0.2/c/mnt/ext3defaults,user=administrator%Plx123400 #mounta LinuxPrimaryDomainController System4: Step1: installandconfiguredns installsambapackages #yuminstallsambasambacommonsambaclient Step2: editthesmb.conffile [global] workgroup=linux.com netbiosname=linux passwdbbackend=tdbsam security=user oslevel=35 domainmaster=yes preferredmaster=yes domainlogons=yes logondrive=c:

adduserscript=/usr/sbin/useradd%U addgroupscript=/usr/sbin/groupadd%g addmachinescript=/usr/bin/adduserngmachinescMachined /dev/null/s/bin/false%U deleteuserfromgroupscript=/usr/sbin/deluser%U%g deletegroupscript=/usr/sbin/groupdel%g [homes] Comment=homedirectories validusers=%S readonly=no [netlogon] Comment=NetworkLogonService path=/usr/local/samba/lib/netlogon browsable=no readonly=no sharemodes=no [Profiles] path=/usr/local/samba/profiles browseable=no guestok=yes readonly=no profileacls=yes Step3: createadirectory #mkdirp/usr/local/samba/profiles/user1 #chmodR777/usr/local/samba Step4: createamembermachineentryindnsandcheckconnectivity Step5: addmacineaccountandgroup #groupaddrtrust #useraddrgtrustd/dev/nulls/dev/nullpc6$ #smbpasswdampc6 Step6: adduseraccountsandassignpassword #useraddtest;passwdtest #useraddsan;passwdsan #smbpasswdasan #smbpasswdatest Step7: changetheselinuxrules #systemconfigselinux& selectsambaandenabletheallowpolicies. #testparm #chkconfigsmbon;servicesmbrestart WindowsSystem:(pc6) Step8: addthednsserverentry RightclickMynetworkplaces>rightclicklocalareaconnection >selectproperties>add192.168.0.4inpreferreddnsserver Step9: clickMycomputer>ComputerName>selectDomainandtypelinux.com clickokandrestartthecomputer Step10: loginasuser user:san

password:<typesmbpassword> System4 Step1: installthenisserverpackage #yuminstallypserv Step2: #nisdomainnameplx.com editthenetworkfile Lineno:last #vim/etc/sysconfig/network NISDOMAIN=plx.com Step3: createadirectorywiththenameofdomainname #mkdir/var/yp/plx.com Step4: addusers #mkdir/profile #useraddd/profile/anuanu starttheservices #serviceypservstart #serviceyppasswddstart Step5: initializethenisdatabase #/usr/lib/yp/ypinitm Atthispoint,wehavetoconstructalistofthehostswhichwill run NISservers.system3.plx.comisinthelistofNISserver hosts. Pleasecontinuetoadd thenamesfortheotherhosts,oneperline.Whenyouaredonewith thelist,typea<controlD>. nexthosttoadd:system3.plx.com nexthosttoadd:<presscontrol+D> ThecurrentlistofNISserverslookslikethis: station3.example.com Isthiscorrect?[y/n:y]y Weneedafewminutestobuildthedatabases... Building/var/yp/plx.com/ypservers... Running/var/yp/Makefile... gmake[1]:Enteringdirectory`/var/yp/plx.com' Updatingpasswd.byname... Updatingpasswd.byuid... Updatinggroup.byname... Updatinggroup.bygid... Updatinghosts.byname... Updatinghosts.byaddr... Updatingrpc.byname... Updatingrpc.bynumber... Updatingservices.byname... Updatingservices.byservicename... Updatingnetid.byname... Updatingprotocols.bynumber... Updatingprotocols.byname... Updatingmail.aliases... NISServerConfiguration

gmake[1]:Leavingdirectory`/var/yp/plx.com' system3.plx.comhasbeensetupasaNISmasterserver. Nowyoucanrunypinitssystem3.plx.comonallslaveserver. Step6: restarttheypservandyppasswddservices. #chkconfigypservon;chkconfigyppasswddon #serviceypservrestart #serviceyppasswddrestart Step7: shareprofiledirectory #vim/etc/exports /profile*(rw) #servicenfsrestart ClientSide:(sys4) Step8: installypbindpackage #yuminstallypbind Step9: enablenisauthentication #authconfigtui(or)#authconfiggtk Enable>UseNis>next>Domain:plx.comServer:192.168.0.40>ok Step10: mounttheprofiledirectoryfromserver #mkdir/profile #mount192.168.0.40:/profile/profile loginasnisuser #suanu UpdatetheNISdatabase System4: Step1: addnewuser #useraddd/profile/nis1nis1;passwdnis1 #cd/var/yp #make #serviceypservrestart ClientSide: Step2: loginasnewuser #sunis1 LDAPServerConfiguration System4: Step1: yuminstallopenldapserversopenldapclientsopenldap Step2: edittheldapconfigurationfile #vim/etc/openldap/slapd.conf Lineno:69 suffix dc=sun,dc=com Lineno:70 rootdn cn=Manager,dc=sun,dc=com Step3: editconfigurationfile Lineno:71

$DEFAULT_MAIL_DOMAIN=sun.com Lineno:74 $DEFAULTBASE=dc=sun,dc=com Step4: #touch/etc/networks #/usr/share/migration/migrate_all_offline.sh #chownldap.ldap/var/lib/openldap restarttheservice #chkconfigldapon;serviceldaprestart ClientSide:(sys4) Step5: installopenldapclientspackage #yuminstallopenldapclients Step6: enableldapauthentication #authconfigtui(or)#authconfiggtk Enable>UseLDAP(UserInformation)>UseLDAPauthentication (authentication)>next>Server:ldap://192.168.0.40 Basedn:dc=sun,dc=com>ok Step10: mounttheprofiledirectoryfromserver #mkdir/profile #mount192.168.0.40:/profile/profile loginasldapuser #suanu PartitionManagement PartitionCreation Step1: listthepartitions #fdiskl Disk/dev/hda:40.0GB,40020664320bytes 255heads,63sectors/track,4865cylinders Units=cylindersof16065*512=8225280bytes Device BootStartEndBlocksIdSystem /dev/hda1* 11310439183Linux /dev/hda2 1411609213277+8eLinuxLVM /dev/hda3 116117975116702+83Linux /dev/hda4 17984865246437105Extended /dev/hda5 17982434511667183Linux /dev/hda6 2435249952208182 Linuxswap/Solaris Step2: createapartition #fdisk/dev/hda Command(mforhelp):n Firstcylinder(37174865,default3717): Usingdefaultvalue3717 Lastcylinder+sizeMor+sizeK(37174865,default4865):+1000M Command(mforhelp):w Thepartitiontablehasbeenaltered! Callingioctl()torereadpartitiontable. Syncingdisks. Step3:

refreshthekernelpartitiontable #partprobe Step4: formatthepartition #mkfs.ext3/dev/hda7 createlabelforpartition #e2label/dev/hda7sample Step5: createamountpoint mkdir/data #vim/etc/fstab Lineno:last /dev/hda7 /data ext3 defaults (or) LABEL=sample /data ext3 defaults #mounta

12 12

Partitiondeletion Step1: #fdisk/dev/hda Command(mforhelp):p DeviceBootStartEndBlocksIdSystem /dev/hda1*11310439183Linux /dev/hda21411609213277+8eLinuxLVM /dev/hda3116117975116702+83Linux /dev/hda417984865246437105Extended /dev/hda517982434511667183Linux /dev/hda62435249952208182Linuxswap /dev/hda725003716977552183Linux Command(mforhelp):d Partitionnumber(17):7 Command(mforhelp):w Thepartitiontablehasbeenaltered! Callingioctl()torereadpartitiontable. Syncingdisks. Step2: #partprobe Step3: #cat/proc/partitions LogicalVolumeManagement Step1: create2partitions #fdisk/dev/hda Command(mforhelp):p DeviceBootStartEndBlocksIdSystem /dev/hda1*11310439183Linux /dev/hda21411609213277+8eLinuxLVM /dev/hda3116117975116702+83Linux /dev/hda417984865246437105Extended /dev/hda517982434511667183Linux /dev/hda62435249952208182Linuxswap Command(mforhelp):n

Firstcylinder(25004865,default2500): Usingdefaultvalue2500 Lastcylinderor+sizeMor+sizeK(25004865,default4865):+1000M Command(mforhelp):n Firstcylinder(26234865,default2623): Usingdefaultvalue2623 Lastcylinderor+sizeMor+sizeK(26234865,default4865):+500M Command(mforhelp):w Thepartitiontablehasbeenaltered! Callingioctl()torereadpartitiontable. Syncingdisks. #partprobe Step2: convertthepartitionsintophysicalvolume #pvcreate/dev/hda7/dev/hda8 displaypvinformation #pvdisplay/dev/hda7/dev/hda8 Step3: createvolumegroupthathold2physicalvolumes #vgcreatevgsample/dev/hda7/dev/hda8 displayvginformation #vgdisplayvgsample Step4: createalogicalvolume #lvcreatendataL700Mvgsample displaylvinformation #lvdisplay/dev/vgsample/data Step5: formatthelogicalvolume #mkfs.ext3/dev/vgsample/data #mkdir/data #mount/dev/vgsample/data/data ExtendaLogicalVolumeSize Step1: #umount/data #lvextendL+100M/dev/vgsample/data #lvdisplay/dev/vgsample/data Step2: formatonlyextendedportitionoflvthatis100MB #e2fsckf/dev/vgsample/data #resize2fs/dev/vgsample/data ReduceaLogicalVolumeSize Step1: #umount/data #lvreduceL100M/dev/vgsample/data #lvdisplay/dev/vgsample/data ExtendaVolumeGroup Step1: createapartitionusingfdisk covertthatpartitionintopv #pvcreate/dev/hda9

Step2: addcreatedpartitionintoexistingvolumegroup #vgextendvgsample/dev/hda9 #vgdisplay CreatesnapshotofLogicalVolume

Step1: #mount/dev/vgsample/data/data #cp/etc/*/data Step2: createasnapshot #lvcreatendatacopysL10M/dev/vgsample/data Step3: displaylvinformation #lvs mountthesnapshot #mount/dev/vgsample/datacopy/mnt RemoveaShapshotorLogicalvolume Step1: removeLVsnapshot #umount/dev/vgsample/datacopy #lvremove/dev/vgsample/datacopy removeLV #umount/dev/vgsample/data #lvremove/dev/vgsample/data RemoveaVolumeGroup Step1: BeforeremovingVolumeGroup,removealllvinvolumegroup #vgremovevgsample RemovePhysicalVolumes Step1: #pvremove/dev/hda7/dev/hda8/dev/hda9 SoftwareRAIDConfiguration Step1: create3partitionsandcreateraiddevice #mdadmC/dev/md1ayesl1n2/dev/hda7/dev/hda8 detailsofraiddevice #mdadmD/dev/md1 Step2: formattheraiddevice #mkfs.ext3/dev/md1 mounttheraiddevice #mount/dev/md1/mnt Step3: copythefileintoraiddevice #cp/etc/*/mnt umountthedevice #umount/mnt Step1: RAIDTestingandRecovery

failapartitioninraiddevice #mdadm/dev/md1d/dev/hda8 #mdadmD/dev/md1 Step2: removeafailedpartition #mdadm/dev/md1r/dev/hda8 Step3: testdatarecovery #mount/dev/md1/mnt #lsl/mnt Step4: addnewpartitiontoraiddevice #umount/mnt #mdadm/dev/md1a/dev/hda9 #mdadmD/dev/md1 NetworkInstallationServer Serverip:192.168.0.50 NFSBasedInstallationServer Serverside: Step1: copythecdordvdimagesintoserver #mkdir/images insertcdordvdandthentypethefollowing #ddif=/dev/cdromof=/images/disk1.iso copyallserverorclientcdimagesinto/imagesdirectory Step2: #yumyinstallnfsutils sharetheimagesdirectoryintonetwork #vim/etc/exports /images*(rw) Step3: restartthenfsservice #servicenfsrestart FTPbasedInstallationServer: ServerSide: Step1: installftppackage #yumyinstallvsftpd Step2: copyserverpackagesfromcdsinto/var/ftp/pubandconfigureyum Step3: changepermissionsandcontext #chmodR777/var/ftp/pub #chcontRhhttpd_sys_content_t/var/ftp/pub Step4: restarttheftpservice #servicevsftpdrestart HTTPBasedInstallationServer: Serverside: Step1: installandconfiguretheapacheserver Step2: alreadypackagesarecopiedintoftplocationsoonlycreate

shortcut ofpackagelocationat/var/www/html #lns/var/ftp/pub/var/www/html Step3: restartthehttpservice #servicehttpdrestart ClientSide: Step1: insertbootorfirstcdindrive typelinuxaskmethodatthebootprompt boot:linuxaskmethod selectinstallationlanguageandpressok selectkeyboardlanguageandpressok Step2: selectinstallationtype nfsorftporhttp NFS:Server:192.168.0.50,Directory:/images FTP:Server:192.168.0.50,Directory:pub HTTP:Server:192.168.0.50,Directory:pub andcontinuetheinstallation ServerSide Step1: edityumrepoconfigurationfile #vim/etc/yum.repos.d/server.repo [base] name=serverpackages baseurl=file:///var/ftp/pub/Server gpgcheck=0 Step2: installkickstartconfigurationutility #yumysystemconfigkickstart Step3: #systemconfigkickstart& selectorenterconfigurationandsavefileinftporhttplocation thatis/var/ftp/pubor/var/www/html Step4: editthekickstartfileandremovecommentlines #vim/var/ftp/pub/ks.cfg install text keyboardus langen_US keyskip urlurl=ftp://192.168.0.50/pub networkbootproto=dhcpdevice=eth0onboot=on zerombr clearpartallinitlabel part/bootbytesperinode=4096fstype="ext3"size=100 part/bytesperinode=4096fstype="ext3"size=10000 partswapbytesperinode=4096fstype="swap"recommended xconfigdefaultdesktop=GNOMEdepth=16resolution=1024x768 timezoneAsia/Calcutta bootloaderlocation=mbr rootpwiscrypted$1$a3R4UJe.$M6f254v4X9kuSMf0oMQIi. KickstartFileCreation

authuseshadowenablemd5 firewalldisabled selinuxpermissive firstbootdisable reboot %packages @servercfg @basex @admintools @gnomedesktop @printing @systemtools @textinternet @graphicalinternet @editors ClientSide: Step1: insertbootorfirstcdindrive typelinuxksatthebootprompt boot:linuxks=ftp://192.168.0.50/pub/ks.cfg WindowsSystem: ip=192.168.0.2 domainname=priya.com systemname=pc6 LinuxSystem: ip=192.168.0.4 systemname=station4 Pc6: Step1: installandconfigureactivedirectorywithdns Step2: addlinuxsystementryindnspriya.comzone Step3: addlinuxsystementryinActiveusersandcomputer station4: Step4: installkerberosandsambapackages #yuminstallsambasambaclientsambacommon #yuminstallkrb5libskrb5workstationpam_krb5krb5authdiag Step5: configurekerberos #vim/etc/krb5.conf [logging] default=FILE:/var/log/krb5libs.log kdc=FILE:/var/log/krb5kdc.log admin_server=FILE:/var/log/kadmind.log [libdefaults] default_realm=PRIYA.COM dns_lookup_realm=false dns_lookup_kdc=false ticket_lifetime=24000 JoinLinuxSystemToWindows2003ADS

[realms] PRIYA.COM={ kdc=priya.com default_domain=priya.com } [domain_realm] .priya.com=PRIYA.COM priya.com=PRIYA.COM [kdc] profile=/var/kerberos/krb5kdc/kdc.conf

[appdefaults] pam={ debug=false ticket_lifetime=36000 renew_lifetime=36000 forwardable=true krb4_convert=false } Step6: configuresambaserverroleasdomainmember #vim/etc/samba/smb.conf [global] workgroup=PRIYA security=ads realm=PRIYA.COM netbiosname=station4 encryptpasswords=yes passwordserver=priya.com clientusespnego=no serversigning=auto cupsoptions=raw logfile=/var/log/samba/%m.log maxlogsize=50 socketoptions=TCP_NODELAYSO_RCVBUF=8192SO_SNDBUF=8192 printcapname=/etc/printcap dnsproxy=No idmapuid=1677721633554431 idmapgid=1677721633554431 templateshell=/bin/bash winbindusedefaultdomain=yes winbindseparator=+ [homes] comment=HomeDirectories writable=yes browseable=no [Data] comment=datadirectory path=/data public=yes #testparm Step7: adddnsentryinresolv.conf

#vim/etc/resolv.conf searchpriya.com nameserver192.168.0.2 Step8: Togetakerberosticket #[email protected] joinlinuxtowindowsserver #netadsjoinUadministrator Step9: #authconfigtui selectwinbindfromuserinformationandauthenticationinformation selectnext securitymodel:ads domain:PRIYA domaincontrollers:priya.com realm:PRIYA.COM Step10: startthesambaandwinbindservice #chkconfigwinbindon #chkconfigsmbon #servicesmbrestart #servicewinbindrestart listwindowsusers #wbinfou Administrator win1 win2 win2 listwindowsgroup #wbinfog loginaswindowsuser #mkdirp/home/PRIYA/win1 #cp/etc/skel/.*/home/PRIYA/win1 #chownRwin1.DomainUsers/home/PRIYA/win1 #suwin1 GrubPasswordProtection Step1: createapasswordandappendthepasswordtogrubconfigurationfile #grubmd5crypt>>/etc/grub.conf <Typepassword,pressenter> <Retypepassword,pressenter> Step2: editgrub.conffile BeforeEditing #vim/etc/grub.conf default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu titleRedHatEnterpriseLinuxServer(2.6.188.el5) root(hd0,0)

kernel/vmlinuz2.6.188.el5roroot=LABEL=/rhgbquiet initrd/initrd2.6.188.el5.img Password: Retypepassword: $1$Y1AVk$jpKrijdWkRY3M8WDBPJaI0 AfterEditing #vim/etc/grub.conf default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu passwordmd5$1$Y1AVk$jpKrijdWkRY3M8WDBPJaI0 titleRedHatEnterpriseLinuxServer(2.6.188.el5) root(hd0,0) kernel/vmlinuz2.6.188.el5roroot=LABEL=/rhgbquiet initrd/initrd2.6.188.el5.img NetFilterConfiguration

Tables Input Filter table Nat table Mangle Table


SystemDetails

Forward Output Prerouting Postrouting Yes Yes Yes Yes Yes Yes Yes

Yes

Yes

Yes

Yes

FilterTable(INPUT) station2 Step1: listfiltertablerulesiniptables #iptablesL Step2: createanewruletoblockinputsshconnectionfromstation5 #iptablestfilterIINPUTs192.168.0.5ptcpdport22j REJECT #iptablesL ChainINPUT(policyACCEPT) targetprotoptsourcedestination REJECTtcp192.168.0.5anywheretcp dpt:sshrejectwith icmpport unreachable

ChainFORWARD(policyACCEPT) targetprotoptsourcedestination ChainOUTPUT(policyACCEPT) targetprotoptsourcedestination station5 Step3: connectthestation2usingssh #[email protected] ssh:connecttohost192.168.0.2port22:Connectionrefused FilterTable(OUTPUT) station2 Step1: listfiltertablerulesiniptables #iptablesL Step2: createanewruletoblockinputsshconnectionfromstation5 #iptablestfilterIOUTPUTd192.168.0.5ptcpdport22j REJECT #iptablesL ChainINPUT(policyACCEPT) targetprotoptsourcedestination REJECTtcp192.168.0.5anywheretcp dpt:sshrejectwith icmpportunreachable ChainFORWARD(policyACCEPT) targetprotoptsourcedestination ChainOUTPUT(policyACCEPT) targetprotoptsourcedestination REJECTtcpanywhere192.168.0.5tcp dpt:sshrejectwithicmp portunreachable Step3: connectthestation2usingssh #[email protected] ssh:connecttohost192.168.0.5port22:Connectionrefused DeleteaRuleinFiltertable station2 Step1: listtherules #iptablesL Step2: deletearuleinfiltertableinputchain #iptablesDINPUT1 #iptablesL ChainINPUT(policyACCEPT) targetprotoptsourcedestination ChainFORWARD(policyACCEPT) targetprotoptsourcedestination ChainOUTPUT(policyACCEPT) targetprotoptsourcedestination REJECTtcpanywhere192.168.0.5tcp dpt:sshrejectwithicmp

portunreachable station2 Step1: #iptablesF RemoveallRulesinFiltertable

FilterTable(Forward) station2 Step1: configurerouting #vim/etc/sysctl.conf net.ipv4.ip_forward=1 #sysctlp Step2: addruleiniptable #iptablesIFORWARDs192.168.0.5d10.0.0.4ptcpdport22 j REJECT #iptablesIFORWARDs10.0.0.4d192.168.0.5ptcpdport22j ACCEPT #iptablesL ChainINPUT(policyACCEPT) targetprotoptsourcedestination ChainFORWARD(policyACCEPT) targetprotoptsource destination ACCEPTtcp10.0.0.4 192.168.0.5tcpdpt:ssh REJECTtcp192.168.0.510.0.0.4tcpdpt:sshrejectwith icmpportunreachable ChainOUTPUT(policyACCEPT) targetprotoptsourcedestination station5 Step3: #ssh10.0.0.4 ssh:connecttohost192.168.0.5port22:Connectionrefused station4 Step4: #ssh192.168.0.5 [email protected]: station2 Step5: removeallrules #iptablesF NATTable(Prerouting) Preroutingisusedtochangethedestinationaddress.soitis otherwisecalledDestinationNAT(DNAT). station2 Step1: addaruleinnattable #iptablestnatIPREROUTINGs192.168.0.5d10.0.0.4jDNAT todest10.0.0.2 #iptablestnatL ChainPREROUTING(policyACCEPT) targetprotoptsourcedestination

DNATall192.168.0.510.0.0.4to:10.0.0.2 ChainPOSTROUTING(policyACCEPT) targetprotoptsourcedestination ChainOUTPUT(policyACCEPT) targetprotoptsourcedestination station5: connectthestation4 #ssh10.0.0.4 [email protected]: [root@station2~]# NATTable(Postrouting) Postroutingisusedtochangethesourceaddress.soitisotherwise calledSourceNAT(SNAT) station4 Step1: addainputruletorejectthestation5 #iptablesIINPUTs192.168.0.5jREJECT station5 Step2: #ssh10.0.0.4 ssh:connecttohost192.168.0.5port22:Connectionrefused station2 Step3: addaruleinnattable #iptablestnatIPOSTROUTINGjSNATs192.168.0.5d10.0.0.4 tosource10.0.0.7 #iptablestnatL ChainPREROUTING(policyACCEPT) targetprotoptsourcedestination ChainPOSTROUTING(policyACCEPT) targetprotoptsourcedestination SNATall192.168.0.510.0.0.4to:10.0.0.7 ChainOUTPUT(policyACCEPT) targetprotoptsourcedestination station5 Step4: connectthestation4 #ssh10.0.0.4 PostroutingMasquerade station4 Step1: addainputruletorejectthestation5 #iptablesIINPUTs192.168.0.5jREJECT station5 Step2: #ssh10.0.0.4 ssh:connecttohost192.168.0.5port22:Connectionrefused station2 Step3: #iptablestnatF

addaruleinnattable #iptablestnatIPOSTROUTINGs192.168.0.5oeth1jMASQUERADE #iptablestnatL ChainPREROUTING(policyACCEPT) targetprotoptsourcedestination ChainPOSTROUTING(policyACCEPT) targetprotoptsourcedestination MASQUERADEall192.168.0.5anywhere ChainOUTPUT(policyACCEPT) targetprotoptsourcedestination station5 Step4: connectthestation4 #ssh10.0.0.4 FingerServerConfiguration Fingerserverusedtoseeinformationaboutremotesystemusers (loginname,homedirectory,name,howlongthey'vebeenloggedintothe system,etc.). serverside station5: Step1: installfingerserverpackage #yuminstallfingerserver Step2: startthefingerservice #chkconfigxinetdon #chkconfigfingeron #servicexinetdstart Startingxinetd:[OK] clientside: station2: Step3: installfingerrpm #yuminstallfinger Step4: #fingertest@station5 (or) #gnomenettool RemoteUsersServer Theremoteusersserverisusedtofindoutwhoisloggedinto remotemachinesonthelocalnetwork. serverside station5: Step1: installrusersserverpackage #yuminstallrusersserver Step2: startthefingerservice #chkconfigruserson #chkconfigrstatdon #servicerstatdstart

Startingrstatservices:[OK] #servicerusersdstart Startingrusersservices:[OK] clientside station2: Step3: installrusersrpm #yuminstallrusers Step4: #rusers192.168.0.5 #rup192.168.0.5 DHCPIPV6SERVER station5: Step1: enableipv6 #vim/etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=yes HOSTNAME=station5.example.com Step2: enableipv6ineth0configurationfile #vim/etc/sysconfig/networkscripts/ifcfgeth0 TYPE=Ethernet DEVICE=eth0 HWADDR=00:19:d1:8c:de:36 BOOTPROTO=none ONBOOT=yes USERCTL=no IPV6INIT=yes IPV6ADDR=3ffe:501:ffff:1::22/64 PEERDNS=yes NETMASK=255.255.255.0 IPADDR=192.168.0.5 Step3: installdhcpv6package #yuminstalldhcpv6 Step4: #cp/usr/share/doc/dhcpv60.10/dhcp6s.conf/etc/ Step5: specifytheinterfaceinconfigfile #vim/etc/sysconfig/dhcp6s DHCP6SIF=eth0 DHCP6SARGS= Step6: restartthedhcpv6service #servicedhcp6srestart IPLeasesInformationfile:/var/lib/dhcpv6/server6.leases station2 Step7: installdhcpv6clientpackage #yumyinstalldhcpv6_client Step8: #vim/etc/sysconfig/network NETWORKING=yes

NETWORKING_IPV6=yes HOSTNAME=station2.example.com Step9: enableipv6ineth0configurationfile #vim/etc/sysconfig/networkscripts/ifcfgeth0 TYPE=Ethernet DEVICE=eth0 HWADDR=00:19:d1:8c:de:36 BOOTPROTO=none ONBOOT=yes USERCTL=no IPV6INIT=yes DHCPV6C=yes PEERDNS=yes NETMASK=255.255.255.0 IPADDR=192.168.0.2 Step10: restartthenetworkservice #servicenetworkrestart

You might also like