Saturday, June 29, 2013

USEFUL WEBSITES OF MY COLLECTION


               TOP WEBSITES
                     **************************************************

1. http://www.livestation.com/en/aljazeera-english#   [ whatch live bbc news ]

http://www.india.idp.com/uk/uk-education-fair/uk-education-fair.aspx?gclid=CJ3U39DdorUCFQub6wodplQAtA  [ ALL ABOUT UK STUDENT VISA ]

---------------Computer Classes Websites-------------------------

2. www.computernetworkingnotes.com   [ all about Networking ]

3. www.server-world.info/en

4. www.cyberciti.biz

5. www.linuxhomenetworking.com

6. www.linux.org

7. www.techcuriosity.com  [for all command information ]

8. www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:Ch14_:Linux_firewalls-using_iptables

9. www.ispexperts.com.np/?p=786

10. www.echowstuff.com

11. www.linuxtopia.org/online_books/rhel6/rhel_6_deployment_Ch-automated_Task.html [CRONTAB in RHEL-6 ]

12. http://rpmfind.net/linux/rpm2html/search.php?query=pdftohtml    [FIND THE ALL 'RPM' ]


--------------------Extra Useful Websites----------------

1. www.oxforddictionaries.com   [ Oxford Dictionary ]

2. www.bbclearningenglish.com    [ Learning English ]

3. www.indianrail.gov.in

4. www.irctc.co.in   [ Railway Ticket Booking ]

5. www.facts-about-india.com   [ All about India Fact]

6. www.coolinterview.com/type.asp?iType=741 [ Networking Interview Qustions ]

7. www.coolinterview.com/type.asp?iType=83

8. http://www.youtube.com/watch?v=PtYWfnFgM_g      [ All new computer trick Video from Youtube.com ]

and
http://www.youtube.com/watch?v=jg0IECQmUjE

9. http://www.crictime.com/watch_live_cricket_streaming_7.htm    [ watch live cricket match ]

10. http://www.youtube.com/watch?v=yLvHwZcsBkk&list=PLks8W396lro78Sxq4lPJZiXCdGT7gY166    [ Cisco clasess by Jasvinder]

11. http://www.youtube.com/watch?v=D-pi5riKjX4&list=PLks8W396lro78Sxq4lPJZiXCdGT7gY166     [ Jagvinder singh Cisco ]

12. http://www.jagvindersingh.blogspot.com    [All Networking classess by Jagvinder singh in Hindi ]

13. http://www.youtube.com/user/jagvinderThind   [ Watch the all video of Javinder Singh Cisco and Linux ]

14. http://www.9tut.com/ccna-basic-questions  [ All about CCNA classes ]

15. http://mknetwork-in.blogspot.in/2012/09/squid-proxy-server-configure-in.html  [ All about LINUX-6 Configuration ]

16. http://www.youtube.com/watch?v=VUAYmTnWaCY  [ Best youtube website for learning English pronouciation ]

17. http://www.antimoon.com/how/pronunctransdemo.htm  [ The best way to learn how to write pronounceation ]

18. http://www.tvonlinelive.net/Watch/Fox_News-Online-4729.html  [ whatch live new on FOX news live USA ]

19. http://www.techterms.com/category/internet   [ All about the Computers Cources A to Z ]

20. http://windows.microsoft.com/en-IN/windows7/products/features/bitlocker  [All about Windows-7 Features ]

21. http://www.comptechdoc.org/   [ All about the Networking - total clasess ]

22. http://www.techterms.com/definition/pppoe  [ Best website for All Networking ]

23. http://www.9tut.com/  [All question and answer from CCNA ]

24. http://billalert.mtnl.net.in/pay/login.asp   [ MTNL - BILL PAYMENT ] ***

25. http://www.certificationkits.com/cisco-certification/Cisco-CCNA-Network-Services-and-Troubleshooting-Tools-Part-II.html    (ALL ABOUT CCNA NETWORK MONITARING COMMNADS )

26. http://www.microsoft.com/security/default.aspx  [ all about Windows security]

27. http://www.securitymagazine.com/articles/topic/2236-cyber-security      [all about cyber-security ]

28. http://en.wikipedia.org/wiki/Server_(computing)      [ To know all about the Server Configuration ]

29. http://www.igenericdrugs.com/       [ All about the drugs information ]

30. https://help.ubuntu.com/community/Internet/ConnectionSharing  [ All about network sharing and iptables]

31. https://help.ubuntu.com/community/IptablesHowTo            [ Find the all about Iptables ]

32. http://www.networking-forum.com/viewtopic.php?f=42&p=215138  [iptables configuration ]

33. http://lartc.org/lartc.html               [ Linux Advanced Routing & Traffic Control HOWTO ]

34. www.facts-about-india.com         [ All about  India ]

35. 

SWAP PARTITION


  HOW TO INCREASE THE SWAP PARTITION SIZE
      ***************************************************
   
Normally we keep size of SWAP double to the RAM, but what if you have installed additional RAM and require more swap space. Lets see how we can increase the SWAP space without restarting the system assuming that there is some free space in the hard disk.

Open linux terminal and log in with root.

1) fdisk -l ( this will tell about the partitions in the Hard disk)

Assuming there are partitions upto sda7

2) fdisk /dev/sda

Press m for all the help options at this point.

3) Press n for the new partition.

it will ask for first cylinder – press enter (no need to give anything there)

it will ask for last cylinder TYPE : +1G ( it means that additionaly SWAP space will be of 1GB)

4) (1-8) press 8 (its for the new sda8)

5) Press l and then 82 ( 82 is hex number for SWAP)

6) Press p (to print the details)

7)press w (to write the configuration in the partition table)

but the work is not finished yet because still Linux system is using old partition table…. so we need to force it to read the new partition table and the command is

8) partprobe (used to read new partition table)

9) mkswap /dev/sda8 (this will make the swap space to be used)

Note: if we restart Linux then the new swap partition will get lost so we need to make it permanent by making an entry in /etc/fstab

10) vi /etc/fstab (press i to go in insert mode)

In the last line make this entry

/dev/sda8 swap swap defaults 0 0

save the file with :wq

11) mount -a

12) swapon -a

13) swapon -s (to see the status)

That's all you have to do to add some more swap space to your LINUX for better functionality.

DHCP - SERVER (Dynamic Host Configuration Protocol )

                                                      DHCP SERVER

DHCP -  Dynamic Host Configuration Protocol

