Wednesday, 4 September 2013

Configuring FTP (Download/Upload)


  1. Anonymous Download
    1. #yum install vsftpd
    2. #service vsftpd restart
    3. #chkconfig vsftpd on
  2. Local User Download
    1. #getsebool -a | grep ftp
    2. #setsebool -P ftp_home_dir on
    3. #yum install ftp
    4. #ftp localhost/<IP>
  3. Upload
    1. #vim /etc/vsftpd/vsftpd.conf
      1. Line 27, --> Uncomment
      2. anon_upload_enable=yes
    2. #mkdir /var/ftp/upload
    3. #chmod g+w /var/ftp/upload
    4. #chgrp ftp /var/ftp/upload
    5. Check the content,
      1. #ls -ldZ /var/ftp/upload      ---> public_content_t
    6. Change the content
      1. #chcon -t public_content_rw_t /var/ftp/upload
    7. Change the boolean
      1. #getsebool -a | grep ftp
      2. #setsebool -P allow_ftpd_anon_write on
    8. #service vsftpd restart
  4. Verification
  5. #cd /root
  6. #ftp localhost/<IP>
  7. #ls ---> pub & upload
  8. #cd upload
  9. #mput install.log
  10. Iptable Rules
    1. Clients outside example.com should not have access to your FTP service (IP & subnet will be given)
      1. #iptables -I INPUT ! -s example.com -p tcp --dport 21 -j REJECT


Export a directory via NFS

  1. Create a directory eg. /comon
    1. #mkdir /common
  2. Install package
    1. #yum install nfs-utils
  3. Change Mode(chmod) of the directory
    1. #chmod 777 /common
  4. Make entry in the /etc/exports file
    1. #vim /etc/exports
      1. (r,w) access only to 192.168.0.1 Network
        1. /common         192.168.0.1/255.255.255.0(rw,sync)
      2. (r) access to all
        1. /common         *(ro,sync)
      3. give access to root on host 192.168.0.25
        1. /common          192.168.0.25(rw,no_root_sqash,sync)
      4. NFS to example.com domain only
        1. /common          *.example.com(rw,sync)
  5. Save & quit
  6. Restart nfs
    1. #service nfs restart
  7. #chkconfig nfs on
  8. To verify,
    1. Virtual M/c   #showmount -e localhost




Tuesday, 3 September 2013

Configuring SSH

1: Search if the package is laready installed.
     #rpm -qa | grep ssh

2:   #yum search ssh
3:   #yum install openssh-server
4:  Make sure you flush iptables before setting any new iptables rule
5: Don't flush your iptables in the middle/end else all your set iptables
    #iptables -F
    #service iptables save
    #service iptables restart

Setting IPTABLE Rules

6: Clients within remote.test should not have SSH access to your system

  #iptables -I INPUT -s <remote.test n/w address> -p tcp --dport 22 j REJECT

7: Only 192.168.0.1/255.255.255.0 should have SSH access

  #iptables -I INPUT ! -s 192.168.0.1/255.255.255.0 -p tcp --dport 22 -j REJECT

8: 192.168.0.1/255.255.255.0 should have SSH access

  #iptables -I INPUT -s 192.168.0.1/255.255.255.0 -p tcp --dport 22 -j ACCEPT

Automounting of iso file/CD-ROM

1: Download the .iso file
        #wget <file_name>
2: Mount Point should be given
3: Make /etc/fstab entry

  #vim /etc/fstab
   /root/image.iso        /mnt       iso9660         loop,ro        0 0

4: save & quit
5:    #mount -a

Configuring SELinux

#vim /etc/sysconfig/selinux

Ensure selinux is in enforcing mode.





Saturday, 6 July 2013

Installing New Kernel


  1. You will be given the ftp URL where the kernel is available.
  2. Open that URL in different tab
  3. Note down your current kernel name in PAPER (#uname -r)
  4. Download all the kernel files(kernel-*) using #wget from the given URL i.e. opened in different tab of base m/c
  5. Note: Ideally 2 files will be there inside the kernel directory of the given URL: eg
  6. 1: kernel-<version>.rpm
  7. 2: kernel-firmware-<version>.rpm
  8. write down the new kernel version which is going to be installed in the PAPER
  9. It will be downloaded into the current directory
  10. Install it using #rpm
  11. #rpm -ivh kernrl-* --force     --->may take 2-3 mins to install
  12. Check in file
  13. #vim /boot/grub/grub.conf
  14. <you will see 2 kernels in the kernel/Title section, old & new. For the system to install with new kernel, defaults=0 (zero) , so first one should be the new kernel which is required>
  15. #reboot
  16. To verify press esc and verify your kernel name which is going to boot.
  17. After booting is done, verify the new kernel (#uname -r)

Friday, 5 July 2013

Configure variable=value(sysvctl=1) in kernel Parameter

In exam question would be asked to ensure sysvctl=1 is available as a kernel parameter and it should reflect in /proc/cmdline

Make the corresponding changes in
#vim /boot/grub/grub.conf
<update the required thing eg . sysvctl=1 at the end of kernel section,>
save & quit
Note: This question will come after installing the new kernel question