LINUX SYSTEM ADMINISTRATOR PRACTICAL
PRACTICAL NO :1 Graphical User Interface and Command
           Line Interface and Processes
A) Exploring the Graphical Desktop
B) Basic Command
1.ifconfig
2. vim/vi :
Press i –> to write context
To quit and save – > esc :wq!
3. hostname :
4. chmod
First is symbolic mode
Second is octal mode
5. mkdir
6. a) ls
  b) ls –a
7.cat
Cat > [filename]
                To save and quit =crl+d
                Concat 2 files and store in file
                View the context of file
8. Pwd
9. Man
To exit =q
10. Cal
11. History
12. Touch
13. cp
14. mkdir
15. mv
               rename the file using mv
16. rm
               Remove forcefully = with contect
17. head
18. tail
20. sort
              sort –n = by number
21. grep = to search the keyword in a context
              To search that donot match the pattern = -v
              To display the number line =-n
22. Runlevel
 Practical No 2. Storage Devices and Links, Backup
                               and Repository
a) Mounting Unmounting Devices
   1]To Mounting a Device
         Connect your Device(Say Pen drive) and insert it.
         To check in Virtual Machine, use ‘df’ command
b) Creating Links and Backups
Create a File using cat command : file Kitty .
             Create a Symbolic Link
             Checking the symbolic Link
             Creating HardLink of a File
 Delete and check the contents using hard link
b) Making a Backup
    Create a Tar File
    Go to check contents -> cd tmp , ls
    For testing -> [root@localhost tmp]#tar -tvf /tmp/etc.tar
    For Extracting
            [root@localhost temp]# tar -xvf /tmp/etc.tar
c) Creating a Repository
     Create a Directory with the Name of ‘repo’ using ‘mkdir’ command
     For The Package Installing - > cd /media/RHEL_6.0\ i386\ Disc\ 1/Pakages/
     Copy the Contents into ‘repo folder’
     Creating own repository -> repo
     Working with yum
     cat /etc/yum.repos.d/rhel-source.repo
     gedit /etc/yum.repos.d/repo.repo
     yum search nmap
      Practical No 3: Working with RPMs Storage and
                                 Networking
c) Configuring and Managing Storage
   Creating new partition
   Command to inform kernel about new partition
   Partition created
   informing hard disk
   Creating a directory
   Mount the partition in /etc/fstab
   unmounting created partition
   Command to inform kernel to delete partition
      Checking
C) Connecting to the Network
      Run setup command  [root@localhost Packages]#setup
Choose Network Configuration              Choose Device Configuration
      Choose eth0
   Press space after coming to Use DHCP Configuration
    Enter IP Address, Subnet Mask
   Use ifconfig command
Practical No 4. Working with Users, Groups, and
                  Permissions
   Adding user and changing password
   Deleting the user
    Making a normal user as a root user
    Changing the password policy for the Acting root user
    Lock and unlock password
    Adding Groups
Practical No 6. Firewall and Cryptographic services
a Securing Server with iptables
     List the current iptables
     Remove all iptables rules
     Change the default chain Policy to ACCEPT
     For incoming packets:-
     For outging packets:-
     For forward packets:-
   Change the default chain Policy to DROP
   For incoming packets:-
   For outging packets:-
   For forward packets:-
   Add drop rules For incoming packets:-
   For outing packets:-
   For forward packets:-
   Allow incoming ssh connections from specific IP address
   Iptables to reject incoming ssh connections
      Allow incoming ssh connection
      Allow outgoing ssh connection from a specific IP address
                                                                                     Allo
w outgoing ssh (ESTABLISHED state only) connection (for the corresponding incoming
      SSH connection request)
      Iptables to drop incoming ping requests
   Iptables to drop outgoing telnet connections
   Iptables to reject outgoing telnet connections
 Practical No 7. Configuring Server for File Sharing
