Showing posts with label RHCSA Dumps. Show all posts
Showing posts with label RHCSA Dumps. Show all posts

Thursday, May 29, 2014

How To Resize Logical Partition (LVM) In Linux

A Red Hat Certified System Administrator (RHCSA) is able to perform the following tasks:

  • Understand and use essential tools for handling files, directories, command-line environments, and documentation
  • Operate running systems, including booting into different run levels, identifying processes, starting and stopping virtual machines, and controlling services
  • Configure local storage using partitions and logical volumes
  • Create and configure file systems and file system attributes, such as permissions, encryption, access control lists, and network file systems
  • Deploy, configure, and maintain systems, including software installation, update, and core services
  • Manage users and groups, including use of a centralized directory for authentication
  • Manage security, including basic firewall and SELinux configuration.




Resize your logical partition to 950Mb and resize your logical volume to 150Mb.

CMD:

To increase the partition size use following commands,

root@linuxstorage:~#df -h

root@linuxstorage:~#lvextend -L 950M /dev/mapper/vgsrv-home

lvextend - extend the size of a logical volume.

Resize your file system with resize2fs


root@linuxstorage:~#resize2fs /dev/mapper/vgsrv-home
CMD: 

To reduce the partition size use following commands,

root@linuxstorage:~#df -h

Unmount the partition

root@linuxstorage:~#unmount /home

Run fsck on your file system



    root@linuxstorage:~#e2fsck -f /dev/mapper/vgsrv-home
    e2fsck 1.41.12
    Pass 1: Checking inodes, blocks, and sizes
    Pass 2: Checking directory structure
    Pass 3: Checking directory connectivity
    Pass 4: Checking reference counts
    Pass 5: Checking group summary information
 


Resize your file system with resize2fs

root@linuxstorage:~#resize2fs /dev/mapper/vgsrv-home 150M

Lvreduce - reduce the size of a logical volume

root@linuxstorage:~#lvreduce -L 150M /dev/mapper/vgsrv-home


Remount the partition

root@linuxstorage:~#mount -a

How To Configure FTP Server In Linux

A Red Hat Certified System Administrator (RHCSA) is able to perform the following tasks:

  • Understand and use essential tools for handling files, directories, command-line environments, and documentation
  • Operate running systems, including booting into different run levels, identifying processes, starting and stopping virtual machines, and controlling services
  • Configure local storage using partitions and logical volumes
  • Create and configure file systems and file system attributes, such as permissions, encryption, access control lists, and network file systems
  • Deploy, configure, and maintain systems, including software installation, update, and core services
  • Manage users and groups, including use of a centralized directory for authentication
  • Manage security, including basic firewall and SELinux configuration.




Configure a FTP server which is anonymous download to all user in your network and allow the user without authentication.

CMD:

VSFTPD stands for "Very Secure FTP Daemon" is a GPL licensed FTP server for UNIX systems. It supports IPv6 and SSL. vsftpd supports explicit (since 2.0.0) and implicit (since 2.1.0) FTPS. vsftpd is the default FTP server in the Ubuntu, CentOS, Fedora, NimbleX, Slackware and RHEL Linux distributions. It is secure and extremely fast.

 It is stable. VSFTPD is a mature and trusted solution which supports virtual users with PAM (pluggable authentication modules). A virtual user is a user login which does not exist as a real login on the system in /etc/passwd and /etc/shadow file. Virtual users can therefore be more secure than real users, because a compromised account can only use the FTP server but cannot login to system to use other services such as SSH or SMTP.

root@linuxstorage:~#yum install vsftpd* -y

First install vsftpd and relative packages using yum command.

root@linuxstorage:~#vim /etc/vsftpd/vsftpd.conf

# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES

Check line number 12 in configuration. Enable anonymous_enable=YES by removing # symbol in front of it.

root@linuxstorage:~#service vsftpd restart

After changing the configuration restart and enable chkconfig service for ftp.

root@linuxstorage:~#chkconfig vsftpd on


How To Schedule Cron Job For Users In Linux

A Red Hat Certified System Administrator (RHCSA) is able to perform the following tasks:


  • Understand and use essential tools for handling files, directories, command-line environments, and documentation
  • Operate running systems, including booting into different run levels, identifying processes, starting and stopping virtual machines, and controlling services
  • Configure local storage using partitions and logical volumes
  • Create and configure file systems and file system attributes, such as permissions, encryption, access control lists, and network file systems
  • Deploy, configure, and maintain systems, including software installation, update, and core services
  • Manage users and groups, including use of a centralized directory for authentication
  • Manage security, including basic firewall and SELinux configuration.