Port No. -  67,68

package  - dhcpd

deamon  - dhcpd

role     -   provides  the dynamic ip add. to all the LAN.  P.C,
-----------------------------------------------------------------------------------

( Note : - Before configure the 'DHCP' Server set the static IP in the system  on which we are going to  configure DHCP server )

   #vim    /etc/sysconfig/network-script/ifcfg-eth0

      BOOTPROTO = static

      IPADDR  =  192.168.0.1

      NETMASK =  255.255.255.0

      :wq   [ after this conf. save the file and quit ]
 ----------------------------------------------------------------------

step 1.    Install the package  'dhcpd'

              #yum    install  dhcpd

             (copy the the conf. file from /user/share/doc/dhc-4.1.1/dhcpd.conf.sample  to                                              /etc/dhcpd/dhcpd.conf )

step 2.      #cp     /usr/shar/doc/dhcp-4.1.1/dhcp.conf.sample       /etc/dhcp/dhcpd.conf

             overwrite ?  yes  

            [  Nonte:-  This particular subnet declaration specifies a default lease time of 600 seconds (10 min)  and a maximum lease time of 7200 seconds (two hours ). Other common values would be 86400 (one day )  ,  604800 (one week ) ,  and 2592000 (30 day ).


step 3.   #vim    /etc/dhcp/dhcpd.conf


           #this is very basic subnet declaration.

         sbunet  192.168.0.0   netmask   255.255.255.0 {

          range   192.168.0.2     192.168.1.50 ;
          }

         :wq   [ save the file and quit after this configuration )

          #service    dhcpd      restart
          
step 4.    # vim   /var/lib/dhcpd/dhcpd.leases          [ go in to this  file and delete  all the content  ]      

              :wq   [ delete all and save the file ]

              # vim  /var/lib/dhcpd/dhcpd.leases~        [ again go in to this file and delete all ]

               :wq    [ delete all and save the file ]

step 5.    [ Note:- if want to fix the IP of any system than go to the file '/etc/dhcp/dhcpd.conf' and put the
MAC Add. and of  that system and fix the IP

              #vim      /etc/dhcp/dhcpd.conf

              host  fantasia     [ find this line in conf. file of dhcp ]

              hardware ethernet          00:0c:f1:80:3a:67 ;

              fixed  - address    192.168.0.5

              :wq    [ after fixed the IP save this file and quit ]

              #service    dhcpd    restart

-----------------------------------------------------------------------------------------------------------------------
           

YUM SERVER


 YUM  (Yellow Dog Update Modifier ) 
                ------------------------------------------

* YUM - It is a 'xml' file. It resolve the dependency,it is front end of '.rpm'

(FROM SERVER END)
         ...........................................

step 1. [Copy the DVD of RHEL-6 in to the '/var/ftp/pub'

#mount  /dev/cdrw   /mnt   [ mount first the DVD in to the '/mnt ]

#cd   /mnt

#cp -av -R  *  /var/ftp/pub      [where '*' is whole dir 'Package' ]

step 2. #vi  /etc/yum.repose.d/server.repo

[ where 'server.repo' is the name of your yum server that can be any thing "file.repo"]

[server]

name = server

baseurl = file:///var/ftp/pub/Package

gpgcheck = 0

enabled  = 1

:wq   [ after this configuration save the file and exit]

step 3. Install the package of 'creatrepo'

#cd  /var/ftp/pub/Package

#rpm   -ivh  creatrepo_pres tab  


step 4. #cd ..

   #cd ..

   #creatrepo  pub   (/packages)

step 5. #yum clean all

#yum list all

step 6. #yum   install    package name

Ex. - yum install vsftpd

FROM CLIENT END
                .........................

step 7. #vim  /etc/yum.repos.d/server.repo

[server]

name = server

baseurl = ftp://192.168.0.1/pub/Packages

gpgcheck = 0

enabled  = 1

:wq  [ save the file and quit ]


#yum list all

#ping  -s 256 192.168.0.1
-----------------------------------------------------------------------------------------------------

SUDO - Super User Doer


SUDO (Super User Do ) 
               --------------------------------

SUDO  : - 'Super user doer' is a process that gives Admin.(root) power to a local user and that can be
       full permission or some limeted permission that depand on "root". Root can give any permission
       to its local user.

step 1. creat a user first to provide the 'sudo' power

#adduser  tom

#passwd   tom  (either we can give password or without to our sudo user
XXXX

#passwed -d  tom  ( user without password )

step 2. #visudo  (write this command and press enter to make entry in 'visudo'file)

(go to the end of this file , simly press 'Shift + g' )

"%tom  ALL = /sbin/init 0, /sbin/init 6, /sbin/ifconfig , /sbin/adduser"
[write this line for some limited permission]

"%tom  ALL=(ALL) ALL"
[write this line to give the full permission to a user]

:wq   (save the file and exit )

#which  command   [ to search the path of the command ]

#whereis command  [ to search the path of the command ]

#locate  command  [ to search the exact location of the command]

step 3. (Login by the user "tom" and write these command by the help of 'sudo' command )

tom$]sudo  /sbin/init 6

password: XXX

tom$]sudo  /sbin/adduser  herry

password: XXX

=======================================================================

Friday, June 28, 2013

NAT-SERVER

Step-By-Step Configuration of NAT with iptables
===============================================
This tutorial shows how to set up network-address-translation (NAT) on a Linux system with iptables rules so that the system can act as a gateway and provide internet access to multiple hosts on a local network using a single public IP address. This is achieved by rewriting the source and/or destination addresses of IP packets as they pass through the NAT system.
Requirements:

CPU - PII or more
OS - Any Linux distribution
Software - Iptables
Network Interface Cards: 2
Here is my considerations:
Replace xx.xx.xx.xx with your WAN IP
Replace yy.yy.yy.yy with your LAN IP
(i.e. 192.168.0.0/16, 172.16.0.0/12,  10.0.0.0/8 as suggested by Mr. tzs)
WAN = eth0 with public IP xx.xx.xx.xx
LAN = eth1 with private IP yy.yy.yy.yy/ 255.255.0.0

Step by Step Procedure

Step #1. Add 2 Network cards to the Linux box

Step #2. Verify the Network cards, Wether they installed properly or not
ls /etc/sysconfig/network-scripts/ifcfg-eth* | wc -l
    ( The output should be "2")

Step #3. Configure eth0 for Internet with a Public ( IP External network or Internet)

cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
BROADCAST=xx.xx.xx.255    # Optional Entry
HWADDR=00:50:BA:88:72:D4    # Optional Entry
IPADDR=xx.xx.xx.xx
NETMASK=255.255.255.0    # Provided by the ISP
NETWORK=xx.xx.xx.0       # Optional
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
GATEWAY=xx.xx.xx.1    # Provided by the ISP

Step #4. Configure eth1 for LAN with a Private IP (Internal private network)

cat /etc/sysconfig/network-scripts/ifcfg-eth1
BOOTPROTO=none
PEERDNS=yes
HWADDR=00:50:8B:CF:9C:05    # Optional
TYPE=Ethernet
IPV6INIT=no
DEVICE=eth1
NETMASK=255.255.0.0        # Specify based on your requirement
BROADCAST=""
IPADDR=192.168.2.1        # Gateway of the LAN
NETWORK=192.168.0.0        # Optional
USERCTL=no
ONBOOT=yes

Step #5. Host Configuration    (Optional)

cat /etc/hosts
    127.0.0.1       nat localhost.localdomain   localhost

Step #6. Gateway Configuration

cat /etc/sysconfig/network
    NETWORKING=yes
    HOSTNAME=nat
    GATEWAY=xx.xx.xx.1    # Internet Gateway, provided by the ISP
Step #7. DNS Configuration

cat /etc/resolv.conf
    nameserver 203.145.184.13      # Primary DNS Server provided by the ISP
    nameserver 202.56.250.5        # Secondary DNS Server provided by the ISP

Step #8. NAT configuration with IP Tables

    # Delete and flush. Default table is "filter". Others like "nat" must be explicitly stated.
iptables --flush            # Flush all the rules in filter and nat tables
iptables --table nat --flush
iptables --delete-chain
# Delete all chains that are not in default filter and nat table
iptables --table nat --delete-chain
# Set up IP FORWARDing and Masquerading
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
# Enables packet forwarding by kernel
echo 1 > /proc/sys/net/ipv4/ip_forward
 #Apply the configuration

service iptables restart

Step #9. Testing

 # Ping the Gateway of the network from client system
ping 192.168.2.1
Try it on your client systems
ping google.com
 Configuring PCs on the network (Clients)
•    All PC's on the private office network should set their "gateway" to be the local private network IP address of the Linux gateway computer.
•    The DNS should be set to that of the ISP on the internet.
Windows '95, 2000, XP,  Configuration:

•    Select "Start" + Settings" + "Control Panel"
•    Select the "Network" icon
•    Select the tab "Configuration" and double click the component "TCP/IP" for the ethernet card. (NOT the TCP/IP -> Dial-Up Adapter)
•    Select the tabs:
o    "Gateway": Use the internal network IP address of the Linux box. (192.168.2.1)
o    "DNS Configuration": Use the IP addresses of the ISP Domain Name Servers. (Actual internet IP address)
o    "IP Address": The IP address (192.168.XXX.XXX - static) and netmask (typically 255.255.0.0 for a small local office network) of the PC can also be set here.
======================================================

FTP-SERVER

                          VSFTPD-SERVER
    ============================================
FTP  - File  Transfer  Protocol

Port no. - 20/21

Package  - vsftpd

Daemon   - vsftpd

----------------------------

                               THE BASIC CONCEPT OF FTP-SEVER
                             *********************************************
* FTP (File Transfer Protocol ) is the generic term for a group of computer programs aimed at facilitating the transfer of files or data from one computer to another. It originated in the "Massachusetts Institute of Technology " (MIT) in the early 1970s.

FTP Concepts and Definitions

  The key definition to remember is the term "protocol," which means a set of rules or standards that govern the interactions between computers. It is a key component in many terms that are now taken for granted: FTP which, as has been said, sets the rules for transferring files between computers.

FTP transfer data in 2 forms 'ASCII' and  'Binary'
  ASCII (American Standard code for Information Interchange), codes text nto binary (e.g. 0 or 1 ) sequences of 7 numbers per text item.
    e.g. A = 01000000

  
 
 Objectives of FTP were:

   1. to promote sharing of files ( computer programs and /or data),
   2. to encourage indirect or implicit (via programs ) use of remote computers,
   3. to shield a user from variations in file storage systems among hosts, and
   4. to transfer data reliably and efficiently.


--------------------------------------------------------------------------------------------------------------------------
Configuration instruction
-------------------------------------------

    *Install the package 'vsftpd'

    #yum  install  vsftpd* -y

    *Configure  the '/etc/vsftpd/vsftpd.conf'

    #vim   /etc/vsftpd/vsftpd.conf

    anonymous  - enable = yes
                = no  [ change yes = no ]
   
    userlist_enable     =yes
                =no   [ change yes = no ]                 

    :wq   save the file

    #service  vsftpd   restart

    (Note:- if we want to share other user to access for it we have to change yes =  no )

    *If = yes,  it means only anonymous can  access through ftp. If we want to that anonymous can't loging
    through 'ftp' for it we have to change  yes = no

                        yes = no

    *Add the users in FTP

     #vim /etc/vsftpd/user_list

    root                  no  - Access
                  yes - Not Access                         
    bin 
   
    daemon    

    tom

    dic

    harry

    :wq   save the  file

    #service  vsftpd    restart

    #service  network   restart

    *Add the port no. in Firewall (iptables)

    #iptabels  -I  INPUT  -s  192.168.0.0/24  -p  tcp  -m  multiport  --dport  20,21 -j  ACCEPT

            (SAME WITH 'UDP' PROTOCOL )

    #service  iptables  save

    #service  iptables  restart
=================================================

SSH-SERVER (Secure Shell Server)

                                       SSH-SERVER
                             ===============================

*SSH - stand for "secure shell" it is used to access the remote system and provide the advantage to transfer the
    data in encrypted form where 'Telnet' transfer the packets in planed text format

PORT NO -22

PACKAGE - SSHD

DEAMON  - SSHD
------------------------

*Install the 'ssd' package

    #yum   install  sshd

*Configure the '/etc/ssh/sshd_config' file

    #vim  /etc/ssh/sshd_config

    .write a new line in any where in the file

    allow users    u1

    :wq  [save the file ]

    .Mean now only 'u1' user can SSH

    #vim   /etc/ssh/sshd_config

    #X11  forwarding    no         [ if we want that ssh work not on graphic than remove # ]

    #X11  forwarding    yes     [ if we want that ssh work on graphic  remove # ]

    #vim /etc/ssh/sshd_config

    /Banner 
    /Banner  /shankar/ssh-banner [make a dir by the name 'shankar' and under this dir make a file 'ssh-banner      write any things in this file ]

    #mkdir  /shankar
   
    #vim   /shankar/ssh-banner

    "It is my server have you tryed it"


    :wq   [save the file ]


    #service sshd restart

    #chkconfig  sshd   on


     LOGIN FROM SSH
    ===============

    #ssh  -X  root@server1.deo.com
    #ssh  -Y  192.168.0.1
    #ssh  -X  192.168.0.1         [these all command for graphic login]
   
    . X and Y use for graphic mode


    #ssh  -l   user name  192.168.0.20  [login by particular user]

================================================

SAMBA-SEVER

                                SAMBA-SERVER
                   ======================================


samba - server massage block

port no. - 137,138,139,445

package  - samba

Daemon   - smb
--------------------------

* Insatall the package first

#yum install samba* -y

* Configure the "/etc/samba/smb.conf"

#vim   /etc/samba/smb.conf


* Go to the end of the line and copy the  last 7 line and past below of that

        [linux]
;       comment = RHCE
;       path = /samba
;       pliublic = yes
;       writable = yes
;       printable = no
;       write list = +staff
    browsable  = yes
    valid user = tom

    :wq   save this file and quit


#service  smb restart


* Make  a directory on  '/' for shayring the 'SAMBA'


#mkdir  /samba


* Give the full permission of this dir

  #chmod  777  /samba

  #cd  /samba
   
  #touch  file1, file2, file3   (creat some file in /samba dir. )


* Add the user for SAMBA server

  #adduser  tom

  #passwd   tom

  XXXX


  #smbpasswd  -L  -a  tom

  XXXX



* Add the all port no. in the  Iptables


  #iptabes  -I  INPUT  -s  192.168.0.0/24  -p   tcp   -m   multiport   --dport  137,138,139,445  -j   ACCEPT


            (SAME WITH 'UDP' PROTOCOL )

  #service  iptables  save

  #service  iptables  restart


  #iptables  -L  ( to show the all configuration of iptabels )



* Change the SELinux  security context

  #chcon  -t  samba_share_t  /samba

  #getsebool  -a |grep  samba


  #setsebool  -P samba_enable_home_dirs    on

  #setsebool  -P use_samba_home_dirs       on


  #service   smb   restart



  #chkconfig   smb    on


   FROM  CLIENT  END 
 =======================

 #smbclient  //192.168.0.1/linux  -U   tom         [ where 'linux' is public script name  and 'tom' is user]

 password  =  xxxx

 #ls


              OR


  #smbclient  192.168.0.1/linux  -U  tom%123      [where 'tom' is user and '123' is the password of user]
---------------------------------------------------------------------------------------------------------------
                                         
    (if we want to change the  user's password than run these command)

    #smbpasswd   tom             [ change the password ]

    #smbpasswd   -d   tom        [ disable the password ]

    #smbpasswd   -e   tom        [ enabale the password ]      

    #smbpasswd   -x   tom        [ to delet the users from SAMBA  server ]
       
---------------------------------------------------------------------------------------------------------------
        (if  want to check the  syntex of smb.conf than)

    #testparm   /etc/samba/smb.con   ( it will show if is there is any kind of error in configurtion file) -

   
    (we can check also from network side )

    #testparm   /etc/samba/smb.conf  server1.deo.com   domain  192.168.0.1   [enter]


   
    FROM LINUX CLIENT END
      ==============================

    #mount -t cifs //192.168.0.1/samba  /mnt -o user = username
   
     *Permanent mount through /etc/fstab

    #vi /etc/fstab
   
    //192.168.0.1/samba    mnt     cifs    username = tom    0 0

    :wq  save the file



    #mount -a

    1.share directory of samba

    2.user name
       
    3.password of user

==========================================

NIS-SERRVER ( Network Information Service )

                        NIS-SERVER
                   ===================


nis - Network Information Service
port no -
package -yp
Deamon -ypserv

--------------------------
*Install the 'yp' package

#yum install yp* -y

*Create the user in different home directory

#mkdir  /NIS

*Add the user for NIS server

#adduser -d  /NIS/nis1  nis1

#adduser -d /NIS/nis2   nis2

#adduser -d /NIS/nis3    nis3

*Give the password to all the users

#passwd  nis1

 XXXX

*Give the full permission to the nis home dir

#chmod -R 777 /NIS

*Share the home nis home dir in NFS

#vim /etc/export

/NIS    *(rw,syn)

:wq (save the file)

#service nfs restart

#service ypserv restart

*Give the NIS domain name

#vim /etc/sysconfig/network

NISDOMAIN = nis [name can be anything ]

:wq [save the file]

#nisdomainname nis

*creat the data base fo NIS server

#/usr/lib/yp/ypinit -m

 pres Ctrl + D  to save the data base
 press y for yes and Enter the key

 =====================================
          FROM THE CLIENT END NOW


*first configure the Authentication

#authconfig-tui

[*] NIS   next

    DOMAIN NAME  nis 
    SEVER        192.168.0.1

    [OK]
     
* Configur the  "/etc/auto.master "    and   "/etc/auto.misc "

#vim   /etc/auto.misc 
   
    /misc   /etc/auto.misc        [copy this line and past below of this ]
   
    /NIS   /etc/auto.misc         [NIS - is the home dir of the uers ]

    :wq  save the file


#vim   /etc/auto.misc 

    cd        -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom        [copy this line and past below ]    

    cd        -fstype=nfs    192.168.0.1:/NIS/&

    :wq   save the file


    ( The "&" symbol is dinotes all the users , if we want the only  and one user or two user and loging
      remotly than of the place of "&" we can write the particular users name as - nis1,nis2]

   

#service  autofs restart 


[NOW WE CAN LOGING REMOTLY FROM ANY SYSTEM OF DOMAIN ]

HTTP-SERVER (Apache-server )

                                    HTTP-SEVER
                          ===============================

http  - hyper  text transfar  protocol

port no. - 80, 443

package - http

deamon  - httpd

---------------

* install the 'http' package

#yum install http*  -y

* Edit the file of /etc/httpd/conf/httpd.conf

#vim /etc/httpd/conf/httpd.conf

   
    serverAdmin root@server1.deo.com
    Documentroot /var/www/html
    ServerName  server1.deo.com
   



NameVirtual Host 192.168.0.1:80

:wq

* creat a file with .html extance

#vim  /var/www/html/index.html

 write any in the file

:wq


* Add the all port

#iptables -I INPUT -s   192.168.0.0/24 -p tcp -m multiport --dport 80,443 -j ACCEPT

    [ same with 'UDP' protocol ]

#service iptables save

#service  iptables restart

*Configure the selinux security context

#chcon -R -u system_u /var/www/httml/index.html

#chcon -R -t httpd_sys_content_t  /var/www/html/index.html

#service httpd restart
=======================================
FROM CLIENT END ACCESS THE WEBSITE

#elinks  http://192.168.0.1

       or

#elinks  www.server1.deo.com
===================================

DNS-SERVER (Domain Name Server )

                                    DNS-SERVER 
                    ========================================

DNS       - Domain  Name  Server 
 
PORT NO.  - 53, 953

BPACKAGE  - bind [barklay Internet Naming Domain ] 

DEAMON    - named   
-------------------------------------------
    IP ADD. IS  = 192.168.0.1
    FQDN        = server1.deo.com    [Where  FQDN - Fully      Qualified Domain Name ] 
    DOMAIN NAME = deo.com
    NEBIOS NAME = server1.
-------------------------------------------
    STEP (1) Configure the 'ifcfg-eth0/1' file first 
   
    #vim  /etc/sysconfig/network-scripts/ifcfg-eth0

    DEVICE=eth0
    HWADDR= 00:0C:29:84:6D:8C
    NM_CONTROLLED=no
    ONBOOT=yes
    IPADDR=192.168.0.1
    BOOTPROTO=none
    NETMASK=255.255.255.0
    DNS=192.168.0.1
    TYPE=Ethernet
    IPV6INIT=no
    USERCTL=no

    :wq  [save the file ] 


    STEP (2) Configure the "/etc/sysconfig/network"
   

    #vim  /etc/sysconfig/network
   
    NETWORKING=yes
    HOSTNAME=server1.deo.com

    :wq   [save the file ] 


    STEP (3) Configure the /etc/hosts

    #vim  /etc/hosts

    192.168.0.1    server1.deo.com        server   

    :wq  (save the file )    

    #hostname  server1.deo.com


    STEP (4) Configure the  "/etc/resolv.conf"


    search station.example.com
    nameserver   192.168.0.1
   
    :wq  [ save ] 

*Install the package of 'bind' 

    #yum install bind*  -y 

  ********************************************    

*Copy the sample file form the '/etc/named.*' in to the /var/named/chroot/etc/

    #cp -p /etc/named.*  /var/named/chroot/etc


    #cd  /var/named/chroot/etc


    #ll    (to see the all file ) 

*Configure the "named.conf" file 


    #vim  named.conf      

    liston-on  port 53 {127.0.0.1;192.168.0.1; };     (the rang of 127.0.0.1 we can keep or remove ) 

    allow-querry  { any; };  (here we can specify the particular IP range for the query like 192.168.0.0/24 )

    :wq   (now save the file for this configuration ) 



*Configure the "named.rfc1912.zones" file 


    #vim  named.rfc1912.zones  


*Copy and past the 5 line of for 'forword zone' and 5 line for 'reverse zone in named.rfc1912.zones

             [forword zone ] 

    zone  "example.com " IN  {

    type  master ;

    file "for.zone" ; 

    allow-update {none;};

    }; 


   
         [revers zone] 

    zone  "0.168.192.in-addr.arpa"  IN {

    type   master ;

    file   "rev.zone"; 

    allow-update  { none } ; 

    } 

    :wq     (save the file ) 



*Copy the file "/var/named/*  into the  " /var/named/chroot/var/named/ "


    #cp  -p /var/named/*  /var/named/chroot/var/named/


    #cd  /var/named/chroot/var/named/

    #ll   [To see the all file ] 


    #cp -p  named.localhost   for.zone

    #vim  for.zone 

    $TTL 1D

    @    IN SOA  deo.com.  root.deo.com. (            [ give only domain name not netbios name ] 

            0    ;serial
            1D    ;refresh
            1H    ;retry
            1W    ;expire
            3H)     ;minim    IN   NS       
           
    @    IN    NS    server1.deo.com.

    server1 IN    A    192.168.0.1

    :wq   (save the file ) 




    #cp -p named.loopback   rev.zone

    #vim  rev.zone 

    $TTL  1D

    @    IN SOA  deo.com.  root.deo.com. (

            0    ;serial
            1D    ;refresh
            1H    ;retry
            1W    ;expire
            3H)    ;minimum

    @    IN    NS    server1.deo.com. 
       
    1    IN    PTR    server1.deo.com.      [where  "1" is the last ip add of the server 192.168.0.1] 


    :wq   [save the file ] 
           

    #service  named restart  



    CLIENT SIDE 
=========================


* Configure the "/etc/resolv.conf

    #vim   /etc/resolv.conf

    search      deo.com

    nameserver  192.168.0.1   

    :wq  [ save the file ] 


   
    #nslookup  server1.deo.com

    server:        192.168.0.1

    Addres:        192.168.0.1#53



    #dig   -x   192.168.0.1 

        or 

    #dig   server1.deo.com


==============================

NFS (Network File System )

NFS Server
--------------------
package - nfs-utils
demone- nfs
NAME
       nfs - fstab format and options for the nfs file systems
SYNOPSIS
       /etc/fstab

DESCRIPTION
 NFS is an Internet Standard protocol created by Sun Micro systems in 1984. NFS was developed to allow file sharing between systems residing on a local area network.  The Linux NFS client supports three versions of the NFS proto-col: NFS version 2 [RFC1094], NFS version 3 [RFC1813], and NFS version 4 [RFC3530].
     
Network File System (NFS) protocol allow Linux client to mount remote file systems and interact with those file systems as they are mounted locally.
* NFS was developed by Sun Microsystems in 1980
* NFS stand for Network File System
* NFS is used to share files and printer between Linux / Unix systems
* Red Hat Enterprise Linux 6 supports NFSv2, NFSv3, and NFSv4 clients.
By default RHEL6 use NFSv4 if the server supports it.
 
NFSv1
=======
NFSv1 was the development stage of NFS protocol. It was used only for in house experimental purpose. When a stable version of NFS was ready, Developers decided to release it as the new version of NFS known as NFSv2.

NFSv2
=======
NFSv2 supports only 32 bit.
NFSv2 only allowed the first 2 GB of a file to be read
NFSv2 operated only over UDP

NFSv3
=======
NFSv3 supports 64 bit file system.
NFSv3 can handle files larger than 2 GB.
NFSv3 supports asynchronous writes on the server. asynchronous writes improve write performance.
NFSv3 supports additional file attributes in many replies, to avoid the need to re-fetch them.
NFSv3 supports READDIRPLUS operation. READDIRPLUS operation get file handles and attributes along with file names when scanning a directory.
NFSv3 supports TCP. Using TCP as a transport made NFS over a WAN more feasible.

NFSv4
=======
NFSv4 retains all NFSv3 advantages.
NFSv4 supports ACLs.
NFSv4 uses the virtual file system to present the server's export.
NFSv4 supports Pseudo file system. Pseudo File System provide maximum flexibility. Exports Pathname on servers can be changed transparently to clients.
NFSv4 have locking operations as the part of protocol which keep track of open files and delegations.
NFSv4 works through firewalls and on the Internet.
------------------------------------------------
Configure NFS Server in RHEL6
**********************************
NFS - Network File System

Port no. - 2049

Package - nfs-utils

Deamon  - nfs
------------------------------------------------
*set  the static IP for the Server first

#service network restart
 
Our first task is to install the necessary RPM. Two RPM are required for NFS server

>nfs-utils
>rpcbind

nfs-utils
-----------
This is the main RPM which provide nfs service.

rpcbind
********
NFS depends on Remote Procedure Calls(RPC) service which is controlled by rpcbind service. In earlier version of RHEL portmap service was used to map RPC program numbers to IP address port number combinations. This service is now replaced by rpcbind to enable IPv6 support.
If you do not have above RPM installed, than first install them. You can use any method to install RPM.
"NFS file server" is the primary group associated with NFS. So if you have configured yum repository than following

*command will install the mandatory packages[nfs-utils and nfs4-acl-tools] from that group.

#yum   groupinstall  " NFS file server"

*Or alternatively you can use

# yum install nfs* -y

If you do not have yum repository use RPM command to install these packages. Go in the folder which contain RPM (In installation disk of RHEL6, Package folder contains all RPM ) and run following command.

#rpm -ivh nfs* --nodeps --force
#rpm -ivh rpcbind* --nodeps --force

*second task is to verify that the NFS services are installed. This can be done from following command.

#rpm –qa nfs-utils

*Verify that rpcbind package is installed.

#rpm  -qa   rpcbind

*Following services are associated with NFS daemons. Each service have its script file stored in init.d directory.

etc/init.d/nfs Main control script for NFS Daemons which control NFS services.
/etc/init.d/nfslock Script for lock files and the statd daemon, which locks and provides status of files those are currently in use.
/etc/init.d/portreserve Replacement script for the portmap which used to set up ports for RPC services.
/etc/init.d/rpcbind RPC program number converter.
/etc/init.d/rpcgssd Script for RPC-related security services.
/etc/init.d/rpcidmapd Configuration script used for mapping of NFS user ID to LDAP and Kerberos systems.
/etc/init.d/rpcsvcgssd Control script for the server side of RPC-related general security services.

*You can start each script directly by following command

#/etc/init.d/[script name]

*For example to start nfs service

#/etc/init.d/nfs

*Or you can use service command to start / stop /restart the service

#service nfs start

*nfs and rpcbind are the compulsory services for nfs daemons.
Make sure nfs and rpcbind scripts are active before you configure NFS server.

*How to create NFS Share

*On Server /etc/exportfs defines what resources will be available for clients.
/etc/exports file use following syntax to share resources.

*Make direcotry to share on the NFS-Server and give the full permission to these directory to access from Client end.

#mkdir  tom dic harry

#chmod  777  tom
#chmod  777  dic
#chmod  777  harry

*Make the Entry of these direcotry in  "/etc/exports"

    #vim    /etc/exports   (NFS sharing configuration file)
 
    Ex. - [mountpoint] [host][permissions/options]
 
*Remember there is no space between the [host] field and the [permissions/options] field.
If you include a space, you receive a syntax error.
 
Common Mount permission options
------------------------------------------------------------------
*rw read/write permissions
*ro Sread-only permissions
*insecure Allows the use of ports over 1024
*sync Specifies that all changes must be written to disk before a command completes
*no_wdelay Forces the writing of changes immediately
*root_squash Prevents root users
-------------------------------------------------------------------
NFS Host Entries
-------------------------------------------------------------------
/etc/exportfs supports conventional wildcards which provide flexibility when specifying hosts.
you can use the hostname for hosts within your domain.
you need fully qualified domain name for outside hosts.
you can reference all the hosts within a specific domain.
You can use the * for the host segment, followed by the domain name for the network, such as *.example.com for all the hosts in the example.com network.
Instead of host name, You can also use single host's ip address.
you can use IP network addresses with a CNDR format
You can also use an NIS netgroup name to reference a collection of hosts. The NIS netgroup name is preceded by an @ sign.
For example following are the valid example for hosts entries
  ---------------------
  For Example.
  ---------------------
directory     host(options)
/nfs_share *(rw,sync)
/nfs_share *.example.com(rw,sync)
/nfs_share 192.168.1.10(rw,sync)
/nfs_share 192.168.1.0/255.255.255.0(rw,sync)
/nfs_share 192.168.1.0/24(rw,sync)
/nfs_share @netgroup(rw,sync
  ---------------------------------------------------------------------------------------

    /tom     *(rw,syn,root-squesh) (Where '*' indicates that all range of IP can read/write & syncronise this data.)

    /dic    *(ro,sync)

    /harry   192.168.0.1(rw,sync)   (Here only "192.168.0.1" ip can read/write and synchronaise)

    :wq   (save the file )

  #service nfs restart

  #chkconfig  nfs  on
 
 
*Show the mounted dir,
--------------------------------------
showmount command with -e option will display shared NFS directories locally and remotely. To review the export list for a NFS server, add the name /IP address of NFS server. If this command doesn't work, communication may be blocked with a firewall.

    #showmount  -e  192.168.0.1
   
*During the exam you may face two common errors as the output of showmount -e command
on NfS server

#showmount  -e  192.168.0.1

*on NfS server

#clnt_create: RPC: Program not registered

(On server this is generated due to order of services. In exam always start /restart rpcbind service before nfs)

*on NFS client

#clnt_create: RPC: Port mapper failure - Unable to receive: errno 113 (No route to host)

(On client this is generated due to firewall configured on NFS server. On linuxclient system use showmount to list all NFS Share)

"clnt_create: RPC: Port mapper failure - Unable to receive: errno 113 (No route to host)"

*showmount -e command returns above error on NFS client if firewall is not properly configured on NFS Server.


*Configure IPTABLES rules for NFS Server.
-----------------------------------------------------------------
During the RHCE6 exam you may have a iptable firewall enabled system. You should know how to allow nfs through firewall.

*NFS port range

*In order to allow NFS through iptable firewall we need to open following ports
TCP and UDP port 2049 for NFS.
TCP and UDP port 111 (rpcbind/sunrpc).
TCP and UDP port specified with MOUNTD_PORT="port"
TCP and UDP port specified with STATD_PORT="port"
TCP port specified with LOCKD_TCPPORT="port"
UDP port specified with LOCKD_UDPPORT="port"
*NFS requires rpcbind, which dynamically assigns ports for RPC services at startup time. Dynamic ports could not be protected by iptables as these ports might change on reboot and make changes obsolete.

*So you need to configure NFS services to use fixed ports.

Open /etc/sysconfig/nfs

*Here is the sample listing with default port number

LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
RQUOTAD_PORT=875
STATD_PORT=662
STATD_OUTGOING_PORT=2020
--------------------------------------------------------------------------------------------------  
*Add the all port in the firewall (iptable)

  *Configure the '/etc/sysconfig/nfs

  #vim  /etc/sysconfig/nfs
 
    LOCKD-TCP    4001
    LOCKD-UDP    4002
    MOUNTD        4003
    STATD              4004
    STATD-OUTGOING  4005
    RQUOTAD-PORT    4006
 
    :wq   save the file

*Now  configure firewall to allow nfs traffic

*Run setup command

#setup

(Select firewall configuration)
(Select Customize [Make sure firewall option remain selected )
(Select NFS4)
(Select Forward and press enter)
(Select eth+ and press enter on close button)
(Select ok and press enter)
(Select Yes and press enter)
(Select Quit and press enter)

*Now open /etc/sysconfig/iptables file

#vim /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 111 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 32803 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 32769 -j ACCEPT
-A INPUT  -m state --state NEW -m tcp -p tcp --dport 892 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 892 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 875 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 875 -j ACCEPT
-A INPUT  -m state --state NEW -m tcp -p tcp --dport 662 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 662 -j ACCEPT

#iptables  -I INPUT -s  192.168.0.0/24  -p tcp  -m multiport  --dport  4001,4002,4003,4005,4006, -j ACCEP    T

         [ SAME WITH 'UDP' ]          

    #service  iptables   save

    #service  iptables   restart

    #service  nfs    restart

NFS and SELinux
---------------------------

#getsebool   -a   |grep    nfs [ To check the boolen value for NFS]

*SELinux is the integral part of RHEL6 and directories shared via NFS would not work without proper changes to SELinux.
Important SELinux Booleans for NFS

nfs_export_all_ro Allows NFS to share files and directories as read-only
nfs_export_all_rw Allows NFS to share files and directories as read/write
httpd_use_nfs Allows httpd to access NFS file systems
use_nfs_home_dirs Supports NFS home directories
samba_share_nfs Allows Samba to export NFS volumes
allow_nfsd_anon_write Allows NFS servers to modify public files
allow_ftpd_usr_nfs Allows FTP servers to use NFS for public file transfer services

During the exam Make sure the SELinux booleans are compatible, specifically nfs_export_all_ro and nfs_export_all_rw are set to on

*If nfs_export_all_ro and nfs_export_all_rw Booleans are set to off change the value to ON.

#setsebool  -p nfs_export_all_rw=1
#setsebool  -p nfs_export_all_ro=1

*Verify the boolen value again

#getsebool  -a  |grep   nfs

*Restart the iptables , rpcbind, and nfs service

#service iptables  restart

#service  rpcbind  restart

#service  nfs   restart

*Now try again to run showmount -e command on NFS client

#showmount  -e  192.168.0.1

*If we add any dir. to share in the NFS-Server or made any changes in NFS-server - need to restart the  server.

*But in real world I would recommended to use "exportfs" to manually export the directories rather than restart the service because  while you restart the nfs service, you also disconnect your nfs clients as well.

*So use the "exportfs" command to manually export any new resources added to the /etc/exports file.

-a Exports directories
-r Reexports directories
-u Unexports directories
-v Show verbose output

#exportfs  -a

NFS Tools
---------------
*During the exam following commands could be helpful for troubleshooting

#mountstats Shows information about mounted NFS shares
#nfsstat Shows statistics of exported resources
#nfsiostat Shows statistics of NFS mounted shares
-------------------------------------------------------------------------------------------
CLIENT END
===========
#showmount  -e  192.168.0.1

    #mount 192.168.0.1:/tom /mnt

    #cd  /mnt

    #ls
=================================================================
Troubleshooting of NFS-Server and common query
=================================================================
NFS Server Interview Questions And Answers for Linux admin

Q: - Explain this entry /shared 192.168.1.0/255.255.255.0(sync,rw)?

allows all systems with 192.168.1.* IP addresses read-write access to the /shared/ directory:

Q: - What will happened if a space is given in between allowed_hosts and (options)?

If a space is included, the options are applied to any and all IP addresses, which can be quite dangerous if write permission is granted.

Q: - What is the role of "sync" option for NFS server ?

If sync is specified, the server waits until the request is written to disk before responding to the client. The sync option is recommended because it follows the NFS protocol.

Q: - How to retrieve a list of clients connected to the NFS server ?

To retrieve a list of clients connected to the NFS server, use the showmount command
from a shell prompt. To also show the directories the clients are connected to, use the
showmount -a command.

Q: - Name of Configuration file for NFS Server ?

/etc/exports

Q: - What is meaning of "no_root_squash" option ?

Treat remote root user as local root. Do not map requests from root to the anony-
mous user and group ID.

Q: - What is NFS ?

NFS stands for Network File System. NFS was originally developed by Sun Microsystems in the 1980's. NFS allows remote hosts to mount file systems over a network and interact with those file systems as though they are mounted locally. This enables system administrators to consolidate resources onto centralized servers on the network.

Q: - Which NFS versions are available ?

NFS Version 2
NFS Version 3
NFS Version 4

Q: - What is different between NFS Version 2 & 3 ?

nfs 2 default 8kb transfer rate,it did not check the authentication at the time connection.client wants to access unauthorized file it shows error messages like "write error","read error" nfs 3 32kb transfer rate. It check at the time connection- ACL Support.

Q: - Can we grant access by Username and password for nfs share?

No, access is granted only for IP address.

Q: - What is the role of "all_squash" option?

Treat all client users as anonymous users. Map all user and group IDs to the anonymous user and group ID.

Q: - What is the role of "root_squash" option?

All requests from the user root are translated or mapped as if they came from the user anonymous (default).

Q: - Explain option "all_squash"?

The UID and GID of exported files are mapped to the user anonymous. It is good for public directories.

Q: - Explain "exportfs" command?

The exportfs command is used to maintain the current table of exported file systems for NFS.

Q: - Explain command "/usr/sbin/exportfs -f"?

It will flush everything out of the kernels export table. Any clients that are active will get new entries added by mountd when they make their next request.

Q: - Which option is used with exportfs command to display the current export list, also displays the list of export options?

exportfs -v

Q: - Which option is used with exportfs command to re-export all directories?

exportfs -r

Q: - How you will export directory (/data) to host 192.168.1.51, allowing asynchronous writes without adding the entry in /etc/exports file?

 # exportfs -o async 192.168.1.51:/data

Q: - Is rpc.mountd daemon supports TCP_WRAPPERS?

Yes, The rpc.mountd daemon is protected by the tcp_wrappers. You have to give the clients access to rpc.mountd if they should be allowed to use NFS Server.

Q: - Explain "nfsstat" command?

The nfsstat command displays the statistics about NFS client and NFS server activity.

Q: - What do you understand by "nfsstat -o all -234" command?

It will Show all information about all versions of NFS.

Q: - What do you understand by "nfsstat --nfs --server -3" command?

It will show statistics for NFS version 3 server.

Q: - Can NFS share mounted on Window XP and Justify your answer?

No, Window XP operating system doesn’t support nfs protocol.

Q: - 192.168.1.51:/data is exported by NFS Server and i want to add this NFS share to client /etc/fstab file. How you will add this entry in /etc/fstab file?

# device                      mount-point     fs-type     options      dump   fsckorder
192.168.1.51:/data            /mnt           nfs               rw              0         0

Q: - Explain "Soft Mounting" option at NFS Client?

if a file request fails, the NFS client will report an error to the process on the client machine requesting the file access. if it cannot be satisfied (for example, the server is down), then it quits. This is called soft mounting.

Q: - Explain "Hard Mounting" option at NFS Client?

If a file request fails, the NFS client will report an error to the process on the client machine requesting the file access. if it cannot be satisfied, then it will not quit until the request is satisfied. This is called Hard mounting.

Q: - What is "portmap"?

The portmapper keeps a list of what services are running on what ports. This list is used by a connecting machine to see what ports it wants to talk to access certain services.

Q: - How you will check "portmap" service is running or not?

rpcinfo -p

Q: - I am unable to mount a NFS share. How will you trace out the reason?

Firstly, check that you have permissions to mount nfs share or not. Check /etc/exports file.
Secondly you can get RPC error: Program Not Registered (or another "RPC" error)
For this check your NFS server and portmap service running or not by "rpcinfo -p"

Q: - Can I modify export permissions without needing to remount clients in order to have them take effect?

Yes. The safest thing to do is edit /etc/exports and run "exportfs -r".
--------------------------------------------------------------------------------------------------
Common-NFS-Errors & Solutions
====================

Common NFS errors & solutions:
**********************************

1."Server Not Responding" Message

2.  "Access Denied" Message

3."Permission Denied" Message

4.  "Device Busy" Message


Error 1:   If You Receive an NFS "Server Not Responding" Message
-----------------------------------------------------------------------------------------------------
ping the nfs server from client

1.ping "nfs serer name or ip"

2./usr/bin/rpcinfo -p servername

The rpcinfo command should display the following processes:

    * portmap
    * nfs
    * mountd
    * status
    * nlockmgr
    * llockmgr

If any of these processes is not running, follow the below steps:

(I).Make sure the /etc/rc.config.d/nfsconf file on the NFS server contains the following lines:

NFS_SERVER=1
START_MOUNTD=1

(II).Make sure that the /etc/inetd.conf file on the NFS server does not contain a line to start rpc.mountd.
If it does, make sure the START_MOUNTD variable in /etc/rc.config.d/nfsconf is set to 0.

(III).Issue the following command on the NFS server to start all the necessary NFS processes:

#/sbin/init.d/nfs.server start


Error 2:   If You Receive an "Access Denied" Message
------------------------------------------------------------------------------

(I).check the FS is exported or not

#/usr/sbin/showmount -e server_name

(If it is not exported means u have to edit /etc/exports file in NFS server and put the necessary entry and
then run the command

#/usr/sbin/exportfs  -a


Error 3 :If You Receive a "Permission Denied" Message
--------------------------------------------------------------------------------

(I).Check the mount options in the /etc/fstab file on the NFS client. A directory you are attempting to write to may have
been mounted read-only.

(II).Issue the ls -l command to check the HP-UX permissions on the server directory and on the client directory
that is the mount point. You may not be allowed access to the directory.

(III).Issue the following command on the NFS server:

#/usr/sbin/exportfs

Or, issue the following command on the NFS client:

#/usr/sbin/showmount -e server_name

(IV). Check the export permissions on the exported directory. The directory may have been exported read-only to your client.
The system administrator of the NFS server can use the remount mount
option to mount the directory read/write without unmounting it


Error 4 : If You Receive a "Device Busy" Message
------------------------------------------------------------------------

(I) .If you received the "device busy" message while attempting to mount a directory, try to access the mounted directory.
  If you can access it, then it is already mounted.

(II).If you received the "device busy" message while attempting to unmount a directory, a user or process is currently using the directory. Wait until the process completes, or follow these steps:


 1.Issue the following command to determine who is using the mounted directory:

#/usr/sbin/fuser -cu local_mount_point

   The fuser(1M) command will return a list of process IDs and user names that are currently using the directory
   mounted under local_mount_point. This will help you decide whether to kill the processes or wait for them to complete.

 2. To kill all processes using the mounted directory, issue the following command:

            /usr/sbin/fuser -ck local_mount_point

 3. Try again to unmount the directory.
-----------------------------------------------------------------------------------------