a) Configuring NFS Server and Client
     Setting Up NFS Server: Verify the package of NFS whether installed .
     Verify IP address of the linux machine to be set up as NFS Server:
     Make a directory to be exported , create few files into it and give it full
      permission
     Open The configuration File and write the following lines under it:
                                         and restart the nfs service.
   Stop the Firewalls and check the status whether it is stopped
   Showmount command shows you all shared directories in given IP address.
    -----showmount -e 192.168.1.3
   As NFS Client make a directory /clientnfs and mount the server exported
    directory on it.
      Try to create new dile in client side.
b) Configuring Samba
VmNet1 configuration
      Vmware configuration
      Go to Packages Folder, and install samba with rpm command
      To query whether samba packages installed
      Go to home directory, create folder tysamba
       Create files using touch or cat command
    1. Also give this directory full permission.
    2. Open the configuration file
On line 74 change MYGROUP-> workgroup
On line 79, change IP address as shown below
Go to the last line and edit the changes
   Start the samba services
   Use testparm command
   Block firewalls
   To give temporary read only permissions
   In this file home directory is off To make it on copy first line and paste with setsebool
    command as follows
   Start and restart smb services
   Create a samba user and assign password
   Start and restart smb services
In windows, go to start-> run and type
Goto Windows Run Command Typeping192.168.1.3–t and Check whether reply
and response is working fine
Now to check whether files are been transferred from Samba to Windows Run- >\\192.168.1.3
c) Configuring FTP
       Verify the if all 5 packages vsftpd for FTP is installed :
                                         Only 3
   If not installed do below command.
   All 5 nfs packages installed
   Now use following command to start vsftpd services at boot time using
    chkconfig command.
   Verify IP address of linux machine to be configured as FTP.
   Open the configuration file and make the following changes:
       1. Uncomment anonymous_enable=YES
       2. Uncomment local_enable=YES
       3. Uncomment anonymous_upload_enable=YES
       4. Uncomment listen=YES and restart vsftpd service.
   Login with anonymous user. Now you can login with ftp192.168.36.129
    We can use Username: anonymous and password for same is blank.
    Here you can use ls–a command to view the content of ftp home
    directory.
   Now allow ftp anonymous write enable
       o setsebool–Pallow_ftp_annon_write on or=1
   Allow System user to get access to ftp server.
       o setsebool–P ftp_home_dir on
   verify it
   By default /var/ftp is ftp user Home directory. Check the context offile
    /var/ftp/pub and change to ftp
   Now go to pub directory and create one file.
   Restart the service of vsftpd and enable it from boot. Also give full
    permission to the directory/var/ftp/pub.
   Now FTP is configure. Test as FTP client from other machine.
           PRACTICAL NO 8: DNS, DHCP and Mail Server
a) DHCP
               First we have to check whether DHCP is available on our machine or
                not that we can check with rpm command.
Go the Packages Folder and install dhcp
Check the hostname of the server
To assign IP to dhcp server DHCP server have a static IP address. First configure the IP
address192.168.1.3with netmask of 255.255.255.0 on server.
Right Click on network icon. Select Edit Connections
Select System eth0
Edit the Connections
select DHCP
To Restart the network,
Open The configuration File dhcpd.conf
Copy the files
Open the Configuration file
Change domain-name to vignesh.com and option-domain- name- server to server.vignesh.com
Uncomment Line 18
Comment line 27 and 28
Make the Change as shown Below
Save the File
Start dhcp service
stop Firewall
Stop dhcp server
To Create a Clone, we right click on the virtual machine, click Manage and then click Clone
Open Clone Machine
Right Click on Network Icon, Select Edit Connection, select system eth0
From clone Machine,
C. Setting Up a Mail Server
Install postfix
Configure to work at boot time
Edit the configuration file
Following changes needs to be done:
Restart postfix service
Stop the sendmail service
Compose mail
Login from Roman
                   Practical No 9. Web Server
a Configuring Apache on Red Hat Enterprise Linux
Client side  Go to the clone and open browser and type http://ip add
                 Practical No 10. Shell Scripts
a Use of echo command, Use of comment, Using While loop, Using
For loop, GetUser Input, Using if statement, Using Case Statement.
Shell Script :
Execute the Script :