Schedule cron job for user sowmya that every day "GoodMorning" message should be displayed at 19.27.

CMD:


root@linuxstorage:~#crontab -u sowmya -e

27             19         *              *              *              /bin/echo "hello"

:wq!

u    - Users
e    - Edit the file

32 -  Minutes
16 -  Hours ( 4 pm )
*   -  Every day
*   -  Every month
*   -  Every week                                    


wq! - save file

Cron will run every day at 7.27 pm.


root@linuxstorage:~#crontab -u sowmya -l

l = Print scheduled cron. 


root@linuxstorage:~#service crond restart

Enter the crond service in chkconfig

root@linuxstorage:~#chkconfig crond on

Wednesday, May 28, 2014

How To Configure NTP Client In Linux

A Red Hat Certified System Administrator (RHCSA) is able to perform the following tasks:



  • Understand and use essential tools for handling files, directories, command-line environments, and documentation
  • Operate running systems, including booting into different run levels, identifying processes, starting and stopping virtual machines, and controlling services
  • Configure local storage using partitions and logical volumes
  • Create and configure file systems and file system attributes, such as permissions, encryption, access control lists, and network file systems
  • Deploy, configure, and maintain systems, including software installation, update, and core services
  • Manage users and groups, including use of a centralized directory for authentication
  • Manage security, including basic firewall and SELinux configuration.



Configure NTP client


root@linuxstorage:~#system-config-date


Click the synchronize tab, Add server name (linuxstorages.com) as the table,

Click advanced option  and first option in that.


root@linuxstorage:~#service ntpd restart


Enable chkconfig for ntpd


root@linuxstorage:~#chkconfig ntpd on


Check chkconfig list of service


root@linuxstorage:~#chkconfig --list

How To Create Web Server In Linux

A Red Hat Certified System Administrator (RHCSA) is able to perform the following tasks:


  • Understand and use essential tools for handling files, directories, command-line environments, and documentation
  • Operate running systems, including booting into different run levels, identifying processes, starting and stopping virtual machines, and controlling services
  • Configure local storage using partitions and logical volumes
  • Create and configure file systems and file system attributes, such as permissions, encryption, access control lists, and network file systems
  • Deploy, configure, and maintain systems, including software installation, update, and core services
  • Manage users and groups, including use of a centralized directory for authentication
  • Manage security, including basic firewall and SELinux configuration.




Create a web server

Set document root to   /var/www/html

CMD:

root@linuxstorage:~#yum install httpd* -y

root@linuxstorage:~#vim /etc/httpd/conf/httpd.conf   (configuration path for web server)

#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

copy the last 7 line and paste in last and change all dummy host in your hostname

change document root to /var/www/html

:wq   (save file)

root@linuxstorage:~#httpd -S    (to check above configuration is correct or not)

root@linuxstorage:~#httpd -t    (to check above configuration is correct or not)

root@linuxstorage:~#cd /var/www/html     (change directory to document root )

root@linuxstorage:~#vi index.html      (add some content in index.html to check )

Restart web server service after all configuration

root@linuxstorage:~#service httpd restart

Make sure httpd service is on in chkconfig so while server restarts this service will also will start if now we should manually start the service.So please on the service in chkconfig.



root@linuxstorage:~#chkconfig httpd on 

To check the web server in command line


root@linuxstorage:~#elinks httpd://linuxstorages.com

This will display the content of index.html which means our configuration is correct.

How To Create User With Particular UUID In Linux

A Red Hat Certified System Administrator (RHCSA) is able to perform the following tasks:


  • Understand and use essential tools for handling files, directories, command-line environments, and documentation
  • Operate running systems, including booting into different run levels, identifying processes, starting and stopping virtual machines, and controlling services
  • Configure local storage using partitions and logical volumes
  • Create and configure file systems and file system attributes, such as permissions, encryption, access control lists, and network file systems
  • Deploy, configure, and maintain systems, including software installation, update, and core services
  • Manage users and groups, including use of a centralized directory for authentication
  • Manage security, including basic firewall and SELinux configuration.



 How to create a user sowmya with UUID 199


CMD
root@linuxstorage:~#useradd -u 199 sowmya

root@linuxstorage:~#id sowmya
uid=199(sowmya) gid=1001(sowmya) groups=1001(sowmya)

id - this command use to check user details.

How To Update Kernel Version In Linux

A Red Hat Certified System Administrator (RHCSA) is able to perform the following tasks:


  • Understand and use essential tools for handling files, directories, command-line environments, and documentation
  • Operate running systems, including booting into different run levels, identifying processes, starting and stopping virtual machines, and controlling services
  • Configure local storage using partitions and logical volumes
  • Create and configure file systems and file system attributes, such as permissions, encryption, access control lists, and network file systems
  • Deploy, configure, and maintain systems, including software installation, update, and core services
  • Manage users and groups, including use of a centralized directory for authentication
  • Manage security, including basic firewall and SELinux configuration.



How to  install new kernel version.

CMD

root@linuxstorage:~#yum install lftp* -y

First install ftp service in server.

* - All dependency packages for ftp.
y - Install without asking permission.

 root@linuxstorage:~#lftp 192.168.1.1 

Connect the other server using ftp service (port - 21).

root@linuxstorage:~#cd /var/newfiles

change directory which having files in it.

root@linuxstorage:~#mget kernel-*

mget - use to download file from other server to our server.

root@linuxstorage:~#bye

bye - disconnecting ftp connection.

root@linuxstorage:~#rpm -ivh kernel-firmware*

rpm - redhat package management.
i - install package.
v - verbous

First install kernel firmware.

root@linuxstorage:~#rpm -ivh kernel-debug*

now install kernel package.

root@linuxstorage:~#uname -r

check current kernel version.

root@linuxstorage:~#vim /etc/grub.conf (check the title if updated kernel is in first title or default = 0)

root@linuxstorage:~#init 0   (reboot system)

root@linuxstorage:~#uname -r

now check the kernel version after restart, new kernel version is updated.


How To Create Collaborative Directory And Set Permission In Linux

A Red Hat Certified System Administrator (RHCSA) is able to perform the following tasks:

  • Understand and use essential tools for handling files, directories, command-line environments, and documentation
  • Operate running systems, including booting into different run levels, identifying processes, starting and stopping virtual machines, and controlling services
  • Configure local storage using partitions and logical volumes
  • Create and configure file systems and file system attributes, such as permissions, encryption, access control lists, and network file systems
  • Deploy, configure, and maintain systems, including software installation, update, and core services
  • Manage users and groups, including use of a centralized directory for authentication
  • Manage security, including basic firewall and SELinux configuration.


 Create a collaborative directory /linuxstorages/data with the following:

CMD:

  root@linuxstorage:~#mkdir -p /linuxstorages/data
                            p = can create a directory from any path.

  root@linuxstorage:~#chgrp -R central /linuxstorages/data

           chgrp = changing primary group for the directory.
         
            R = recursive . changes will reflect all sub-directories and files below sharedgrp.


  root@linuxstorage:~#chmod 2070 /linuxstorages/data

          chmod - modifying permission for sharedgrp.

          2070  - Giving full permission only to group users and zero permmision for other users.

           2 - Special Permission. set group id.
           0 -  User.(zero permission).
           7 -  4+2+1 = 7 (4= read, 2 = write, 1 = execute). Group user.
           0 - Other users.(zero permission).

How To Create Swap Partition In Linux

A Red Hat Certified System Administrator (RHCSA) is able to perform the following tasks:
  • Understand and use essential tools for handling files, directories, command-line environments, and documentation
  • Operate running systems, including booting into different run levels, identifying processes, starting and stopping virtual machines, and controlling services
  • Configure local storage using partitions and logical volumes
  • Create and configure file systems and file system attributes, such as permissions, encryption, access control lists, and network file systems
  • Deploy, configure, and maintain systems, including software installation, update, and core services
  • Manage users and groups, including use of a centralized directory for authentication
  • Manage security, including basic firewall and SELinux configuration.

 






 Create swap partition with 512 mb.

CMD:
                        root@linuxstorage:~#fdisk -cu /dev/vda
          
                      -command(for help m):n   (n - to create new partition)

                      -command(for help m):e   (e - extended partition)

                      - partition number:4

                      -firstsector= press enter

                      -last sector= by default(press enter)

                       -(logical,physical)

                        l    (l -logical)

                        first sector - by default

                       last sector = +512M

                      -t (and) type - partition number is 5

                     -hex code is 82  (for linux swap)

                     --w (save)

                     root@linuxstorage:~#init 6           (restarting system )

                     root@linuxstorage:~#mkswap /dev/vda5      (formating file structure)

                     root@linuxstorage:~#swapon /dev/vda5

                     root@linuxstorage:~#vim /etc/fstab  (enter new swap partition in fstab)

                    /dev/vda5     swap      swap  defaults   0     0

                   :wq (save the file)

                    root@linuxstorage:~# mount -a      

                    root@linuxstorage:~# swapon -s (to verify swap partition)

 

© 2014 Linux Storages | Updated . All rights resevered. Designed by Templateism