tag:blogger.com,1999:blog-12072206321475347512024-03-14T15:24:07.601+05:30Linux SuperuserThis blog is all about Red Hat Enterprise Linux 6.
It contains all information about RHCE, RHCSA and System Administration. In this blog you will find all questions related to RHCSA and RHCE exam objectives and also all day to day system administration tasks.Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.comBlogger49125tag:blogger.com,1999:blog-1207220632147534751.post-37417814690958454552013-08-06T14:00:00.000+05:302013-08-06T14:00:01.929+05:30KVM - Command Line Administration<div style="text-align: justify;">
In the <b><a href="http://linuxsuperuser07.blogspot.in/2013/07/creating-kvm-virtual-machines-in-rhel6.html" target="_blank">previous</a></b> post we have created KVM virtual machine using the Virtual Machine Manager GUI. In this post we will look at command line tools which we can use for administration of KVM virtual machines. We will see how to check installed KVM guests, start or shutdown KVM guest, installation of the guest. At many times we are in situations where we do not have the X11 (Graphical) environment. In such case command line KVM administration tools comes handy.</div>
<div style="text-align: justify;">
</div>
<ul>
<li>To install a virtual machine through command line use “virt-install”</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">virt-install \</span><br />
<span style="font-family: "Courier New",Courier,monospace;">--name TESTER1 \</span><br />
<span style="font-family: "Courier New",Courier,monospace;">--ram 500 \</span><br />
<span style="font-family: "Courier New",Courier,monospace;">--vcpus=2 \</span><br />
<span style="font-family: "Courier New",Courier,monospace;">--network network=default \</span><br />
<span style="font-family: "Courier New",Courier,monospace;">--os-variant RHEL6</span></div>
</div>
<div style="text-align: justify;">
</div>
<ul>
<li>To clone a virtual guest use “virt-clone”</li>
</ul>
<div class="scrollbox" style="text-align: justify;">
<div style="width: 120%;">
<span style="font-family: "Courier New",Courier,monospace;"># virt-clone --original TESTER1 --name TESTER2 --file /var/lib/libvirt/images/TESTER2.img --mac 08:00:27:B7:08:9F</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Note</b>: If you have problems while starting network of cloned virtual machine or getting error like “<b>Device eth0 does not seem to be present, delaying initialization</b>” please check <a href="http://linuxsuperuser07.blogspot.in/2013/07/network-device-not-working-after.html" target="_blank"><b>this</b></a> post.</div>
<div style="text-align: justify;">
</div>
<ul>
<li>To check currently installed KVM guests use “virsh list --all command”</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># virsh list –all</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> Id Name State</span><br />
<span style="font-family: "Courier New",Courier,monospace;">----------------------------------------------------</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> 18 TESTER3 running</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> 19 TESTER1 running</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> - TESTER2 shut off</span></div>
</div>
<div style="text-align: justify;">
</div>
<ul>
<li>Use virt-inspector to show the version of the OS, the kernel version, what drivers are installed, mount point details, etc.</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># virt-inspector DOMAIN</span></div>
</div>
<div style="text-align: justify;">
</div>
<ul>
<li>To check cpu and memory utilization of KVM user “virt-top”</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># virt-top </span><br />
<span style="font-family: "Courier New",Courier,monospace;">virt-top 14:49:49 - x86_64 2/2CPU 3400MHz 1751MB</span><br />
<span style="font-family: "Courier New",Courier,monospace;">3 domains, 2 active, 2 running, 0 sleeping, 0 paused, 1 inactive D:0 O:0 X:0</span><br />
<span style="font-family: "Courier New",Courier,monospace;">CPU: 1.5% Mem: 1536 MB (1536 MB by guests)</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;"> ID S RDRQ WRRQ RXBY TXBY %CPU %MEM TIME NAME</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> 19 R 0 0 12K 0 1.1 29.0 7:14.45 TESTER1</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> 18 R 0 0 184 0 0.3 58.0 2:39.18 TESTER3</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> - (TESTER2)</span></div>
</div>
<div style="text-align: justify;">
</div>
<ul>
<li>To check directory contents of a guest KVM machine use “virt-ls –l –a KVM_guest_image_file directory”</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># virt-ls -l -a /Virtual/TESTER1.img /root</span><br />
<span style="font-family: "Courier New",Courier,monospace;">total 80</span><br />
<span style="font-family: "Courier New",Courier,monospace;">dr-xr-x---. 3 root root 4096 Jun 28 05:21 .</span><br />
<span style="font-family: "Courier New",Courier,monospace;">dr-xr-xr-x. 25 root root 4096 Jun 28 07:19 ..</span><br />
<span style="font-family: "Courier New",Courier,monospace;">-rw------- 1 root root 420 Jun 28 09:17 .bash_history</span><br />
<span style="font-family: "Courier New",Courier,monospace;">-rw-r--r--. 1 root root 18 May 20 2009 .bash_logout</span><br />
<span style="font-family: "Courier New",Courier,monospace;">-rw-r--r--. 1 root root 176 May 20 2009 .bash_profile</span><br />
<span style="font-family: "Courier New",Courier,monospace;">-rw-r--r--. 1 root root 176 Sep 23 2004 .bashrc</span><br />
<span style="font-family: "Courier New",Courier,monospace;">-rw-r--r--. 1 root root 100 Sep 23 2004 .cshrc</span><br />
<span style="font-family: "Courier New",Courier,monospace;">drwx------ 2 root root 4096 Jun 24 05:22 .ssh</span><br />
<span style="font-family: "Courier New",Courier,monospace;">-rw-r--r--. 1 root root 129 Dec 4 2004 .tcshrc</span><br />
<span style="font-family: "Courier New",Courier,monospace;">-rw-------. 1 root root 1364 Jun 24 04:40 anaconda-ks.cfg</span><br />
<span style="font-family: "Courier New",Courier,monospace;">-rw-r--r--. 1 root root 26876 Jun 24 04:39 install.log</span><br />
<span style="font-family: "Courier New",Courier,monospace;">-rw-r--r--. 1 root root 7572 Jun 24 04:38 install.log.syslog</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
</div>
<ul>
<li>To cat a file of KVM guest use “virt-cat –d DOMAIN filename”</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># virt-cat -d TESTER1 /etc/sysconfig/network</span><br />
<span style="font-family: "Courier New",Courier,monospace;">NETWORKING=yes</span><br />
<span style="font-family: "Courier New",Courier,monospace;">HOSTNAME=TESTER1</span></div>
</div>
<div style="text-align: justify;">
</div>
<ul>
<li>To check the mount points utilization of a KVM guest from host use “virt-df –h –d DOMAIN”</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># virt-df -h -d TESTER1</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Filesystem Size Used Available Use%</span><br />
<span style="font-family: "Courier New",Courier,monospace;">TESTER1:/dev/sda1 193M 28M 155M 15%</span><br />
<span style="font-family: "Courier New",Courier,monospace;">TESTER1:/dev/OSVG/lvroot 7.7G 1.7G 5.6G 23%</span></div>
</div>
<div style="text-align: justify;">
</div>
<ul>
<li>To find partitions, filesystem, LVM of KVM guest use “virt-filesystems -d DOMAIN</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># virt-filesystems -d TEST-LINUX1 --long --all</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Name Type VFS Label MBR Size Parent</span><br />
<span style="font-family: "Courier New",Courier,monospace;">/dev/sda1 filesystem ext4 - - 524288000 -</span><br />
<span style="font-family: "Courier New",Courier,monospace;">/dev/VolGroup/lv_root filesystem ext4 - - 10242490368 -</span><br />
<span style="font-family: "Courier New",Courier,monospace;">/dev/VolGroup/lv_swap filesystem swap - - 2113929216 -</span><br />
<span style="font-family: "Courier New",Courier,monospace;">/dev/VolGroup/lv_root lv - - - 10242490368 /dev/VolGroup</span><br />
<span style="font-family: "Courier New",Courier,monospace;">/dev/VolGroup/lv_swap lv - - - 2113929216 /dev/VolGroup</span><br />
<span style="font-family: "Courier New",Courier,monospace;">/dev/VolGroup vg - - - 12356419584 -</span><br />
<span style="font-family: "Courier New",Courier,monospace;">/dev/sda2 pv - - - 12356419584 -</span><br />
<span style="font-family: "Courier New",Courier,monospace;">/dev/sda1 partition - - 83 524288000 /dev/sda</span><br />
<span style="font-family: "Courier New",Courier,monospace;">/dev/sda2 partition - - 8e 12359565312 /dev/sda</span><br />
<span style="font-family: "Courier New",Courier,monospace;">/dev/sda device - - - 12884901888 -</span></div>
</div>
<div style="text-align: justify;">
</div>
<ul>
<li>To copy file/directory from KVM guest to host use “virt-copy-out -d DOMAIN /file|dir localdir”</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># virt-copy-out -d TESTER1 /root/testfile.txt /root</span></div>
</div>
<div style="text-align: justify;">
</div>
<ul>
<li>To copy file/directory from host to KVM guest use “virt-copy-in -d domain file|dir /destination”</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># virt-copy-in -d TESTER1 /root/testerfile1.txt /root/</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Note</b>: Using "virt-copy-in" on live virtual machines can be dangerous, potentially causing disk corruption. The virtual machine must be shutdown before you use this command.</div>
<div style="text-align: justify;">
</div>
<ul>
<li>To edit file of KVM guest use “virt-edit -d DOMAIN filename”</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># virt-edit -b .orig -d TEST-LINUX1 /root/testfile.txt</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Use –b option to make a backup of original file.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Note</b>: Using "virt-edit" on live virtual machines can be dangerous, potentially causing disk corruption. The virtual machine must be shutdown before you use this command.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
There are lots of other command line tools to administer KVM virtual machines on RHEL6.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
For any queries post comments. </div>
<div style="text-align: justify;">
<br /></div>
Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com3Mumbai, Maharashtra, India19.0759837 72.87765590000003618.595792699999997 72.232208900000032 19.5561747 73.52310290000004tag:blogger.com,1999:blog-1207220632147534751.post-16230181405712211072013-07-18T23:04:00.002+05:302013-07-20T22:13:05.834+05:30Creating KVM Virtual Machines in RHEL6.<div style="text-align: justify;"><span style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: 14px;">In this post we will discuss about packages required for KVM (Virtualization), creation of KVM virtual machine and managing those virtual machines. KVM can run multiple windows and Linux guest operating system. KVM virtualization is only available for 64 bits machines. You can’t use KVM virtualization on 34 bit architecture machines.</span></span></div><div style="text-align: justify;"><span style="font-family: "Trebuchet MS",sans-serif;"><span style="font-size: 14px;"><br />
</span></span></div><div style="text-align: justify;"><span style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: 14px;">You can install KVM virtualization environment at the time of RHEL6 installation by selecting virtual host packages. Or on currently installed RHEL6 server, you can install packages using yum. For full KVM virtualization host you will require virt-manager, libvirt libvirt-python, python-virtinst, libvirt-client.</span></span></div><div style="text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div style="text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div class="scrollbox" style="text-align: justify;"><div style="width: 110%;"><span style="font-size: 14px;"><span style="font-family: "Courier New",Courier,monospace;"># yum install –y virt-manager libvirt libvirt-python python-virtinst libvirt-client</span></span></div></div><div style="text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div style="text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;">If you don’t have yum server, you can configure it by following easy steps mentioned in <b><a href="http://linuxsuperuser07.blogspot.in/2013/03/configure-yum-server-in-redhat.html" target="_blank">this</a> </b>post.</span></span></div><div style="text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div style="text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;">After installing KVM packages you can now create new virtual machines using virt-install command or using virt-manager GUI.</span></span></div><div style="text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div style="text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;">1. Start libvirtd daemon to start KVM virtualization.</span></span></div><div style="text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div class="noscrollbox" style="text-align: justify;"><div style="width: 100%;"><span style="font-size: 14px;"><span style="font-family: "Courier New",Courier,monospace;"># /etc/init.d/libvirtd start</span></span><br />
<span style="font-size: 14px;"><span style="font-family: "Courier New",Courier,monospace;"># chkconfig libvirtd on</span></span></div></div><div style="text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div style="text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;">2. Open Applications --> System Tools --> Virtual Machine Manager. Or run virt-manager command as root user. Click on create new virtual machine button.</span></span></div><div style="text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK70h6kUjUTBd1hP5LX5eeYr2EDpKMhcdaIl1_VUbfUL3k5lKk14xDvVNfZC-82ktcU7aKkRVgZhoBwiaG1wqDmLIYTDTztY-Q3ZNBL6bxKEStlWP6J-Xeon0qi-gGtYeXa1tlMyyjbZ8/s1600/01virt-manager.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK70h6kUjUTBd1hP5LX5eeYr2EDpKMhcdaIl1_VUbfUL3k5lKk14xDvVNfZC-82ktcU7aKkRVgZhoBwiaG1wqDmLIYTDTztY-Q3ZNBL6bxKEStlWP6J-Xeon0qi-gGtYeXa1tlMyyjbZ8/s400/01virt-manager.JPG" width="382" /> </a> </span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;">3. Give name to virtual machine and select installation media option. </span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDfJHFUVyzvF2QZzH9VipMAm-aNlZzB5LxnnFzACDtMLD8DiwsrqXLm8xmS36IMStKbeL54THsPkzygdyDLqExQriN3hmVw-pCS6K2MnzT2jBby_MgqrXs27Q7z1Uwgf4cd-ZHMP3eisE/s1600/Step01.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDfJHFUVyzvF2QZzH9VipMAm-aNlZzB5LxnnFzACDtMLD8DiwsrqXLm8xmS36IMStKbeL54THsPkzygdyDLqExQriN3hmVw-pCS6K2MnzT2jBby_MgqrXs27Q7z1Uwgf4cd-ZHMP3eisE/s1600/Step01.JPG" /> </a></span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;">4. In this example we have selected ISO image as our installation media. </span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQtIf0GrJ3SXSJodaaT0cQqkek-RN_YlEOFi5DTIPygr6s0kmqkADOw95GePTHogwVaKOXNmd6Sm8O3K0RDpielKN1lkyCqfbreyhTzPQ9vEO74aOqOwPIkoXbl1VjYFKGmKLa_i0cxd0/s1600/Step02.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQtIf0GrJ3SXSJodaaT0cQqkek-RN_YlEOFi5DTIPygr6s0kmqkADOw95GePTHogwVaKOXNmd6Sm8O3K0RDpielKN1lkyCqfbreyhTzPQ9vEO74aOqOwPIkoXbl1VjYFKGmKLa_i0cxd0/s1600/Step02.JPG" /></a></span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;">5. Define RAM and CPU for the KVM virtual machine.</span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsUb4VBGQ2uuvtZsa75mrp3NCFAbKwIwiZdFn6-uOTWRa_Pw8E52zeSsYfFbdWkYCW1Pu9WQlo4xf75nLDYViMAG0qDFmT1LsHwXFqshKbyDra1Tj6JaDD3luXs27PRayAFnFtJb2U8vI/s1600/Step04.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsUb4VBGQ2uuvtZsa75mrp3NCFAbKwIwiZdFn6-uOTWRa_Pw8E52zeSsYfFbdWkYCW1Pu9WQlo4xf75nLDYViMAG0qDFmT1LsHwXFqshKbyDra1Tj6JaDD3luXs27PRayAFnFtJb2U8vI/s1600/Step04.JPG" /></a></span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;">6. Define disk size.</span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjICQiiSocOGfQr3E9dRO4pRVjQP3xVKw5nrEEE1LFbusP3Xd4Y2m4EVTlvFBNA6KaF_jqgXSSJs37newzA8vjJIbjE6szHrKMZvqjtyVX2DlajTbdpl3vHNHCR_Xt3uqUDzSvBs-tNLrw/s1600/Step05.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjICQiiSocOGfQr3E9dRO4pRVjQP3xVKw5nrEEE1LFbusP3Xd4Y2m4EVTlvFBNA6KaF_jqgXSSJs37newzA8vjJIbjE6szHrKMZvqjtyVX2DlajTbdpl3vHNHCR_Xt3uqUDzSvBs-tNLrw/s1600/Step05.JPG" /></a></span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;">7. Select network options (Bridge or NAT) as per your requirements and click finish.</span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTmmwg-fJTvmAWEwehYux2WlxyvhpJmCsuhlG0LXCH3Xqhr-fx93YRK19Od0wHHBfIAv0N6k_7-nwWKES-XPhj3EpfFtFQPFiYaO62jtVDxOz3XUJaX5JUjRVmHjS1e6rIXA6boACeQEM/s1600/Step06.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTmmwg-fJTvmAWEwehYux2WlxyvhpJmCsuhlG0LXCH3Xqhr-fx93YRK19Od0wHHBfIAv0N6k_7-nwWKES-XPhj3EpfFtFQPFiYaO62jtVDxOz3XUJaX5JUjRVmHjS1e6rIXA6boACeQEM/s1600/Step06.JPG" /></a></span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;">8. Install RHEL on the created KVM virtual guest.</span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiV8lLA_n4W1AQFKUoTEhV_Nm52RPgNBTH4jLZHGxNsiqWyBkqcaTTQvOSTisGU1B5xRSb0KK56ilnBKuDyTIRWSF1i3qR9c0qfSJjFJHg5BHNeBAjLjwYWcXUg94Qk5Tpv5CfC0N7Rlc/s1600/Step07.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="330" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiV8lLA_n4W1AQFKUoTEhV_Nm52RPgNBTH4jLZHGxNsiqWyBkqcaTTQvOSTisGU1B5xRSb0KK56ilnBKuDyTIRWSF1i3qR9c0qfSJjFJHg5BHNeBAjLjwYWcXUg94Qk5Tpv5CfC0N7Rlc/s400/Step07.JPG" width="400" /></a></span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;">For RHEL installation steps follow <a href="http://linuxsuperuser07.blogspot.in/2011/03/rhce-installation-steps.html" target="_blank"><b>this</b></a> post.</span></span></div><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;">In next post we will discuss about command line tools for administering KVM virtual machines.</span></span><br />
<span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;">Please comment if you have any questions.</span></span><br />
<div class="separator" style="clear: both; text-align: justify;"><span style="font-size: 14px;"><span style="font-family: Arial,Helvetica,sans-serif;"><br />
</span></span></div>Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0Mumbai, Maharashtra, India19.0759837 72.87765590000003618.595792699999997 72.232208900000032 19.5561747 73.52310290000004tag:blogger.com,1999:blog-1207220632147534751.post-86295022307803454502013-07-09T22:49:00.000+05:302013-07-21T16:34:53.636+05:30Network Device not working after cloning RHEL6 VM (Device eth0 does not seem to be present, delaying initialization)In this post I will give solution to one problem I faced while cloning RHEL6 virtual machine.<br />
<br />
<b>ISSUE</b>: I have installed RHEL6.2 on KVM/VMware workstation/Oracle VirtualBox. After installation I have cloned the virtual machine. And when starting cloned virtual machine I get below error while restarting the network service.<br />
<br />
<b>Device eth0 does not seem to be present, delaying initialization</b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglSQYCVq7GB8yquaGd2LghlmrGMSaApxD2IK4BrlM8G7BlMyOzZUgvsXLHsOrGbPCxe4bZ4mfeOugy6QVTnh6koD-vzQJfIxT-5ASTc6e4pYG1NSxOtpXxM-3ukNIjpjV-EZ50JqHdavg/s1600/eth0_error.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglSQYCVq7GB8yquaGd2LghlmrGMSaApxD2IK4BrlM8G7BlMyOzZUgvsXLHsOrGbPCxe4bZ4mfeOugy6QVTnh6koD-vzQJfIxT-5ASTc6e4pYG1NSxOtpXxM-3ukNIjpjV-EZ50JqHdavg/s1600/eth0_error.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
I have also removed HWADDR entry from “/etc/sysconfig/network-scripts/ifcfg-eth0”, but still I am getting the same error.<br />
<br />
<b>SOLUTION</b>: To resolve this problem follow below mentioned steps:<br />
<br />
1. As mentioned above, remove HWADDR entry form “/etc/sysconfig/network-scripts/ifcfg-eth0”.<br />
<br />
2. Take backup of file “/etc/udev/rules.d/70-persistent-net.rules” and remove all reference to eth0.<br />
<br />
Ex. <br />
<div class="scrollbox" style="text-align: justify;">
<div style="width: 143%;">
<span style="font-family: "Courier New",Courier,monospace;">[root@squid2 ~]# cp /etc/udev/rules.d/70-persistent-net.rules /root/</span><br />
<span style="font-family: "Courier New",Courier,monospace;">[root@squid2 ~]# cat /etc/udev/rules.d/70-persistent-net.rules</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br />
</span> <span style="font-family: "Courier New",Courier,monospace;"># This file was automatically generated by the /lib/udev/write_net_rules</span><br />
<span style="font-family: "Courier New",Courier,monospace;"># program, run by the persistent-net-generator.rules rules file.</span><br />
<span style="font-family: "Courier New",Courier,monospace;">#</span><br />
<span style="font-family: "Courier New",Courier,monospace;"># You can modify it, as long as you keep each rule on a single</span><br />
<span style="font-family: "Courier New",Courier,monospace;"># line, and change only the value of the NAME= key.</span><br />
<span style="font-family: "Courier New",Courier,monospace;"></span><br />
<div style="background-color: #bbdca1;">
<span style="font-family: "Courier New",Courier,monospace;"># PCI device 0x8086:0x100e (e1000)</span><br />
<span style="font-family: "Courier New",Courier,monospace;">SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:08:fa:85", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"</span><br />
<span style="font-family: "Courier New",Courier,monospace;"></span><br />
<span style="font-family: "Courier New",Courier,monospace;"># PCI device 0x8086:0x100e (e1000)</span><br />
<span style="font-family: "Courier New",Courier,monospace;">SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:b7:08:97", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"</span></div>
</div>
</div>
<br />
Entry for PCI device marked with green color is the entry for Ethernet card.<br />
<br />
3. Remove the marked entry for both PCI devices from the file “/etc/udev/rules.d/70-persistent-net.rules”.<br />
<br />
4. Restart the server.<br />
<br />
After restart, you will be able to get IP information for the Ethernet card.<br />
<br />
If you have any questions please comment.<br />
<br />Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0Mumbai, Maharashtra, India19.0759837 72.87765590000003618.595792699999997 72.232208900000032 19.5561747 73.52310290000004tag:blogger.com,1999:blog-1207220632147534751.post-21305660142009222212013-03-22T18:01:00.000+05:302013-07-21T11:41:15.744+05:30Configure YUM server to install/update packages on remote server<div style="text-align: justify;">
In the <b><a href="http://linuxsuperuser07.blogspot.in/2013/03/configure-yum-server-in-redhat.html" target="_blank">previous</a></b> post we learn how to create a YUM repository or YUM server on Redhat Enterprise Linux 6. Now if you want to use this YUM server to manage packages on other servers follow below mentioned steps.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
1. Create the YUM server as described in <a href="http://linuxsuperuser07.blogspot.in/2013/03/configure-yum-server-in-redhat.html" target="_blank"><b>previous</b></a> post.</div>
<div style="text-align: justify;">
2. Install vsftpd using yum command.</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># yum install vsftpd</span></div>
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
3. Make changes in “/etc/vsftpd/vsftpd.conf” as below.</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">anonymous_enable=YES</span><br />
<span style="font-family: "Courier New",Courier,monospace;">anon_root=/mnt</span></div>
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
4. Login to the client machine on which you want to install packages.</div>
<div style="text-align: justify;">
5. Create a .repo file in “/etc/yum.repos.d/” directory.</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># vi /etc/yum.repos.d/RHEL6.repo </span><br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">[RHEL6]</span><br />
<span style="font-family: "Courier New",Courier,monospace;">name= RHEL 6 remote repository</span><br />
<span style="font-family: "Courier New",Courier,monospace;">baseurl=file:///yum_server_ip/</span><br />
<span style="font-family: "Courier New",Courier,monospace;">enabled=1</span><br />
<span style="font-family: "Courier New",Courier,monospace;">gpgcheck=0</span></div>
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
6. Run command yum clean all.</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># yum clean all</span></div>
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
You can now use yum commands to install, remove and query packages.</div>
<div style="text-align: justify;">
<br /></div>
<div class="scrollbox" style="text-align: justify;">
<div style="width: 150%;">
<span style="font-family: "Courier New",Courier,monospace;"># yum info httpd</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;">Loaded plugins: aliases, changelog, downloadonly, kabi, presto, product-id, refresh-packagekit, security, subscription-manager, tmprepo, verify,</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> : versionlock</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Updating certificate-based repositories.</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Loading support for Red Hat kernel ABI</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Installed Packages</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Name : httpd</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Arch : x86_64</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Version : 2.2.15</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Release : 15.el6</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Size : 2.9 M</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Repo : installed</span><br />
<span style="font-family: "Courier New",Courier,monospace;">From repo : anaconda-RedHatEnterpriseLinux-201105101844.x86_64</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Summary : Apache HTTP Server</span><br />
<span style="font-family: "Courier New",Courier,monospace;">URL : http://httpd.apache.org/</span><br />
<span style="font-family: "Courier New",Courier,monospace;">License : ASL 2.0</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Description : The Apache HTTP Server is a powerful, efficient, and extensible</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> : web server.</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Please comment if you have any questions.</div>
<div style="text-align: justify;">
<br /></div>
Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0tag:blogger.com,1999:blog-1207220632147534751.post-90468178107385779452013-03-20T17:13:00.000+05:302013-07-21T16:30:51.161+05:30Configure YUM server in Redhat Enterprise Linux 6 (RHEL6)<div style="text-align: justify;">
Package management is one of the main objectives of RHCSA certification exam. Also as a system administrator you have to install, remove and update packages. In this post we will learn how to configure YUM server for package management on local machine as well as on remote machines. Yum server gives ease to package management in Linux. Using yum server you can query about installed packages, install or remove packages and upgrade or degrade packages as per your requirements.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The main configuration file for yum server is “<i><b>/etc/yum.conf</b></i>”. YUM server gets you out of which we know as “Dependency Hell”. It resolves and installs all dependencies related to a package. YUM server creates a database of packages. In this database it stores information like: all installed packages, all available packages, updates, etc. In this post we will see:</div>
<div style="text-align: justify;">
<br /></div>
<ul>
<li>How to configure local YUM server for RHEL6 DVD iso.</li>
<li>How to create YUM server to update packages through FTP.</li>
<li>How to configure YUM clients.</li>
</ul>
<div style="text-align: justify;">
<b><br />
</b></div>
<div style="text-align: justify;">
<b>STEPS TO CONFIGURE YUM SERVER.</b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In this exercise we will use RHEL6 DVD.iso. You can mount and copy contents of DVD on local server or if you don’t have enough space you can mount and directly use it as a repository. For now we will mount RHEL6 DVD.iso and use it as our repository for packages.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
1. Mount the RHEL6 DVD.iso on /mnt (you can mount it on any directory of your choice).</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># mount -o loop rhel-server-6.2-x86_64-dvd.iso /mnt</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
2. Create a new file in directory “/etc/yum.repos.d/”.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Note</b>: “/etc/yum.repos.d/” directory is default configuration directory for yum. You have to create a file with extension “.repo” and make below mentioned entries in the file.</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># vi /etc/yum.repos.d/RHEL6.repo</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br />
</span> <span style="font-family: "Courier New",Courier,monospace;">[RHEL6]</span><br />
<span style="font-family: "Courier New",Courier,monospace;">name= RHEL 6 local repository</span><br />
<span style="font-family: "Courier New",Courier,monospace;">baseurl=file:///mnt/</span><br />
<span style="font-family: "Courier New",Courier,monospace;">enabled=1</span><br />
<span style="font-family: "Courier New",Courier,monospace;">gpgcheck=0</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
3. Run command yum clean all.</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># yum clean all</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
4. You can now use yum commands to install, remove and query packages.</div>
<div style="text-align: justify;">
<br /></div>
<div class="scrollbox" style="text-align: justify;">
<div style="width: 150%;">
<span style="font-family: "Courier New",Courier,monospace;"># yum info httpd</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br />
</span> <span style="font-family: "Courier New",Courier,monospace;">Loaded plugins: aliases, changelog, downloadonly, kabi, presto, product-id, refresh-packagekit, security, subscription-manager, tmprepo, verify,<br />
</span> <span style="font-family: "Courier New",Courier,monospace;"> : versionlock<br />
</span> <span style="font-family: "Courier New",Courier,monospace;">Updating certificate-based repositories.<br />
</span> <span style="font-family: "Courier New",Courier,monospace;">Loading support for Red Hat kernel ABI<br />
</span> <span style="font-family: "Courier New",Courier,monospace;">Installed Packages</span><br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">Name : httpd</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Arch : x86_64</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Version : 2.2.15</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Release : 15.el6</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Size : 2.9 M</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Repo : installed</span><br />
<span style="font-family: "Courier New",Courier,monospace;">From repo : anaconda-RedHatEnterpriseLinux-201105101844.x86_64</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Summary : Apache HTTP Server</span><br />
<span style="font-family: "Courier New",Courier,monospace;">URL : http://httpd.apache.org/</span><br />
<span style="font-family: "Courier New",Courier,monospace;">License : ASL 2.0</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Description : The Apache HTTP Server is a powerful, efficient, and extensible</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> : web server.</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In the <a href="http://linuxsuperuser07.blogspot.in/2013/03/configure-yum-server-to-installupdate.html" target="_blank"><b>next</b></a> post we will learn how to install/update packages on a remote server form yum server.</div>
<div style="text-align: justify;">
<br /></div>
<br />Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0tag:blogger.com,1999:blog-1207220632147534751.post-69105823664154969472013-03-17T16:56:00.001+05:302013-07-21T16:30:10.505+05:30Package Management in RHEL6: YUM<div style="text-align: justify;">
Package management is one of the main objectives of RHCSA and RHCE exams on RHEL6. It is required to install and configure packages during the certification exam. In previous posts we have discussed installing package using rpm command. In Redhat Enterprise Linux 6 (RHEL6), to install a package we also have to install its dependencies.<br />
<br />
This could be a difficult process as some packages have more than 50 dependent packages so we have to find out those dependent packages and install all of them one by one, also there could be dependency for the dependency. In Linux this is called “<b>Dependency Hell</b>”. To make this process easier, we can create a local YUM server or can configure a YUM server on FTP/HTTP to make it as a centralized repository for all servers.<br />
<br />
YUM (Yellow Dog updater, modifier) maintains a database regarding the packages. This database contains information about installed packages, available packages, and automatically resolves dependencies while installing packages. The yum database is also known as repository.<br />
<br />
<b>What is a repository?</b><br />
<br />
A repository is collection of rpm packages. Repository can also include group of packages. For example RHN includes following RHEL6 repositories:<br />
<br />
Red Hat Enterprise Linux Server: This is the main repository, which includes both packages associated with installation of RHEL6 and updated packages.</div>
<div style="text-align: justify;">
<br />
<ul>
<li><b>RHN Tools</b>: Repository for managing RHN connections and Kickstart installation.</li>
<li><b>RHN Server Supplementary</b>: Repository of packages other that open source like adobe and java.</li>
<li><b>RHELV2VWIN</b>: Repository to support package to read Microsoft formatted partitions.</li>
<li><b>RHEL Server Optional</b>: Large group of packages other than server package like desktop packages, etc.</li>
</ul>
<br />
Each repository contains a database about the packages in the repository. This database can be found under repodata directory in each repository. This database contains information about each package and its dependencies.<br />
<br />
You can also create your own repository of packages. To create a repository, you need createrepo package installed. <br />
<br />
In the <a href="http://linuxsuperuser07.blogspot.in/2013/03/configure-yum-server-in-redhat.html" target="_blank"><b>next</b></a> post we will see how to configure YUM server and Client. Also we will learn how to create YUM server for RHEL6 DVD iso to update packages on local and remote machines.<br />
<br /></div>
Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0tag:blogger.com,1999:blog-1207220632147534751.post-61633963689724279442012-12-18T10:30:00.000+05:302013-07-21T17:22:34.187+05:30How to Upgrade/Update Kernel in Redhat Enterprise Linux 6 (RHEL6)In this post we will see how to update KERNEL package. As a system administrator you may require to upgrade kernel package. Upgrading kernel package is necessary for adding new features, resolving security related issues, etc. Kernel upgrade can cause problems if other packages depend on current kernel version.<br />
<br />
If you are interested in new kernel, never use -U option as this overwrites the existing kernel and it would be hard to revert the changes. The best option to upgrade a kernel is to install new one.<br />
<br />
You can install new kernel package using below mentioned command in Redhat Enterprise Linux 6 (RHEL6). <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpr6QQZQDEJjsvPn8RVzOwzPhrIrQhpT8zen36_KnfeBEe1ZGb5NcjLa5K0YNQiVThPEgDsSyCvwmMVtk9yQKBVh8QB_3h0ezdbPBpV6_2d7mA2mjm1HGP7C27SHRLsEsT9lZkFTlHzKw/s1600/Linux_Kernel_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="224" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpr6QQZQDEJjsvPn8RVzOwzPhrIrQhpT8zen36_KnfeBEe1ZGb5NcjLa5K0YNQiVThPEgDsSyCvwmMVtk9yQKBVh8QB_3h0ezdbPBpV6_2d7mA2mjm1HGP7C27SHRLsEsT9lZkFTlHzKw/s320/Linux_Kernel_2.png" width="320" /></a></div>
<br />
<br />
Linux Kernel Architecture.<br />
<br />
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># rpm -ivh new_kernel.rpm</span></div>
</div>
<br />
<br />
Above command install new kernel, and related files, along with the old one.<br />
<br />
In the below example we will upgrade kernel from 2.6.32-220.el6.x86_64 to 2.6.32-220.2.1.el6.x86_64:<br />
<br />
To see the current kernel version:<br />
<br />
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># uname -r</span><br />
<span style="font-family: "Courier New",Courier,monospace;">2.6.32-220.el6.x86_64</span></div>
</div>
<br />
<br />
Download new kernel package and install:<br />
<br />
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
# rpm -ivh kernel-2.6.32-220.2.1.el6.x86_64.rpm<br />
<br />
warning: kernel-2.6.32-220.2.1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">Preparing... ########################################### [100%</span><br />
<span style="font-family: "Courier New",Courier,monospace;">1:kernel ########################################### [100%]</span></div>
</div>
<br />
<br />
To verify the new kernel is installed, list contents of /boot directory: <br />
<br />
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># ls /boot/</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br />
</span> <span style="font-family: "Courier New",Courier,monospace;">config-2.6.32-220.2.1.el6.x86_64</span><br />
<span style="font-family: "Courier New",Courier,monospace;">config-2.6.32-220.el6.x86_64</span><br />
<span style="font-family: "Courier New",Courier,monospace;">efi</span><br />
<span style="font-family: "Courier New",Courier,monospace;">grub</span><br />
<span style="font-family: "Courier New",Courier,monospace;">initramfs-2.6.32-220.2.1.el6.x86_64.img</span><br />
<span style="font-family: "Courier New",Courier,monospace;">initramfs-2.6.32-220.el6.x86_64.img</span><br />
<span style="font-family: "Courier New",Courier,monospace;">lost+found</span><br />
<span style="font-family: "Courier New",Courier,monospace;">symvers-2.6.32-220.2.1.el6.x86_64.gz</span><br />
<span style="font-family: "Courier New",Courier,monospace;">symvers-2.6.32-220.el6.x86_64.gz</span><br />
<span style="font-family: "Courier New",Courier,monospace;">System.map-2.6.32-220.2.1.el6.x86_64</span><br />
<span style="font-family: "Courier New",Courier,monospace;">System.map-2.6.32-220.el6.x86_64</span><br />
<span style="font-family: "Courier New",Courier,monospace;">vmlinuz-2.6.32-220.2.1.el6.x86_64</span><br />
<span style="font-family: "Courier New",Courier,monospace;">vmlinuz-2.6.32-220.el6.x86_64</span></div>
</div>
<br />
<br />
After installation of new kernel there will be an entry for new kernel in /etc/grub.conf (/boot/grub/grub.conf).<br />
<br />
<div class="scrollbox" style="text-align: justify;">
<div style="width: 143%;">
<span style="font-family: "Courier New",Courier,monospace;"># cat /etc/grub.conf</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br />
</span> <span style="font-family: "Courier New",Courier,monospace;"># grub.conf generated by anaconda</span><br />
<span style="font-family: "Courier New",Courier,monospace;">#</span><br />
<span style="font-family: "Courier New",Courier,monospace;"># Note that you do not have to rerun grub after making changes to this file</span><br />
<span style="font-family: "Courier New",Courier,monospace;"># NOTICE: You have a /boot partition. This means that</span><br />
<span style="font-family: "Courier New",Courier,monospace;"># all kernel and initrd paths are relative to /boot/, eg.</span><br />
<span style="font-family: "Courier New",Courier,monospace;"># root (hd0,0)</span><br />
<span style="font-family: "Courier New",Courier,monospace;"># kernel /vmlinuz-version ro root=/dev/mapper/OSVG-lvroot</span><br />
<span style="font-family: "Courier New",Courier,monospace;"># initrd /initrd-[generic-]version.img</span><br />
<span style="font-family: "Courier New",Courier,monospace;">#boot=/dev/sda</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br />
</span> <span style="font-family: "Courier New",Courier,monospace;">default=0</span><br />
<span style="font-family: "Courier New",Courier,monospace;">timeout=5</span><br />
<span style="font-family: "Courier New",Courier,monospace;">splashimage=(hd0,0)/grub/splash.xpm.gz</span><br />
<span style="font-family: "Courier New",Courier,monospace;">hiddenmenu</span><br />
<span style="font-family: "Courier New",Courier,monospace;">title Red Hat Enterprise Linux Server (2.6.32-220.2.1.el6.x86_64)</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> root (hd0,0)</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> kernel /vmlinuz-2.6.32-220.2.1.el6.x86_64 ro root=/dev/mapper/OSVG-lvroot rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=OSVG/lvswap SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto quiet rd_LVM_LV=OSVG/lvroot KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> initrd /initramfs-2.6.32-220.2.1.el6.x86_64.img</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> title Red Hat Enterprise Linux (2.6.32-220.el6.x86_64)</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br />
</span> <span style="font-family: "Courier New",Courier,monospace;"> root (hd0,0)</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> kernel /vmlinuz-2.6.32-220.el6.x86_64 ro root=/dev/mapper/OSVG-lvroot rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=OSVG/lvswap SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto quiet rd_LVM_LV=OSVG/lvroot KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> initrd /initramfs-2.6.32-220.el6.x86_64.img</span></div>
</div>
<br />
<br />
As you can see above that default kernel at boot time is 0 which is new kernel.<br />
Reboot the server and check for the new kernel. If new kernel does not work you can change default option to 1, to boot form the old kernel.<br />
<br />
After server restart verify the new kernel version.<br />
<br />
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"># uname -r</span><br />
<span style="font-family: "Courier New",Courier,monospace;">2.6.32-220.2.1.el6.x86_64</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br />
</span> <span style="font-family: "Courier New",Courier,monospace;"># rpm -qa kernel</span><br />
<span style="font-family: "Courier New",Courier,monospace;">kernel-2.6.32-220.el6.x86_64</span><br />
<span style="font-family: "Courier New",Courier,monospace;">kernel-2.6.32-220.2.1.el6.x86_64</span></div>
</div>
<br />
<br />
In the next post we will learn package management through YUM to automatically resolve dependencies.<br />
<br />Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0Upvan Lake, Thane West, Thane, Maharashtra19.2215552 72.956022219.2178067 72.9509797 19.2253037 72.961064700000009tag:blogger.com,1999:blog-1207220632147534751.post-79318435448692536592012-12-11T01:00:00.000+05:302013-07-21T17:02:03.579+05:30Package Management in RHEL6: RPM<div style="text-align: justify;">One of the major duties of a system administrator is to manage applications/software on the server. System administrator needs to know how to add and remove or get information about packages. In this post we will learn RPM (Redhat Package Manager) commands to manage software on Redhat Enterprise Linux 6. To pass the RHCSA certification exam this RHCSA objective is must. In this post we will learn:</div><div style="text-align: justify;"><br />
</div><ul><li><b>What is RPM PACKAGE?</b></li>
<li><b>How to install .rpm package file in Redhat Enterprise Linux 6(RHEL 6)?</b></li>
<li><b>How to remove/erase rpm package in RHEL 6?</b></li>
<li><b>How to query about a package in RHEL 6?</b></li>
<li><b>How to check signature of rpm package?</b></li>
</ul><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">In RHEL 6 applications/software comes in the form of package. In general package is a container of files. A package includes binary scripts, configuration files and documentation files. A RPM package name usually includes version and architecture. For example openssh-5.3p1-70.el6.x86_64 in this openssh is package name 5.3p1 is version build 70, x86_64 is architecture.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">In Redhat Enterprise Linux 6 software packages have their dependent packages. RPM package installation won’t work if there are dependencies. To install a .rpm package use below mentioned command:</div><div style="text-align: justify;"><br />
</div><div class="noscrollbox" style="text-align: justify;"><div style="width: 100%;"><span style="font-family: "Courier New",Courier,monospace;"># rpm -i package_name</span><br />
<span style="font-family: "Courier New",Courier,monospace;"># rpm -U package_name</span></div></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">The rpm -i option install the package if it is not already installed. The rpm -U option upgrades the package if it is installed or install if already not installed. I will suggest to use -vh option while install/upgrade package this will add verbose mode and hash mark to help monitor the installation process. Also at the time of installation, if some files are to be overwrite, it automatically takes a backup of the original file as .rpmsave extension.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><b>NOTE</b>: Before upgrading any package, take backup of all configuration files related to that package.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><b>EXAMPLE</b>:</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">In this example we will install gcc package.</div><div style="text-align: justify;"><br />
</div><div class="scrollbox" style="text-align: justify;"><div style="width: 125%;"><span style="font-family: "Courier New",Courier,monospace;"># rpm -ivh gcc-4.4.6-3.el6.x86_64.rpm</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br />
</span> <span style="font-family: "Courier New",Courier,monospace;">warning: gcc-4.4.6-3.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY</span><br />
<span style="font-family: "Courier New",Courier,monospace;">error: Failed dependencies:</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> cloog-ppl >= 0.15 is needed by gcc-4.4.6-3.el6.x86_64</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> cpp = 4.4.6-3.el6 is needed by gcc-4.4.6-3.el6.x86_64</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> glibc-devel >= 2.2.90-12 is needed by gcc-4.4.6-3.el6.x86_64</span></div></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">In the above example we can see that there is an error while installing “gcc-4.4.5-6.el6.x86_64.rpm” package and installation got failed. This so due to dependencies, gcc require cpp and libgomp package to install. So we have to install cpp, clog-ppl and glibc-devel package first.</div><div style="text-align: justify;"><br />
</div><div class="scrollbox" style="text-align: justify;"><div style="width: 125%;"><span style="font-family: "Courier New",Courier,monospace;"># rpm -ivh cpp-4.4.6-3.el6.x86_64.rpm</span><br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">warning: cpp-4.4.6-3.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY</span><br />
<span style="font-family: "Courier New",Courier,monospace;">error: Failed dependencies:</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> libmpfr.so.1()(64bit) is needed by cpp-4.4.6-3.el6.x86_64</span></div></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">Again package “cpp-4.4.6-3.el6.x86_64.rpm” failed due to dependencies error. In Linux this is called “dependency hell”. To overcome this problem Redhat introduced YUM (Yellow Dog Modifier) which will find and resolve all dependency to install package. We will discuss YUM in some other post.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">If a package don’t require any dependency or all dependencies are already installed the package will install.</div><div style="text-align: justify;"><br />
</div><div class="noscrollbox" style="text-align: justify;"><div style="width: 100%;"><span style="font-family: "Courier New",Courier,monospace;"># rpm -ivh squid-3.1.10-1.el6_1.1.x86_64.rpm</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br />
</span> <span style="font-family: "Courier New",Courier,monospace;">warning: squid-3.1.10-1.el6_1.1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY</span><br />
<span style="font-family: "Courier New",Courier,monospace;">Preparing... ########################################### [100%]</span><br />
<span style="font-family: "Courier New",Courier,monospace;">1:squid ########################################### [100%]</span></div></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">To remove a package use rpm -e command. Here e stands for erase.</div><div style="text-align: justify;"><br />
</div><div class="noscrollbox" style="text-align: justify;"><div style="width: 100%;"><span style="font-family: "Courier New",Courier,monospace;"># rpm -e squid</span></div></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">To check .rpm package signature user --checksig option:</div><div style="text-align: justify;"><br />
</div><div class="noscrollbox" style="text-align: justify;"><div style="width: 100%;"><span style="font-family: "Courier New",Courier,monospace;"># rpm --checksig firefox-3.6.24-3.el6_1.x86_64.rpm</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br />
</span> <span style="font-family: "Courier New",Courier,monospace;">firefox-3.6.24-3.el6_1.x86_64.rpm: RSA sha1 ((MD5) PGP) md5 NOT OK (MISSING KEYS: (MD5) PGP#fd431d51)</span></div></div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">SOME MORE RPM COMMAND</div><div style="text-align: justify;"><br />
</div><ul><li>rpm -q package_name: This will query if package is installed or not.</li>
</ul><div style="text-align: justify;"><br />
</div><div class="noscrollbox" style="text-align: justify;"><div style="width: 100%;"><span style="font-family: "Courier New",Courier,monospace;"># rpm -q firefox</span><br />
<span style="font-family: "Courier New",Courier,monospace;">firefox-3.6.24-3.el6_1.x86_64</span><br />
<br />
<span style="font-family: "Courier New",Courier,monospace;"># rpm -q squid</span><br />
<span style="font-family: "Courier New",Courier,monospace;">package squid is not installed</span></div></div><div style="text-align: justify;"><br />
</div><ul><li>rpm -qa: List all installed packages.</li>
</ul><div style="text-align: justify;"><br />
</div><div class="noscrollbox" style="text-align: justify;"><div style="width: 100%;"><span style="font-family: "Courier New",Courier,monospace;"># rpm -qa</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br />
</span> <span style="font-family: "Courier New",Courier,monospace;">postfix-2.6.6-2.2.el6_1.x86_64</span><br />
<span style="font-family: "Courier New",Courier,monospace;">rpcbind-0.2.0-8.el6.x86_64</span><br />
<span style="font-family: "Courier New",Courier,monospace;">hpijs-3.10.9-3.el6.x86_64</span><br />
<span style="font-family: "Courier New",Courier,monospace;">system-config-printer-libs-1.1.16-22.el6.x86_64</span><br />
<span style="font-family: "Courier New",Courier,monospace;">filesystem-2.4.30-3.el6.x86_64</span><br />
<span style="font-family: "Courier New",Courier,monospace;">mdadm-3.2.2-9.el6.x86_64</span><br />
<span style="font-family: "Courier New",Courier,monospace;">…..</span><br />
<span style="font-family: "Courier New",Courier,monospace;">………..</span></div></div><div style="text-align: justify;"><br />
</div><ul><li>rpm -ql package_name: List all files from package.</li>
<li>rpm -qc package_name: List only configuration files from package.</li>
<li>rpm -qf /path/filename: List packages associated with file.</li>
<li>rpm -qi package_name: List basic information about the package.</li>
</ul><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">In the next post we will learn more about package management in RHEL 6 using YUM.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;">If you have any question or query please post comments.</div><div style="text-align: justify;"><br />
</div><div style="text-align: justify;"><br />
</div>Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0Nilgiri Upwan, Thane West, Thane, Maharashtra19.225461788804154 72.95930385589619.223587788804153 72.956836355896 19.227335788804155 72.961771355895991tag:blogger.com,1999:blog-1207220632147534751.post-62467132064635534282012-09-08T17:54:00.002+05:302013-07-22T21:40:13.594+05:30Set Access Control List (ACL) in RHEL 6<div style="text-align: justify;">
In this post we will discuss about Access Control List in Redhat Enterprise Linux 6 to give permissions to different users and groups on file or directory. As discussed in the previous posts file/directory permissions can be set for the owner, group and other users. But what, if in a case, when we have to give different permissions to different users on the same file/directory. In such situation we can set ACL on file/directory to give different permissions to different users.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Before applying ACLs, you have to mount the partition, in which you want to set ACL, with “acl” option. We can mount the partition using mount command or can add “acl” option in /etc/fstab for that partition.</div>
<div style="text-align: justify;">
<span style="font-family: "Courier New",Courier,monospace;"><br /></span></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">[root@PawanS1 ~]# mount -o remount,acl /appl</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkF__Wd2ScqNAwMBV2vgCCrX_wzxRt56tiocWlqD-024L3U7NmR0hdpgWHxMXnmt5cJlaT6QA0cw2Rv_UaRAjJZlJOeYzanDxq-eRYgzcBe6HC3INjWdOgYCCiCosrR5RhmF88iSdy2Ag/s1600/fstab.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkF__Wd2ScqNAwMBV2vgCCrX_wzxRt56tiocWlqD-024L3U7NmR0hdpgWHxMXnmt5cJlaT6QA0cw2Rv_UaRAjJZlJOeYzanDxq-eRYgzcBe6HC3INjWdOgYCCiCosrR5RhmF88iSdy2Ag/s1600/fstab.jpg" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
As shown in above picture we have added option “acl” in /etc/fstab file.</div>
<div style="text-align: justify;">
We can set ACLs on per user and per group basis, also we can modify acl mask.</div>
<div style="text-align: justify;">
To set ACL on a file or directory use command “setfacl” with -m option to add or modify current ACLs.</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">[root@PawanS1 ~]# setfacl -m acl_rule files</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>ACL RULES:</b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>u:uid:permission</b> :- This rule will set ACL for user with mentioned uid or user name of valid user.</div>
<div style="text-align: justify;">
<b>g:gid:permission </b>:- This rule will set ACL for group with mentioned gid or grou pname of valid group.</div>
<div style="text-align: justify;">
<b>m:permission</b> :- This will update the umask of ACL.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Note: “permission” mentioned above in rule can be combination of read(r), write(w) and execute(x).</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Let’s take some examples of ACL:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Give read and execute permission to user usaid on file test.txt</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">[root@PawanS1 ~]# setfacl -m u:usaid:r-x test.txt</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Give read, write and execute permissions to group admin on directory /servers recursively.</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">[root@PawanS1 ~]# setfacl -Rm g:admin:rwx /servers</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Note: If possible use uid/gid to add/change acl, as username starting with a numeric character will have problem while adding access control list.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Some of the options used with setfacl command.</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">-b : Remove all extended ACL entries.</span><br />
<span style="font-family: "Courier New",Courier,monospace;">-d : Grant default ACL.</span><br />
<span style="font-family: "Courier New",Courier,monospace;">-m : Modify and Add ACLs.</span><br />
<span style="font-family: "Courier New",Courier,monospace;">-R : Apply ACL recursively on subdirectories.</span><br />
<span style="font-family: "Courier New",Courier,monospace;">-x : Remove particular ACL entry.</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Remove all permissions of user siddharth on file test.txt</div>
<div style="text-align: justify;">
<span style="font-family: "Courier New",Courier,monospace;"><br /></span></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">[root@PawanS1 ~]# setfacl -x u:siddharth /servers</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
A file on which ACL is set have “+” in last of permission column in “ls -l” output.</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">[root@PawanS1 ~]# ls -l shared_file.txt</span><br />
<span style="font-family: "Courier New",Courier,monospace;">-rw-rwxr--+ 1 root root 43 Aug 29 12:20 <span style="color: lime;">shared_file.txt</span></span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
To view the current ACLs on a file or directory we can use “getfacl” command. Below example shows acl applied on a file named shared_file.txt</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">[root@PawanS1 ~]# getfacl shared_file.txt</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;"># file: shared_file.txt</span><br />
<span style="font-family: "Courier New",Courier,monospace;"># owner: root</span><br />
<span style="font-family: "Courier New",Courier,monospace;"># group: root</span><br />
<span style="font-family: "Courier New",Courier,monospace;">user::rw-</span><br />
<span style="font-family: "Courier New",Courier,monospace;">user:siddharth:r--</span><br />
<span style="font-family: "Courier New",Courier,monospace;">user:usaid:rw-</span><br />
<span style="font-family: "Courier New",Courier,monospace;">user:ramswaroop:r-x</span><br />
<span style="font-family: "Courier New",Courier,monospace;">group::r--</span><br />
<span style="font-family: "Courier New",Courier,monospace;">mask::rwx</span><br />
<span style="font-family: "Courier New",Courier,monospace;">other::r--</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In the above example you can see that owner and group of the file is root and user “siddharth” have read access, user “usaid” have read and write permission and user “ramswaroop” have read and execute permission on the file shared_file.txt.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
For any queries please post comments. </div>
<div style="text-align: justify;">
<br /></div>
Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com19Vasant Vihar, Thane West, Thane, Maharashtra, India19.2245131 72.968201719.2170166 72.958331199999989 19.232009599999998 72.9780722tag:blogger.com,1999:blog-1207220632147534751.post-32666368320598724222012-08-28T22:30:00.000+05:302013-07-22T22:15:27.878+05:30SUID, SGID and Sticky Bit in RHEL6<div style="text-align: justify;">
In the previous post I have explained about changing file/directory permissions using chmod command in two ways: symbolic and numeric mode. In this post we will discuss about three special file permissions: Sticky Bit, SUID Bit and SGID bit, using which we can make processes more secure and efficient:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In the previous post we have discussed about three file permissions: ream(r), write (w) and execute(x), besides these three are three more permissions: SUID(s), SGID(s) and Sticky Bit(t). First we will explain what these terms means.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Sticky Bit(t)</b>: Sticky bit is very simple and effective file permission; it increases security of a file/directory which is shared with other users. When sticky bit is enabled, only user (owner) of that file can remove or rename the file even if other users have full (rwx) permissions on that file. In the case of a directory, only user (owner) of the directory or the owner of the file in that directory can remove or rename the file. Mainly sticky bit is used on directories on which multiple users have access like /tmp. By default sticky bit is set on /tmp in Redhat Enterprise Linux 6(RHEL6).</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
[root@PawanS1 ~]# ls -ld /tmp<br />
drwxrwxrwt. 96 root root 4096 Aug 28 12:06 /tmp</div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In the above example we can see that there is a “t” at execute permission for others. Sticky bit can be enabled using “chmod” command. Let’s take some examples of Sticky Bit.</div>
<div style="text-align: justify;">
</div>
<ul style="text-align: justify;">
<li>Add sticky bit permission on a directory with all permissions using symbolic chmod. </li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
[root@PawanS1 ~]# ls -ld Test_Dir/<br />
drwxrwxrwx 2 admin pawan 4096 Aug 28 10:22 Test_Dir/<br />
<br />
[root@PawanS1 ~]# chmod +t Test_Dir/<br />
<br />
[root@PawanS1 ~]# ls -ld Test_Dir/<br />
drwxrwxrwt 2 pawan admin 4096 Aug 28 10:22 Test_Dir/</div>
</div>
<div style="text-align: justify;">
</div>
<ul>
<li>Add sticky bit permission on a directory using numeric chmod.</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
[root@PawanS1 ~]# ls -ld My_Dir/<br />
drwxr-xr-- 2 pawan admin 4096 Aug 28 10:27 My_Dir/<br />
<br />
[root@PawanS1 ~]# chmod 1754 My_Dir/<br />
<br />
[root@PawanS1 ~]# ls -ld Test_Dir/<br />
drwxr-xr-T 2 pawan admin 4096 Aug 28 10:22 MY_Dir/</div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Note</b>: This time we have a “T” instead of “t” because the directory does not have execute permission for others.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>SUID (Set User ID) Bit(s)</b>: Mainly we enable SUID bit on files specially on executable scripts. When SUID bit is enabled on the script/ file, whenever someone executes the file it runs as the user who is owner of that file. It means the file is ensured to run as the owner, even if executed by anyone. This comes handy when you want to give execute rights of a root privileged script to some other user. In RHEL 6, SUID bit is set by default on commands like /usr/bin/passwd, /usr/bin/wall, /usr/bin/ssh-agent, etc. This is the reason a user can change its password itself.</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
[root@PawanS1 ~]# ls -l /usr/bin/passwd<br />
-rwsr-xr-x 1 root root 27936 Aug 3 2010 /usr/bin/passwd</div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In the above example we can see that there is a “s” at execute permission of user (owner). SUID bit can be enabled using “chmod” command. Let’s take some examples of SUID bit.</div>
<div style="text-align: justify;">
</div>
<ul>
<li>Add SUID bit on a script using symbolic chmod.</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
[root@PawanS1 ~]# ls -l test_script.sh<br />
-rwxr-xr-x 1 root admin 43 Aug 28 11:51 test_script.sh<br />
<br />
[root@PawanS1 ~]# chmod u+s test_script.sh<br />
<br />
[root@PawanS1 ~]# ls -l test_script.sh<br />
-rwsr-xr-x 1 root admin 43 Aug 28 11:51 test_script.sh</div>
</div>
<div style="text-align: justify;">
</div>
<ul>
<li>Add SUID bit on a script which does not have execute permission for user (owner) using numeric chmod.</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
[root@PawanS1 ~]# ls -l my_script.sh<br />
-rw-r--r-- 1 root admin 29 Aug 28 11:58 my_script.sh<br />
<br />
[root@PawanS1 ~]# chmod 4644 my_script.sh<br />
<br />
[root@PawanS1 ~]# ls -l my_script.sh<br />
-rwSr--r-- 1 root admin 29 Aug 28 11:58 my_script.sh</div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Note</b>: This time we have a “S” instead of “s” because the script “my_script.sh does not have execute permission for user.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>SGID (Set Group ID) Bit</b>: SGID bit is very useful when you have to give access of a directory to a set of users in a group. When SGID bit is enabled on a directory any file/directory created under it by any user have the same group permissions as of the parent directory.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
For example, you have created a group named “sales” and you have added three user pawan, siddharth, ramswaroop and usaid in group “sales”. Now you want that every file created by any of these four users under directory “/Sales” can be accessible by any of these users.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
1. To do this first you have to create a directory “/Sales” and then change group owner and group permission to sales and rwx respectively.</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
[root@PawanS1 ~]# mkdir /Sales/<br />
<br />
[root@PawanS1 ~]# ls -d /Sales/<br />
drwxr-xr-x 2 root root 4096 Aug 28 12:31 /Sales/<br />
<br />
[root@PawanS1 ~]# chmod g=rwx /Sales/<br />
<br />
[root@PawanS1 ~]# ghgrp sales /Sales/<br />
<br />
[root@PawanS1 ~]# ls -d /Sales/<br />
drwxrwxr-x 2 root sales 4096 Aug 28 12:31 /Sales/</div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
2. Then enable SGID Bit on “/Sales” directory</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
[root@PawanS1 ~]# ls -d /Sales/<br />
drwxr-xr-x 2 root root 4096 Aug 28 12:31 /Sales/<br />
<br />
[root@PawanS1 ~]# chmod g+s /Sales/<br />
<br />
[root@PawanS1 ~]# ls -d /Sales/<br />
drwxrwsr-x 2 root root 4096 Aug 28 12:31 /Sales/</div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In the above example we can see that there is a “s” at execute permission of group. Now any file created under directory “/Sales” will have group user sales</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Now login as user pawan and create a file in /Sales and check its permissions.</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
[pawan@PawanS1 Sales]# touch test.txt<br />
<br />
[pawan@PawanS1 Sales]# chmod g+s /Sales/<br />
<br />
[pawan@PawanS1 Sales]# ls -l test.txt<br />
-rw-rw-r-- 1 pawan sales 8 Aug 28 12:43 test.txt</div>
</div>
<ul>
<li>We can also enable SGID bit using chmod in numeric mode.</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
[root@PawanS1 ~]# ls -d /Purchase/<br />
drwxrw-r-x 2 root purchase 4096 Aug 28 12:31 /Purchase/<br />
<br />
[root@PawanS1 ~]# chmod 2765 /Purchase/<br />
<br />
[root@PawanS1 ~]# ls -d /Purchase/<br />
drwxrwSr-x 2 root purchase 4096 Aug 28 12:31 /Purchase/</div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Note</b>: This time we have a “S” instead of “s” because directory “/Purchase” does not have execute permission for group.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Below table summarize the chmod for SUID, SGID and Sticky Bit.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;}
</style>
<![endif]-->
</div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; mso-padding-alt: 0cm 0cm 0cm 0cm; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0;">
<td style="border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 168.15pt;" valign="top" width="224"><div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<b style="mso-bidi-font-weight: normal;"><span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">Permission</span></b><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
<td style="border-left: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-themecolor: text1; mso-border-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 178.05pt;" valign="top" width="237"><div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<b style="mso-bidi-font-weight: normal;"><span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">Symbolic
Mode</span></b><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
<td style="border-left: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-themecolor: text1; mso-border-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 166.8pt;" valign="top" width="222"><div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<b style="mso-bidi-font-weight: normal;"><span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">Numeric
Mode</span></b><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
</tr>
<tr style="mso-yfti-irow: 1;">
<td style="border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 168.15pt;" valign="top" width="224"><div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<b style="mso-bidi-font-weight: normal;"><span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">Sticky
Bit</span></b><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 178.05pt;" valign="top" width="237"><div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">chmod +t file_name</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 166.8pt;" valign="top" width="222"><div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">chmod 1XXX file_name</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
</tr>
<tr style="mso-yfti-irow: 2;">
<td style="border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 168.15pt;" valign="top" width="224"><div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<b style="mso-bidi-font-weight: normal;"><span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">SUID
Bit</span></b><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 178.05pt;" valign="top" width="237"><div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">chmod u+s file_name</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 166.8pt;" valign="top" width="222"><div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">chmod 4XXX file_name</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
</tr>
<tr style="mso-yfti-irow: 3;">
<td style="border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 168.15pt;" valign="top" width="224"><div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<b style="mso-bidi-font-weight: normal;"><span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">SGID
Bit</span></b><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 178.05pt;" valign="top" width="237"><div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">chmod g+s file_name</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 166.8pt;" valign="top" width="222"><div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">chmod 2XXX file_name</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
</tr>
<tr style="mso-yfti-irow: 4; mso-yfti-lastrow: yes;">
<td colspan="3" style="border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 513.0pt;" valign="top" width="684"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">where X is permission for user,group and other</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
</tr>
</tbody></table>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
If you have any doubts or queries please post comment.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com1Vasant Vihar, Thane West, Thane, Maharashtra, India19.2245131 72.968201719.1045706 72.8102732 19.3444556 73.126130199999992tag:blogger.com,1999:blog-1207220632147534751.post-86697111000785856132012-08-27T22:29:00.000+05:302013-07-23T22:23:33.541+05:30Changing File Permissions using chmod command<div style="text-align: justify;">
In this post we will learn how to use “chmod” command to change file permissions in Redhat Enterprise Linux 6. Linux is a multi-user operating system; this means many users can have access to particular file or directory. To maintain security, in Linux, there are three categories of user (user, group and other) for file permission (as discussed in previous post), also we have three types of permission: read, write and execute for each type of user.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
To view current permissions of a file we can user long directory listing command “<b>ls -l</b>”:</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">[root@PawanS1 ~]# ls -l test_file.txt</span><br />
<span style="font-family: "Courier New",Courier,monospace;">-rwxr-xr-- 1 pawan admin 30 Aug 27 13:05 test_file.txt</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In the above example we can see that owner of the file is pawan, group owner of the file is admin and file have permissions rwxr-xr-- which means:</div>
<div style="text-align: justify;">
User have read, write and execute (rwx) permissions.</div>
<div style="text-align: justify;">
Group have read and execute(r-x) permission.</div>
<div style="text-align: justify;">
And others have only read(r--) permission.</div>
<div style="text-align: justify;">
Note: “-“ means no permission.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
This means user pawan have full access of file test_file.txt, he can read, modify and also execute the file. And members of group admin can only read and execute the file. Also users other that pawan and members of group admin can only read the file and can’t modify or execute the fiel.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
To change the permission of file we can user “<b>chmod</b>” command, only root and file owner can change permission of file. There are two methods of changing permissions:</div>
<ul>
<li>Symbolic mode</li>
<li>Numeric mode</li>
</ul>
<div style="text-align: justify;">
<b>Symbolic Mode:</b></div>
<div style="text-align: justify;">
Symbolic mode is very easy to user. There are three steps in this process:</div>
<div style="text-align: justify;">
</div>
<ol>
<li>Decide whether you have to change permission for user (u), group (g), other (o) or for all (a).</li>
<li>Decide to add (+), remove (-) or reset all permission (=).</li>
<li>Decide what would be the permission: read (r), write (w), or execute (x).</li>
<li>Then give the name of file of which you have to change permission.</li>
</ol>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
Few examples of chmod in symbolic mode:</div>
<div style="text-align: justify;">
</div>
<ul>
<li>Remove execute permission from user</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">[root@PawanS1 ~]# chmod u-x test_file.txt</span></div>
</div>
<ul>
<li>Add write permission for both group and other</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">[root@PawanS1 ~]# chmod go+w test_file.txt</span></div>
</div>
<div style="text-align: justify;">
</div>
<ul>
<li>Remove write and execute permissions from other</li>
</ul>
<div style="text-align: justify;">
</div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">[root@PawanS1 ~]# chmod o-wx test_file.txt</span></div>
</div>
<ul>
<li>Add write permissions for all</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">[root@PawanS1 ~]# chmod a+w test_file.txt</span></div>
</div>
<ul>
<li>Change permission of user to rwx</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">[root@PawanS1 ~]# chmod u=rwx test_file.txt</span></div>
</div>
<ul>
<li>To remove execute permission recursively from files in a directory</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">[root@PawanS1 ~]# chmod -R u-x Test_Directory/</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Below table summarize the chmod in symbolic mode</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-IN</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--></div>
<div style="text-align: justify;">
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;}
</style>
<![endif]-->
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; mso-padding-alt: 0cm 0cm 0cm 0cm; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0;">
<td style="border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 168.15pt;" valign="top" width="224">
<div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<b><span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">User to be modified</span></b><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
<td style="border-left: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-themecolor: text1; mso-border-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 178.05pt;" valign="top" width="237">
<div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<b><span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">What to do</span></b><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
<td style="border-left: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-themecolor: text1; mso-border-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 166.8pt;" valign="top" width="222">
<div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<b><span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">Permission</span></b><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
</tr>
<tr style="mso-yfti-irow: 1;">
<td style="border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 168.15pt;" valign="top" width="224">
<div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">u (user/owner)</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 178.05pt;" valign="top" width="237">
<div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">+ (add permission)</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 166.8pt;" valign="top" width="222">
<div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">r (read)</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
</tr>
<tr style="mso-yfti-irow: 2;">
<td style="border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 168.15pt;" valign="top" width="224">
<div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">g (group)</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 178.05pt;" valign="top" width="237">
<div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">- (remove permission</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 166.8pt;" valign="top" width="222">
<div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">w (write)</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
</tr>
<tr style="mso-yfti-irow: 3;">
<td style="border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 168.15pt;" valign="top" width="224">
<div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">o (other)</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 178.05pt;" valign="top" width="237">
<div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">= (change permission)</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 166.8pt;" valign="top" width="222">
<div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">x (execute)</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
</tr>
<tr style="mso-yfti-irow: 4; mso-yfti-lastrow: yes;">
<td style="border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 168.15pt;" valign="top" width="224">
<div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;">
<span lang="EN-US" style="font-family: "Times New Roman","serif"; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">a (all)</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 178.05pt;" valign="top" width="237"><br /></td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0cm 5.4pt 0cm 5.4pt; width: 166.8pt;" valign="top" width="222"><br /></td>
</tr>
</tbody></table>
</div>
<div style="text-align: justify;">
<b>Note</b>: besides above mentioned permissions there are two more permissions SUID/SGID(s) and Sticky bit(t) which can be set to give special permission.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Numeric Mode</b>:</div>
<div style="text-align: justify;">
Numeric mode of chmod command is also very useful and easy. This changes old permission directly to new permissions. In numeric file permissions are represented by three digit number. Also each permission(r,w and x) are represented with a number.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
4=read(r)</div>
<div style="text-align: justify;">
2=write(w)</div>
<div style="text-align: justify;">
1=execute(x)</div>
<div style="text-align: justify;">
0=none(-)</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
To create permission we have to add number accordingly. For example:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
rwx = 4+2+1 = 7</div>
<div style="text-align: justify;">
rw- = 4+2+0 = 6</div>
<div style="text-align: justify;">
--x = 0+0+1 = 1</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
To change permission we have to give a 4 digit number combining the above to change permission of file, in which the first digit is permission for user, second digit is permission for group and the third digit is permission for other.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Few examples of chmod in Numeric mode:</div>
<ul>
<li>To change permission to -rwx-rw-r--</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">[root@PawanS1 ~]# chmod 0764 test_file.txt</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In the above example 7=4+2+1, 6=4+2+0 and 4=4+0+0. This means owner have rwx(7), group have rw-(6) and others have r--(4) permission.</div>
<ul>
<li>To change permission to -rw-r-x--x</li>
</ul>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">[root@PawanS1 ~]# chmod 0651 test_file.txt</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Note</b>: The first digit 0 is for special permission like SUID, SGID and Sticky bit.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Besides these three bits discussed above there is a special bit which is used to give special permission to a file or directory for setting SUID bit, SGID bit and Sticky bit, which can be represented by. We will discuss this in the next post.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Numeric mode will take some time to get in ease, but it is very useful and effective to change permissions quickly.</div>
<div style="text-align: justify;">
<br /></div>
Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com1Vasant Vihar, Thane West, Thane, Maharashtra, India19.2245131 72.968201718.7440301 72.336487699999992 19.7049961 73.5999157tag:blogger.com,1999:blog-1207220632147534751.post-53099121791322633642012-08-26T20:06:00.000+05:302013-07-24T21:53:16.435+05:30File Permissions In Redhat Enterprice Linux 6<div style="text-align: justify;">
In the previous post we have seen type of files and file permissions in Linux. In this post we will learn file permissions in detail. Every file in Linux has set of properties like permission, owner, group, created date, modified date size, name, type, etc. We will user one of the most important command “<b>ls -l</b>” to find these properties of a file in Redhat Enterprise Linux6.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
It is important to note that Linux is a multi-user operating system, it is important to secure files as different users can have different grants on a same file. Some users can have read-write grants on a file while others an only read it but not edit it or delete it. To maintain this security Linux operating system uses file permissions.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Every file/directory in Linux is owned by a user and a group so file permissions are defined for <b>user, group</b> and <b>other</b>.</div>
<ul>
<li>User: It is the username of the person who owns the file and by default the user who created the file is the owner.</li>
<li>Group: A group who owns the file. Group can be same as the user or different and can contain more than one user.</li>
<li>Other: A user who is not the owner of the file and also does not belong to group owner.</li>
</ul>
<div style="text-align: justify;">
Every class of user (user, group and other) has three types of permissions:</div>
<ul>
<li>Read (r): For a file, this means it can be opened and read. For a directory, this means you can list contents of that directory.</li>
<li>Write (w): For a file, this means you can edit a file (remove or add contents) but you cannot remove or rename the file. For Directory, this means that you can add, remove and rename the files within that directory.</li>
<li>Execute(x): For a file, this means you can execute the file as program/script. For directory, this means that you can execute files/directories (change directory) within that directory.</li>
</ul>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4OHdrfhitaZAwFKDS6YZJE5pX4xaEIfQIjmmKvHWYvKKHQAmK12J5a07MoEuBamBGdkEGF4fQiXh7lDd-EBTJmJvOTZ-bxtRo95QUwa0w-CD3-ZoTtCHiWA0XcesrxDUl0Shujz1CCOw/s1600/File_permissions.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="164" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4OHdrfhitaZAwFKDS6YZJE5pX4xaEIfQIjmmKvHWYvKKHQAmK12J5a07MoEuBamBGdkEGF4fQiXh7lDd-EBTJmJvOTZ-bxtRo95QUwa0w-CD3-ZoTtCHiWA0XcesrxDUl0Shujz1CCOw/s400/File_permissions.jpg" width="400" /></a></div>
<div style="text-align: justify;">
To view file permissions we can user directory listing command ls with -l opthon.</div>
<div style="text-align: justify;">
<br /></div>
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;">[root@PawanS1 ~]# ls -l test_file.txt</span><br />
<span style="font-family: "Courier New",Courier,monospace;">-rwxrw-r-- 1 root root 12 Aug 25 19:50 Test_File.txt</span></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In the above command we can see different properties of a file named “Test_File.txt”. File permissions are represented by 10 bits (the first 10 characters of the output of ls -l command -rwxr-xr-x).</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
First bit is file type “-“ for file and “d” for directory.</div>
<div style="text-align: justify;">
Second to fourth bits are Owner’s permission (User).</div>
<div style="text-align: justify;">
Fifth to seventh bits are Group’s permission.</div>
<div style="text-align: justify;">
Eighth to tenth bits are Other’s permission.</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
And if we represent permissions in octal notation:</div>
<div style="text-align: justify;">
User: rwx = in binary 111 = 7 = 4+2+1</div>
<div style="text-align: justify;">
Group: r-x = in binary 101 = 5 = 4+0+1</div>
<div style="text-align: justify;">
Other: --x = in binary 001 = 1 = 0+0+1</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
So permissions are -rwxr-x--x which are equivalent to 751. But for better understanding we assume:</div>
<ul>
<li>r = read = 4</li>
<li>w = write = 2</li>
<li>x = execute = 1</li>
</ul>
<div style="text-align: justify;">
By combining above mentioned permissions we can give Owner, Group and Others different permissions as we require. For example –rwxr-xr-- shown that it is a regular file with read, write and execute permissions to Owner; read and execute permissions to Group and only read permission to Others.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
We can change these permissions using chmod command. We will discuss this command in the next post.</div>
<div style="text-align: justify;">
Some examples of octal combination of permissions:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Owner: rwx = 4+2+1 = 7</div>
<div style="text-align: justify;">
Group: r-x - 4+0+1 = 5</div>
<div style="text-align: justify;">
Other: --x = 0+0+1 = 1</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
So permissions are -rwxr-x--x which are equivalent to 751</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
So to change files permissions to -rwxr-x—x(751) we need to execute command:</div>
<div style="text-align: justify;">
<b><br /></b></div>
<div style="text-align: justify;">
<b># chmod 0751 filename</b></div>
<div style="text-align: justify;">
<b>Or</b></div>
<div style="text-align: justify;">
<b># chmod 751 filename</b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The above commands do the same, but it is important to note the first octal notation which is “0” in this case, this is used to set SUID bit, GID bit and Sticky bit on a file which we will discuss in some other post.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
For any queries please post comments.</div>
Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0Vasant Vihar, Thane West, Thane, Maharashtra, India19.2245131 72.968201719.2170166 72.958331199999989 19.232009599999998 72.9780722tag:blogger.com,1999:blog-1207220632147534751.post-52751992612176883682012-08-25T20:00:00.001+05:302013-07-24T21:58:31.215+05:30Files and Types of files in RHEL6<div style="font-family: inherit; text-align: justify;">
<!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves/> <w:TrackFormatting/> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF/> <w:LidThemeOther>EN-IN</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:SplitPgBreakAndParaMark/> <w:DontVertAlignCellWithSp/> <w:DontBreakConstrainedForcedTables/> <w:DontVertAlignInTxbx/> <w:Word11KerningPairs/> <w:CachedColBalance/> <w:UseFELayout/> </w:Compatibility> <m:mathPr> <m:mathFont m:val="Cambria Math"/> <m:brkBin m:val="before"/> <m:brkBinSub m:val="--"/> <m:smallFrac m:val="off"/> <m:dispDef/> <m:lMargin m:val="0"/> <m:rMargin m:val="0"/> <m:defJc m:val="centerGroup"/> <m:wrapIndent m:val="1440"/> <m:intLim m:val="subSup"/> <m:naryLim m:val="undOvr"/> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/> <w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/> <w:LsdException Locked="false" Priority="39" Name="toc 1"/> <w:LsdException Locked="false" Priority="39" Name="toc 2"/> <w:LsdException Locked="false" Priority="39" Name="toc 3"/> <w:LsdException Locked="false" Priority="39" Name="toc 4"/> <w:LsdException Locked="false" Priority="39" Name="toc 5"/> <w:LsdException Locked="false" Priority="39" Name="toc 6"/> <w:LsdException Locked="false" Priority="39" Name="toc 7"/> <w:LsdException Locked="false" Priority="39" Name="toc 8"/> <w:LsdException Locked="false" Priority="39" Name="toc 9"/> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/> <w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/> <w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/> <w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/> <w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/> <w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/> <w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/> <w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/> <w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/> <w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/> <w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/> <w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/> <w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/> <w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/> <w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/> <w:LsdException Locked="false" Priority="37" Name="Bibliography"/> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/> </w:LatentStyles> </xml><![endif]--><!--[if gte mso 10]> <style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
</style> <![endif]--> </div>
<div class="MsoNormal" style="font-family: inherit; text-align: justify;">
<span lang="EN-US">In this post we will discuss different types of files in Redhat Enterprise Linux 6. There are 7 types of files in Linux. As we all know <i style="mso-bidi-font-style: normal;">"everything in Linux is a file"</i>. Linux treat everything as file, also hardware devices like CPU, Memory, keyboard, mouse and even a process is also considered as a file. A directory (aka folder) is also considered as a file containing list of files. Whenever a file is created in Linux it gets an inode number (index inode) which contains information like owner, file type, permission, date of creation etc.</span></div>
<div class="MsoNormal" style="font-family: inherit; text-align: justify;">
<br /></div>
<div class="MsoNormal" style="font-family: inherit; text-align: justify;">
<span lang="EN-US">To check the type of file we can use “<b style="mso-bidi-font-weight: normal;">ls -l” </b>command :</span></div>
<div class="MsoNormal" style="font-family: inherit; text-align: justify;">
<br /></div>
<div class="MsoNormal" style="font-family: inherit; text-align: justify;">
<div class="noscrollbox" style="text-align: justify;">
<div style="width: 100%;">
<span style="font-family: "Courier New",Courier,monospace;"><span lang="EN-US"># ls -l /erc/passwd</span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "Courier New",Courier,monospace;"><b><span lang="EN-US">-rw-r--r-- 1 root root 3363 Aug 12 17:25 /etc/passwd</span></b></span></div>
<div class="MsoNormal" style="font-family: inherit; text-align: justify;">
</div>
</div>
<br />
<br /></div>
<div class="MsoNormal" style="font-family: inherit; text-align: justify;">
<span lang="EN-US">The above command give different information about a file, like its owner, group, creation time, permission etc, we will discuss it in another post. The very first character represents type of file, in the above example the first character is a "-" which indicates that it is a regular file.</span></div>
<div class="MsoNormal" style="font-family: inherit; text-align: justify;">
<br /></div>
<div class="MsoNormal" style="font-family: inherit; text-align: justify;">
<span lang="EN-US">There are seven types of files in Linux.</span></div>
<div class="MsoNormal" style="font-family: inherit; text-align: justify;">
<br /></div>
<ol>
<li><span lang="EN-US"><span style="background-color: white;"><u><i><b>REGULAR Files (-)</b></i></u>: </span>Regular files are represented by “-“ in ls -l command output. Regular files are common files containing text like scripts or data.</span><span lang="EN-US"> </span></li>
<li><span lang="EN-US"><span style="background-color: white;"> <u><i><b>DIRECTORIES (d):</b></i></u></span> Directories are represented by “d”. As mentioned above directories are special files that contains list of other files.</span><span lang="EN-US"> </span></li>
<li><span lang="EN-US"><span style="background-color: white;"><u><i><b>SYMBOLIC Links (l)</b></i></u></span>: Symbolic links are represented by “l”. A symbolic link is a reference to another file or in common language it is shortcut to another file.</span><span lang="EN-US"> </span></li>
<li><span lang="EN-US"><span style="background-color: white;"><u><i><b>NAMED PIPE (p)</b></i></u></span>: Named pipes are represented by “p”. Named pipes are like sockets for communication between processes.</span><span lang="EN-US"> </span></li>
<li><span lang="EN-US"><span style="background-color: white;"><u><i><b>SOCKET (s)</b></i></u></span>: These are represented by “s” Sockets are special files that provides inter process networking.</span><span lang="EN-US"> </span></li>
<li><span lang="EN-US"><span style="background-color: white;"><i><u><b>CHARACTER Device Files (c)</b></u></i></span>: Character device files are represented by “c”. These files represent devices which read/write 0 or more bytes in a stream like TTY or keyboard.</span><span lang="EN-US"> </span></li>
<li><span lang="EN-US"><span style="background-color: white;"><i><u><b>BLOCK Device Files (b)</b></u></i>:</span> Block device files are represented by “b”. Block device can read/write bytes in a fixed size blocks like HDD or a partition.</span></li>
</ol>
<div class="MsoNormal" style="font-family: inherit; text-align: justify;">
<br /></div>
<div class="MsoNormal" style="font-family: inherit; text-align: justify;">
<span lang="EN-US">Each type of file represented by different color in terminal. Like</span></div>
<div class="MsoNormal" style="font-family: inherit; text-align: justify;">
<br /></div>
<div class="MsoNormal" style="font-family: inherit; text-align: justify;">
<span lang="EN-US"> <b style="background-color: #351c75; color: white;">File Type Colour</b></span></div>
<ul>
<li><span lang="EN-US">Regular File<span style="mso-tab-count: 1;"> </span><b><span style="background-color: black; color: white;">White</span></b></span></li>
<li><span lang="EN-US">Directory<span style="mso-tab-count: 1;"> <b> </b></span><b style="background-color: black;"><span style="color: blue;">Blue</span></b></span></li>
<li><span lang="EN-US">Symbolic Link<span style="mso-tab-count: 1;"> </span><b style="background-color: black; color: cyan;">Cyan</b></span></li>
<li><span lang="EN-US">Socket<span style="mso-tab-count: 2;"> </span><b style="background-color: black; color: magenta;">Purple</b></span></li>
<li><span lang="EN-US">Named <span style="mso-tab-count: 1;">Pipes </span><b style="background-color: black; color: red;">Red</b></span></li>
<li><span lang="EN-US">Device File<span style="mso-tab-count: 1;"> </span><b style="background-color: black; color: yellow;">Yellow<span style="background-color: white;"> </span></b></span></li>
</ul>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb7lLykVAdGhLb87S6-OMlasoaTT5PXly4J8bgK79VmOM0clSVw69BMwZsfIsuG0nx03MLJcFbVp4jsRgITWm_y_H-ZM-Hc23vO3ObONJGuJqMCGXLbLZdzWs3d0DLmTuRXVx6ay0OMuc/s1600/file_type.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="File types in Linux" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb7lLykVAdGhLb87S6-OMlasoaTT5PXly4J8bgK79VmOM0clSVw69BMwZsfIsuG0nx03MLJcFbVp4jsRgITWm_y_H-ZM-Hc23vO3ObONJGuJqMCGXLbLZdzWs3d0DLmTuRXVx6ay0OMuc/s1600/file_type.jpg" title="Type of files in Redhat Enterprise Linux 6" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Type of files in RHEL 6</td></tr>
</tbody></table>
<span lang="EN-US"><b style="background-color: black; color: yellow;"><span style="background-color: white;"> </span></b></span><br />
<span lang="EN-US"><span style="background-color: black; color: yellow;"><span style="background-color: white;"><span style="color: black;">For any questions please feel free to comment.</span></span></span><b style="background-color: black; color: yellow;"><span style="background-color: white;"> </span></b><span style="background-color: black; color: yellow;"></span></span><br />
<span lang="EN-US"><span style="background-color: black; color: yellow;"><span style="background-color: white;"></span></span><b style="background-color: black; color: yellow;"><span style="background-color: white;"></span><br />
</b></span> Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0Vasant Vihar, Thane West, Thane, Maharashtra, India19.2245131 72.968201719.2170166 72.958331199999989 19.232009599999998 72.9780722tag:blogger.com,1999:blog-1207220632147534751.post-49104487853971311352012-07-16T17:26:00.000+05:302013-07-17T23:08:02.355+05:30Chage command for password ageing policy<div style="text-align: justify;">
In this post we will learn how to manage users password aging using chage command. Chage command is very useful for user management and password policy. The chage command changes the number of days between password changes and the date of the last password change. This information is used by the system to determine when a user must change his/her password.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
To change user's password aging use command <i><b>"chage user_name"</b></i></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
1. To list user account aging information.</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
</div>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none; margin-left: 0px; margin-right: 0px; text-align: left;">
<tbody>
<tr style="height: 116.35pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background: #A6A6A6; border: solid windowtext 1.0pt; height: 116.35pt; mso-background-themecolor: background1; mso-background-themeshade: 166; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 416.95pt;" valign="top" width="556"><div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US"># chage -l transfer_user</span></div>
<div class="MsoNormal">
<span lang="EN-US">Last password change : Jun
22, 2012</span></div>
<div class="MsoNormal">
<span lang="EN-US">Password expires : Aug 21,
2012</span></div>
<div class="MsoNormal">
<span lang="EN-US">Password inactive : never</span></div>
<div class="MsoNormal">
<span lang="EN-US">Account expires : never</span></div>
<div class="MsoNormal">
<span lang="EN-US">Minimum number of days between password
change : 7</span></div>
<div class="MsoNormal">
<span lang="EN-US">Maximum number of days between password
change : 60</span></div>
<div class="MsoNormal">
<span lang="EN-US">Number of days of warning before password
expires : 7</span></div>
<div class="MsoNormal">
<br /></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US"> 2. To force user to change password after first login do</span></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US"></span></div>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none; margin-left: 0px; margin-right: 0px; text-align: left;">
<tbody>
<tr style="height: 116.35pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background: #A6A6A6; border: solid windowtext 1.0pt; height: 116.35pt; mso-background-themecolor: background1; mso-background-themeshade: 166; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 416.95pt;" valign="top" width="556"><div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US"># <b style="mso-bidi-font-weight: normal;">chage
-d0 transfer_user</b></span></div>
<div class="MsoNormal">
<span lang="EN-US"># chage -l transfer_user</span></div>
<div class="MsoNormal">
<span lang="EN-US">Last password change : password must be
changed</span></div>
<div class="MsoNormal">
<span lang="EN-US">Password expires : password must be
changed</span></div>
<div class="MsoNormal">
<span lang="EN-US">Password inactive : password must be
changed</span></div>
<div class="MsoNormal">
<span lang="EN-US">Account expires : never</span></div>
<div class="MsoNormal">
<span lang="EN-US">Minimum number of days between password
change : 7</span></div>
<div class="MsoNormal">
<span lang="EN-US">Maximum number of days between password
change : 60</span></div>
<div class="MsoNormal">
<span lang="EN-US">Number of days of warning before password
expires : 7</span></div>
<div class="MsoNormal">
<br /></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US">3. To change Account Expiration date: Set the date or number of days since January 1, 1970 on which the user´s account will no longer be accessible. </span></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US"></span></div>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none; margin-left: 0px; margin-right: 0px; text-align: left;">
<tbody>
<tr style="height: 116.35pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background: #A6A6A6; border: solid windowtext 1.0pt; height: 116.35pt; mso-background-themecolor: background1; mso-background-themeshade: 166; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 416.95pt;" valign="top" width="556"><div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US"># chage -E 2012-09-01 transfer_user</span></div>
<div class="MsoNormal">
<span lang="EN-US"># chage -l transfer_user</span></div>
<div class="MsoNormal">
<span lang="EN-US">Last password change : Jun 22,
2012</span></div>
<div class="MsoNormal">
<span lang="EN-US">Password expires : Aug
21, 2012</span></div>
<div class="MsoNormal">
<span lang="EN-US">Password inactive : never</span></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span lang="EN-US">Account
expires :
Sep 01, 2012</span></b></div>
<div class="MsoNormal">
<span lang="EN-US">Minimum number of days between password
change : 7</span></div>
<div class="MsoNormal">
<span lang="EN-US">Maximum number of days between password
change : 60</span></div>
<div class="MsoNormal">
<span lang="EN-US">Number of days of warning before password
expires : 7</span></div>
<div class="MsoNormal">
<br /></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US">4. To change password inactive field: Set the number of days of inactivity after a password has expired before the account is locked. The INACTIVE option is the number of days of inactivity.</span></div>
<div class="MsoNormal" style="text-align: justify;">
</div>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none; margin-left: 0px; margin-right: 0px; text-align: left;">
<tbody>
<tr style="height: 116.35pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background: #A6A6A6; border: solid windowtext 1.0pt; height: 116.35pt; mso-background-themecolor: background1; mso-background-themeshade: 166; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 416.95pt;" valign="top" width="556"><div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US"># chage -I 5 transfer_user</span></div>
<div class="MsoNormal">
<span lang="EN-US"># chage -l transfer_user</span></div>
<div class="MsoNormal">
<span lang="EN-US">Last password change : Jun 22,
2012</span></div>
<div class="MsoNormal">
<span lang="EN-US">Password expires : Aug
21, 2012</span></div>
<div class="MsoNormal">
<span lang="EN-US">Password inactive : Aug
26, 2012</span></div>
<div class="MsoNormal">
<span lang="EN-US">Account expires :
Sep 01, 2012</span></div>
<div class="MsoNormal">
<span lang="EN-US">Minimum number of days between password
change : 7</span></div>
<div class="MsoNormal">
<span lang="EN-US">Maximum number of days between password
change : 60</span></div>
<div class="MsoNormal">
<span lang="EN-US">Number of days of warning before password
expires : 7</span></div>
<div class="MsoNormal">
<br /></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
There are other options we can use with chage commang:</div>
<div style="text-align: justify;">
</div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US"><b> -m</b>: Set the minimum number of days between
password changes to MIN_DAYS.</span></div>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US"> <b>-M:</b> Set the maximum number of days during
which a password is valid. When MAX_DAYS plus LAST_DAY is less than the current
day, the user will be required to change his/her password before being able to
use his/her account.</span></div>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US"><b> -W:</b> Set the number of days of warning
before a password change is required. The WARN_DAYS option is the number of
days prior to the password expiring that a user will be warned his/her password
is about to expire.</span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
If you have any doubts regarding user administration please comment. </div>
Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0Vasant Vihar, Thane West, Thane, Maharashtra, India19.2245131 72.968201719.2095201 72.9484607 19.2395061 72.987942699999991tag:blogger.com,1999:blog-1207220632147534751.post-75021790799995811382012-07-15T14:09:00.000+05:302013-07-17T23:07:11.602+05:30Usermod for modifying user attributes<div style="text-align: justify;">
In day to day system administration, many times we work with users and group and have to change user attributes like, to change user's home directory, inactive password, change group or add supplementary group, lock or unlock user's password etc.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In Redhat Enterprise Linux 6 changing user's attributes can be done with <i><b>"usermod"</b></i> command. Usermod command can be helpful for system administration as well as in RHCSA exam, as user administration is one of RHCSA/RHCE exam. In this post we will discuss about usermod command to modify different user attributes.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
1. To add user to a supplementary group use usermod -a command</div>
<div style="text-align: justify;">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none; margin-left: 0px; margin-right: 0px; text-align: left;">
<tbody>
<tr style="height: 25.95pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background: #A6A6A6; border: solid windowtext 1.0pt; height: 25.95pt; mso-background-themecolor: background1; mso-background-themeshade: 166; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 209.3pt;" valign="top" width="279"><div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US"># usermod –a group3 user1</span></div>
<div class="MsoNormal">
<br /></div>
</td>
</tr>
</tbody></table>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
2. To change users GECOS/comment field use usermod -c</div>
<div style="text-align: justify;">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none; margin-left: 0px; margin-right: 0px; text-align: left;">
<tbody>
<tr style="height: 25.95pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background: #A6A6A6; border: solid windowtext 1.0pt; height: 25.95pt; mso-background-themecolor: background1; mso-background-themeshade: 166; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 399.9pt;" valign="top" width="533"><div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US"># usermod –c “User for transfer files” transfer_user</span></div>
<div class="MsoNormal">
<span lang="EN-US"># cat /etc/passwd |grep transfer_user</span></div>
<div class="MsoNormal">
<span lang="EN-US">transfer_user:x:502:502:User for transfer
files:/home/transfer_user:/bin/bash</span></div>
<div class="MsoNormal">
<br /></div>
</td>
</tr>
</tbody></table>
<div style="text-align: justify;">
we can also use <i><b>chfn </b></i>command to change finger information.<br />
<div style="text-align: left;">
<br /></div>
</div>
<div style="text-align: justify;">
3. To change user's home directory</div>
<div style="text-align: justify;">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none; margin-left: 0px; margin-right: 0px; text-align: left;">
<tbody>
<tr style="height: 25.95pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background: #A6A6A6; border: solid windowtext 1.0pt; height: 25.95pt; mso-background-themecolor: background1; mso-background-themeshade: 166; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 399.9pt;" valign="top" width="533"><div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US"># usermod –d /transhome transfer_user</span></div>
<div class="MsoNormal">
<span lang="EN-US"># cat /etc/passwd |grep transfer_user</span></div>
<div class="MsoNormal">
<span lang="EN-US">transfer_user:x:502:502:User for transfer
files:/transhome:/bin/bash</span></div>
<div class="MsoNormal">
<br /></div>
</td>
</tr>
</tbody></table>
<div style="text-align: justify;">
use -m option to copy all files from old home directory to new home directory. </div>
<div style="text-align: justify;">
<br />
4. To change user's primary group</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
</div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none; margin-left: 0px; margin-right: 0px; text-align: left;">
<tbody>
<tr style="height: 67.0pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background: #A6A6A6; border: solid windowtext 1.0pt; height: 67.0pt; mso-background-themecolor: background1; mso-background-themeshade: 166; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 379.0pt;" valign="top" width="505"><div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US"># id transfer_user</span></div>
<div class="MsoNormal">
<span lang="EN-US">uid=502(transfer_user) <b style="mso-bidi-font-weight: normal;">gid=502(transfer_user)
groups=502(transfer_user)</b></span></div>
<div class="MsoNormal">
<span lang="EN-US"># groupadd file_transfer</span></div>
<div class="MsoNormal">
<span lang="EN-US"># usermod -g file_transfer transfer_user</span></div>
<div class="MsoNormal">
<span lang="EN-US"># id transfer_user</span></div>
<div class="MsoNormal">
<span lang="EN-US">uid=502(transfer_user) <b style="mso-bidi-font-weight: normal;">gid=503(file_transfer)
groups=503(file_transfer)</b></span></div>
<div class="MsoNormal">
<br /></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US"> The group must exist.</span></div>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US">5. To add a supplementary group.</span></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US"> </span>
</div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none; margin-left: 0px; margin-right: 0px; text-align: left;">
<tbody>
<tr style="height: 67.0pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background: #A6A6A6; border: solid windowtext 1.0pt; height: 67.0pt; mso-background-themecolor: background1; mso-background-themeshade: 166; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 471.15pt;" valign="top" width="628"><div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US"># usermod -G transfer_user transfer_user</span></div>
<div class="MsoNormal">
<span lang="EN-US"># id transfer_user</span></div>
<div class="MsoNormal">
<span lang="EN-US">uid=502(transfer_user)
gid=503(file_transfer) groups=503(file_transfer), <b>502(transfer_user)</b></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US"><br /></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US">6. Lock or unlock a user's password.</span></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US"><br /></span></div>
<div class="MsoNormal" style="text-align: justify;">
</div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none; margin-left: 0px; margin-right: 0px; text-align: left;">
<tbody>
<tr style="height: 67.0pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background: #A6A6A6; border: solid windowtext 1.0pt; height: 67.0pt; mso-background-themecolor: background1; mso-background-themeshade: 166; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 350.65pt;" valign="top" width="468"><div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US"># passwd -l transfer_user</span></div>
<div class="MsoNormal">
<span lang="EN-US">Locking password for user transfer_user.</span></div>
<div class="MsoNormal">
<span lang="EN-US">passwd: Success</span></div>
<div class="MsoNormal">
<span lang="EN-US"># passwd -u transfer_user</span></div>
<div class="MsoNormal">
<span lang="EN-US">Unlocking password for user
transfer_user.</span></div>
<div class="MsoNormal">
<span lang="EN-US">passwd: Success</span></div>
<div class="MsoNormal">
<br /></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US">Usermod command is very useful for system administrators to manage users and groups.</span></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US">You can find some of above mentioned commands very useful in RHCSA and RHCE exams.</span></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US"><br /></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US">If you are preparing for the Certification exams, try to read man pages for commands, make it your habit so you can learn more easy ways to do tasks in examination and try to concentrate on command based administration.</span></div>
<div class="MsoNormal" style="text-align: justify;">
</div>
<div class="MsoNormal" style="text-align: justify;">
</div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US"></span></div>
Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0Vasant Vihar, Thane West, Thane, Maharashtra, India19.2245131 72.968201719.2095201 72.9484607 19.2395061 72.987942699999991tag:blogger.com,1999:blog-1207220632147534751.post-74482633679680933262012-05-31T15:30:00.000+05:302013-07-17T23:07:07.740+05:30/etc/skell (USER ADMINISTRATION)In Redhat Enterprise Linux 6 (RHEL 6), when a user is created it have its own home directory. In user's home directory there are some hidden files like .bash_profile, .bashrc, etc. These hidden files automatically created in user's home directory when useradd add command is used to create a user.<br />
<br />
There is a directory, in RHEL, <b>/etc/skel</b> which serves as a skeleton for user's home directory, Whenever a user is created all files in <b>/etc/skell</b> are copied in user's home directory. Mainly this directory contains below mentioned files:<br />
<br />
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-IN</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
<w:UseFELayout/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
</style>
<![endif]-->
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: none; margin-left: -.95pt; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt;">
<tbody>
<tr style="height: 50.35pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background: #BFBFBF; border: solid windowtext 1.0pt; height: 50.35pt; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 348.55pt;" valign="top" width="465"><div class="MsoNormal" style="margin-left: 6.35pt;">
<span lang="EN-US">.bash_logout</span></div>
<div class="MsoNormal" style="margin-left: 6.35pt;">
<span lang="EN-US">.bash_profile</span></div>
<div class="MsoNormal" style="margin-left: 6.35pt;">
<span lang="EN-US">.bashrc</span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal">
<br /></div>
<br />
/<b>etc/skel </b>directory can be used to set default properties for user, also to give all users a set of required file. This can be useful for a system administrator to give default files to every new user which he/she creates using <b>useradd </b>command . If you put some file in <b>/etc/skel </b>directory, these files will be automatically copied to home directory of a user when you create a new user.<br />
<br />
<br />
Please comment if you have any doubts about User Administration in Linux or any questions related to RHCSA and RHCE exams....Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0Vasant Vihar, Thane West, Thane, Maharashtra, India19.2245131 72.968201719.2095201 72.9484607 19.2395061 72.987942699999991tag:blogger.com,1999:blog-1207220632147534751.post-7653452086664961922012-05-30T15:30:00.000+05:302013-07-17T23:07:03.456+05:30/etc/default/useradd (USER ADMINISTRATION)User administration in Redhat Enterprise Linux (RHEL 6) is quiet interesting. When a user is created, different properties related to user are implemented, and these default user properties are stored in different files. User properties like, where user's home directory is to be created, what should be the user's shell, etc are taken from a file "<b>user/default/useradd"</b>.<br />
<br />
When <b>useradd</b> command executed, it takes some of user property values form a file called <b>/user/default/useradd</b> from where it gets the following values:<br />
<br />
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-IN</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
<w:UseFELayout/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
</style>
<![endif]-->
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: none; margin-left: 2.2pt; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt;">
<tbody>
<tr style="height: 116.6pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background: #BFBFBF; border: solid windowtext 1.0pt; height: 116.6pt; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 413.5pt;" valign="top" width="551"><div class="MsoNormal">
<span lang="EN-US">GROUP=100</span></div>
<div class="MsoNormal">
<span lang="EN-US">HOME=/home</span></div>
<div class="MsoNormal">
<span lang="EN-US">INACTIVE=-1</span></div>
<div class="MsoNormal">
<span lang="EN-US">EXPIRE=</span></div>
<div class="MsoNormal">
<span lang="EN-US">SHELL=/bin/bash</span></div>
<div class="MsoNormal">
<span lang="EN-US">SKEL=/etc/skel</span></div>
<div class="MsoNormal">
<span lang="EN-US">CREATE_MAIL_SPOOL=yes</span></div>
<div class="MsoNormal">
<br /></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US">Description : -</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US"><b>1. GROUP</b>: Maximum number of groups for which a user can be a member of.<br /><br /><b>2. HOME :</b> Directory where the user's home directory will be created.<br /><br /><b>3. INACTIVE:</b> Number of days the account should be inactive after creation.<br /><br /> <b>Note:</b> "-1" means never inactive i.e. always active<br /><br /><b>4. EXPIRE:</b> Date on which the account should expire. It is given in the form YYYY-MM-DD.<br /><br /><b>5. SHELL:</b> Default login shell for the user.<br /><br /><b>6. SKEL:</b> Directory from where the default user profile files will be copied to the user's home directory.<br /><b><br />7. CREATE_MAIL_SPOOL:</b> This option ensures that a new user will have a directory of its user name in /var/main where the mail process can store mail messages. </span></div>
<div class="MsoNormal">
<span lang="EN-US"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-US">By editing this file from command line, you can change the default shell and directory containing home directories for new users on Linux Operating System.</span></div>
<div class="MsoNormal">
</div>
Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com8Vasant Vihar, Thane West, Thane, Maharashtra, India19.2245131 72.968201719.2095201 72.9484607 19.2395061 72.987942699999991tag:blogger.com,1999:blog-1207220632147534751.post-52684666641115465222012-05-27T15:30:00.000+05:302013-07-17T23:06:56.319+05:30Understanding /etc/login.defsUser administration is, I think, the basic but most important part of any system administrator's job. In production environment we have to do some security hardening related with user and groups. In Redhat Enterprise Linux 6 (RHEL6) we have a file called <b>/etc/login.defs</b> which have default password policy for users. Some times we have to change the password policy according to the organization's user policy, like minimum password length, password expiration period, etc.<br />
<br />
We can apply password policy through graphical user administration tool, but I would suggest to use command line tool to change password policy. To change password policy through command line in Linux, we just have to edit <b>/etc/login.defs</b> file. Only root user can edit this file.<br />
<br />
When <b>useradd</b> command used a user is created and then useradd binary now proceeds with the process of user creation and goes to the /etc/login.defs file to get following values from the file :<br />
<br />
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-IN</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
<w:UseFELayout/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
</style>
<![endif]-->
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none; margin-left: 9.2pt; width: 621px;">
<tbody>
<tr style="height: 180.95pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background: #D9D9D9; border: solid windowtext 1.0pt; height: 180.95pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 465.75pt;" valign="top" width="621"><div class="MsoNormal">
<span lang="EN-US">MAIL_DIR<span style="mso-spacerun: yes;"> </span>/var/spool/mail</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US">PASS_MAX_DAYS<span style="mso-spacerun: yes;"> </span>99999</span></div>
<div class="MsoNormal">
<span lang="EN-US">PASS_MIN_DAYS<span style="mso-spacerun: yes;"> </span>0</span></div>
<div class="MsoNormal">
<span lang="EN-US">PASS_MIN_LEN<span style="mso-spacerun: yes;"> </span>5</span></div>
<div class="MsoNormal">
<span lang="EN-US">PASS_WARN_AGE<span style="mso-spacerun: yes;"> </span>7</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US">UID_MIN<span style="mso-spacerun: yes;"> </span>500</span></div>
<div class="MsoNormal">
<span lang="EN-US">UID_MAX<span style="mso-spacerun: yes;"> </span>60000</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US">GID_MIN<span style="mso-spacerun: yes;"> </span>500</span></div>
<div class="MsoNormal">
<span lang="EN-US">GID_MAX<span style="mso-spacerun: yes;"> </span>60000</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US">CREATE_HOME<span style="mso-spacerun: yes;"> </span>yes</span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US">Description : -<br />-----------<br /><b> 1. MAIL_DIR: </b>Directory where the user's mail will be stored.</span></div>
<div class="MsoNormal">
<span lang="EN-US"><br /><b> 2. PASS_MAX_DAYS:</b> Maximum number of days for the validity of a password.</span></div>
<div class="MsoNormal">
<span lang="EN-US"><br /> <b>3. PASS_MIN_DAYS:</b> Minimum number of days gap before a password can be changed again.</span></div>
<div class="MsoNormal">
<span lang="EN-US"><br /> <b>4. PASS_MIN_LEN:</b> Minimum required length of a password.</span></div>
<div class="MsoNormal">
<span lang="EN-US"><br /> <b>5. PASS_WARN_AGE:</b> Warning for password expiry to be given before the stipulated number of days.</span></div>
<div class="MsoNormal">
<span lang="EN-US"><br /><b> 6. UID_MIN:</b> Minimim value for automatic user id selection.</span></div>
<div class="MsoNormal">
<span lang="EN-US"><br /><b> 7. UID_MAX: </b>Maximum value for automatic user id selection.</span></div>
<div class="MsoNormal">
<span lang="EN-US"><br /><b> 8. GID_MIN:</b> Minimum value for automatic group id selection.</span></div>
<div class="MsoNormal">
<span lang="EN-US"><br /><b> 9. GID_MAX:</b> Maximum value for automatic group id selection.</span></div>
<div class="MsoNormal">
<span lang="EN-US"><br /><b>10. CREATE_HOME: </b>Whether useradd should create home directories for users .</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US">If we change these values in /etc/login.defs file, when new user is created, the user will hold the new values. </span></div>
<div class="MsoNormal">
<span lang="EN-US"><br /></span></div>
<div class="MsoNormal">
<br /></div>
Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0Vasant Vihar, Thane West, Thane, Maharashtra, India19.2245131 72.968201719.2095201 72.9484607 19.2395061 72.987942699999991tag:blogger.com,1999:blog-1207220632147534751.post-69757437996748431772012-05-23T04:00:00.000+05:302013-07-17T23:06:48.905+05:30User Administration and /etc/gshadowIn Redhat Enterprise Linux /etc/gshadow is one of the file is rarely heard by users even system administrators. To learn Linux we have to know all command line tools and important files. In this post we will discuss about /etc/gshadow file.<br />
<br />
/etc/gshadow is the goup shadow file and contains the following four fields-:<br />
<br />
1. <b>Group Name</b><br />
<br />
2. Contains the encrypted <b>group password</b> of the text password which was specified using gpasswd command<br />
<br />
If the file /etc/gshadow is deleted , then this encryped password is moved to second field of /etc/group.<br />
<br />
If no password is given to group, then a '!' is displayed in the file.<br />
<br />
3. Contains <b>list of the group administrators names</b>.By default it is blank i.e. only user having same name as,group name is first group administrator.<br />
<br />
4. Contains <b>list of group members names</b>.Blank by default. <br />
<br />
<br />Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0tag:blogger.com,1999:blog-1207220632147534751.post-24749546582274978582012-05-22T21:50:00.000+05:302013-07-17T23:06:44.367+05:30Understanding /etc/group<div style="text-align: justify;">
In this post we will discuss about an important file /etc/group. To pass Redhat Certified System Administration(RHCSA) exam we need to know all important files related to user administration. In /etc/group file we can find group related all user groups in Linux operating system. </div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOVJ8wFaPWcSEUyun1E54oIbSA5SCfVrclT_aKz4Yewi0WlUXWewSpzycLW81kPyj5BReQHRgmXa4LZspy0Qa5kKq5c7KlPm_zi6R-nMLxJ-mXQq6kEXSGyd5HX_82b-0BUvmyyZLbgqA/s1600/group_member.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a></div>
<div style="text-align: justify;">
When a user is added , a user private group is created and the corresponding entry is put in /etc/group. /etc/group contains 4 fields and are </div>
<div style="text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOVJ8wFaPWcSEUyun1E54oIbSA5SCfVrclT_aKz4Yewi0WlUXWewSpzycLW81kPyj5BReQHRgmXa4LZspy0Qa5kKq5c7KlPm_zi6R-nMLxJ-mXQq6kEXSGyd5HX_82b-0BUvmyyZLbgqA/s1600/group_member.jpeg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="195" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOVJ8wFaPWcSEUyun1E54oIbSA5SCfVrclT_aKz4Yewi0WlUXWewSpzycLW81kPyj5BReQHRgmXa4LZspy0Qa5kKq5c7KlPm_zi6R-nMLxJ-mXQq6kEXSGyd5HX_82b-0BUvmyyZLbgqA/s320/group_member.jpeg" width="320" /></a>explained below<br />
<br />
1. <u><b>GROUP NAME</b></u>: which is the same as USER_NAME which is specified with the useradd command.<br />
<br />
2. <u><b>GROUP PASSWORD</b></u>: Group Password can be given using the command gpasswd .<br />
<br />
For eg: <b>gpasswd pawan</b><br />
Changing the password for group pawan<br />
New Password:<br />
Re-enter new password:<br />
<br />
3. <u><b>GID </b></u>-> Group ID which is the same as UID.<br />
<br />
4. The last field discribe ther members of the group except the user which is already a member of the group .<br />
<br />
A user is added to a group using the follwing command -:<br />
<br />
<b>usermod -G GROUP_NAME USER_NAME</b><br />
<br />
For eg: <b>usermod -G pawan major_group</b><br />
<br />
A Group can also be created using the command groupadd<br />
<br />
For eg: <b>groupadd major_group</b><br />
<br />
An entry for the "major_group" group will be placed in the file /etc/group.<br />
<br />
If we want to give same permissions to few users, we can make them member of a group. By making some users member of a group we can give permission to that group and all users in that group will get that permission. We can also set Access Control Lists (ACL) on group.<br />
<br /></div>
Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0Vasant Vihar, Thane West, Thane, Maharashtra, India19.2245131 72.968201719.2095201 72.9484607 19.2395061 72.987942699999991tag:blogger.com,1999:blog-1207220632147534751.post-20925332859641027772012-05-22T19:24:00.000+05:302013-07-17T23:06:39.663+05:30Understanding: /etc/shadow (User Account Management)<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
RHCSA exam focus on basic system administration, and questions asked in RHCSA are similar situations which you will face in real environment.</div>
<div style="text-align: justify;">
<i><b>/etc/shadow</b></i> is not commonly used file, but is very important as far as User Administration and RHCSA is concern.</div>
<div style="text-align: justify;">
<i><b> /etc/shadow</b></i> contains password related information for user and groups on the system. This file stores actual password in encrypted format for user's account with additional properties related to user password. Only root user can read shadow file, other users can not read this file.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
There are 9 fields in /etc/shadow file seperated by ':' i.e. IFS (Internal Field Seperator) ,and they are explaeind as below -:An example entry of <i><b>/etc/shadow </b></i>is given below:</div>
<div style="text-align: justify;">
<b><br />
</b></div>
<div style="text-align: justify;">
<b>pawan:$1$J6/rsxw3$TEcDpPsW0gx9035DFNlUU/:15162:0:99999:7:::</b></div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
Each entry in /etc/shadow contains 9 fields which are separated by ":".</div>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbOT2oEk5aLdKC_6WOC01-XgXbB6MQgSMhfiMvDMs96SSi3BsAMK-FiqB-PrJ-C78gdMuEkNvoP6pq1u7UNDpsqriyiAVSaI2-QfTZHJXfBd1XlLwsKe2Odj2f7mTo2iCwsDcY5AecW-E/s1600/shadow.jpg" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="201" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbOT2oEk5aLdKC_6WOC01-XgXbB6MQgSMhfiMvDMs96SSi3BsAMK-FiqB-PrJ-C78gdMuEkNvoP6pq1u7UNDpsqriyiAVSaI2-QfTZHJXfBd1XlLwsKe2Odj2f7mTo2iCwsDcY5AecW-E/s320/shadow.jpg" width="320" /></a></td></tr>
<tr style="color: #0b5394;"><td class="tr-caption" style="text-align: center;"><b>/etc/shadow</b></td></tr>
</tbody></table>
<b><u>1. Username</u>:</b> It is used when user log-in. It should be between 1 to 32 character.</div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<u><b>2. Password</b></u><b>:</b> It is a user's encrypted password. The password should be minimum of 6 to 8 characters long including special characters/digits.</div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<b>3</b>. Days since Unix epoch password was changed (Jan 1 1970). This can also be interpreted as the field , if chaged to 0 , the user password is immdeatly expired . When the user logs in the next time , he is forced to change his pasword ( root enforced ).</div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<u><b>4. Minimum</b></u><b>:</b> Days left before password may be changed. This can also be interpreted as number of days after which the password is allowed to be changed.This is to stop user from changing his password very frequently . Normally is given 0 , so that user can change his password the number of times he desires.</div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<b><u>5. Maximum</u>:</b> days after which password must be changed. This field is used to put the restriction on the maximum no. of days that a password can be used by the user.After the no. specified in the file against this file expires , he/she is forced to change their password.<br />
<br />
<b><u>6. Warn</u>:</b> The days before password is to expire, that user is warned that his/her password must be changed.</div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<b><u>7. Inactive(Password Grace Field)</u>:</b> The days after password expires, that account is disabled. This field is used as warning period alloted to user after his account's password is expired as specified by the 5th and 6th field. After this period the user's account is disabled and can only be re-enabled by the root user.</div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<b>8</b>. This field is used as an emergency disable field by the root user. If 0 is given in this field , the user account will be disabled immediately and he cannot login till the time root does not remove this restriction.<b><br /> </b></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<b>9. </b>This field is reserved for future use.<br />
5th , 6th and 7th field combined together can be used by the root to make a policy to make sure that passowrd is changed after a specified no of days , keeping in account grace and warning field. If the user is not able to comply for any perticular reason,his account is blocked.</div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<ol style="text-align: justify;">
</ol>
<ol style="text-align: justify;"><input name="IL_RELATED_TAGS" type="hidden" value="1" />
</ol>
<div style="text-align: justify;">
<br />
Using this file you can manage password properties.</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
Please click on facebook like button if you like the post.</div>
<div style="text-align: justify;">
<br /></div>
<ol style="text-align: justify;"></ol>
</div>
Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0Vasant Vihar, Thane West, Thane, Maharashtra, India19.2245131 72.968201719.2095201 72.9484607 19.2395061 72.987942699999991tag:blogger.com,1999:blog-1207220632147534751.post-63875355981766758482012-05-21T17:00:00.000+05:302013-07-17T23:06:31.216+05:30Understanding: /etc/passwd (User Account Management)<div style="text-align: justify;">
In this post we will discuss one of the most important file in Redhat Enterprise Linux (RHEL), which is <i><b>/etc/passwd.</b></i> This file is very important because this serves as a default database of user on the system. Using /etc/passwd we can add users, modify user settings, etc from command line.</div>
<div style="text-align: justify;">
For user administration part of the RHCSA Exam this is the most important file. Using /etc/passwd you can do the exam tasks and also check the results to confirm your completed tasks related to users.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
An example entry of <i><b>/etc/passwd</b></i> is given below:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<i><b>pawan:x:501:501:Pawan Sharma:/home/pawan:/bin/bash</b></i></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Each entry in <i><b>/etc/passwd </b></i>file contains 7 fields.</div>
<div style="text-align: justify;">
<br /></div>
<ol style="text-align: justify;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL2ALs9u46a32JlWA7krG5_Rlzwxf8G8WF8D3nbuweGt58dkNBPq2adi8mFf_Kvg-AgLLJXxhLUNWlwKWu9LwDMGyaYAO_nfdjABwc7LOXoAyLAx6AzHKC08P_F-4SpCywJ8F57ErbU3M/s1600/passwd.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="230" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL2ALs9u46a32JlWA7krG5_Rlzwxf8G8WF8D3nbuweGt58dkNBPq2adi8mFf_Kvg-AgLLJXxhLUNWlwKWu9LwDMGyaYAO_nfdjABwc7LOXoAyLAx6AzHKC08P_F-4SpCywJ8F57ErbU3M/s320/passwd.png" width="320" /></a>
</ol>
<b>1. <u>Username</u>:</b> It is used when user log-in. It should be between 1 to 32 character. <br />
<br />
<b>2. <u>Password</u>:</b> An <b>'x'</b> character indicates that encrypted password is stored in <i><b>/etc/shadow</b></i> file. The <b>'x'</b> refers and matches password value from /etc/shadow file. If we put * inplace of x then user can't login. If we keep second field blank then user can login without password.<br />
<br />
<b>3. <u>User ID (UID)</u>: </b>Each user must be assigned a User ID (UID). UID=0 is reserved for root user and UID 1 to 99 are reserved for other predefined accounts. It is a unique identity number for every user on the system.<br />
<br />
<b>4. <u>Group ID (GID)</u>:</b> Whenever a user is created a primary group is also created for a user. Every user have its own primary group but it can also have supplementary groups.<br />
<b></b><br />
<br />
<b>5. <u>GECOS</u>:</b> This is optional and only used for informational purpose. Usually it contains the fill name of the user. You can say it as a comment field.<br />
<br />
<b>6. <u>Home Directory</u>:</b> It represents the absolute path to the user's home directory. If this directory does not exist the <b>'/' </b>directory becomes the users home directory.<br />
<br />
<b>7. <u>Shell</u>:</b> The absolute path of command or shell (<b>/bin/bash</b>). Typically this field contain information about user's default shell.<br />
<ol style="text-align: justify;">
<input name="IL_RELATED_TAGS" type="hidden" value="1" />
</ol>
<div style="text-align: justify;">
This file is one of the most important file as far as RHCSA is concerned. So do a lot of experiments on this file, but before making any changes to this file take a backup of this file.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
If you have any questions regarding user administration or <b>/etc/passwd</b> please ask me. I will try to answer.....</div>
<div style="text-align: justify;">
<br /></div>
<ol style="text-align: justify;"></ol>
Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0tag:blogger.com,1999:blog-1207220632147534751.post-78279949012544438262012-05-21T12:45:00.000+05:302012-05-29T21:57:18.462+05:30User Administration in Linux<div dir="ltr" style="text-align: justify;" trbidi="on">
<span style="font-size: large;"><b>U</b></span>ser administration is the most important part of Linux system administration. It is one of the most important objective of RHCSA and RHCE certification exam. In Linux Users and Groups can be administered using user/group administration GUI tool, also users can be created through command line as well in Redhat Enterprise Linux. But I will suggest you to use command line user administration commands as much as possible because in production environment GUI won’t be provided. Many people who are learning Linux don’t know all features of user administration commands and related files. In the next few posts we will discuss all about the user administration and features.<br />
<br />
There are three types of users in Linux.</div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
<br />
1. <b>Superuser</b>: At the time of Linux installation it is create. Root user has right to make other users & his “userid” & “groupid” is zero in “/etc/passwd” file.<br />
2. <b>Systemuser</b>: These users create by System. They can't login because their shell ‘sbin/noloin’ is default in seventh field in `/etc/passwd' file.<br />
3. <b>Normaluser</b>: These users create by superuser.<br />
<br />
To add a user from command line we need to use a command <b>useradd/adduser</b>:</div>
<div style="text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIO4QeOJxRCmd6jcbCI-zSI4XLSD-krgDg3jNlsLObTps9_851vIzWkJFRv4o6qgm3xliVE3ziS48Zdh9HxAeZsVwg5DSfRyIOIdGUuDZZPGfAQVOh1NDp5qTQPOy_7pu6EGY5wiA_bIw/s1600/User+admin.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img alt="user and group in Red hat enterprice linux" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIO4QeOJxRCmd6jcbCI-zSI4XLSD-krgDg3jNlsLObTps9_851vIzWkJFRv4o6qgm3xliVE3ziS48Zdh9HxAeZsVwg5DSfRyIOIdGUuDZZPGfAQVOh1NDp5qTQPOy_7pu6EGY5wiA_bIw/s1600/User+admin.jpg" title="user administration in linux" /></a>For example <b>“useradd pawan”</b>.<br />
<br />
adduser is not a binary but it is a symlink to the old unix command useradd which is present in /usr/sbin directory and this command can only be executed by root. In total, 69 things happen when a command useradd is given, we will discuss all.<br />
<br />
When <b>useradd </b>command executed, the information of useradd store in two main configuration files ‘passwd’ & ‘group’ these are related with other configuration files.<br />
<br />
Configuration files<br />
<br />
|----<a href="http://linuxsuperuser07.blogspot.in/2011/07/understanding-etcpasswd-user-account.html" target="_blank">/etc/passwd</a><br />
|<br />
|----<a href="http://linuxsuperuser07.blogspot.in/2012/05/understanding-etcgroup.html" target="_blank">/etc/group</a><br />
|<br />
|----<a href="http://linuxsuperuser07.blogspot.in/2011/07/understanding-etcshadow-user-account.html" target="_blank">/etc/shadow</a><br />
|<br />
|----<a href="http://linuxsuperuser07.blogspot.in/2012/05/user-administration-and-etcgshadow.html" target="_blank">/etc/gshadow</a><br />
|<br />
|----<a href="http://linuxsuperuser07.blogspot.in/2012/05/understanding-etclogindefs.html" target="_blank">/etc/login.defs</a><br />
|<br />
|----/etc/default/useradd<br />
|<br />
|----/etc/skel<br />
<br />
We will discuss about all these files in details in next post.</div>
<br /></div>Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0Vasant Vihar, Thane West, Thane, Maharashtra, India19.2245131 72.968201719.2095201 72.9484607 19.2395061 72.987942699999991tag:blogger.com,1999:blog-1207220632147534751.post-20527817255046939192012-05-16T17:00:00.000+05:302013-07-17T23:05:47.124+05:30Removing LV, VG and PV<div style="text-align: justify;">
In this post we will see haw to remove Logical Volume, Volume Group and Physical Volume. The order is, to remove Logical Volume first, then Volume Group and then Physical Volume.</div>
<div style="text-align: justify;">
<br />
1. To delete a Logical Volume first unmount the LV:</div>
<div style="text-align: justify;">
<b>umount <mount_point></b></div>
<div style="text-align: justify;">
<b> </b> </div>
<div style="text-align: justify;">
2. Then remove Logical Volume using lvremove command:<br />
<b>lvremove <lvname></b></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglExJaSs80ksvIP7MEfMupLO9dkpIfHqF7Qp5kzsCvGth23IawWLCUfax0q9BkwQC3Qme62lF2LzzEpk9g066elQJbPrR4_t1Xu-N42BiyzsTHXxN9pZVLOb0rMtUUMm7cPmap0akqXOk/s1600/12.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Removing LV, PV and VG" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglExJaSs80ksvIP7MEfMupLO9dkpIfHqF7Qp5kzsCvGth23IawWLCUfax0q9BkwQC3Qme62lF2LzzEpk9g066elQJbPrR4_t1Xu-N42BiyzsTHXxN9pZVLOb0rMtUUMm7cPmap0akqXOk/s1600/12.jpg" title="Removing LV, PV and VG" /></a></div>
After removing Logical Volume now we can remove Volume group<br />
<br />
<ul>
<li>To remove Volume Group use <b>vgremove </b>command:</li>
</ul>
<b> vgremove <vgremove></b><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5_ZkP-oD96OKGKYPgfNeH-PugDmvUU2IalvMJ_TObB-q7wzSjyTvBktPDoR4yZYfQRT2jwsP5r3Yn0B6mWe5XwGPBDDdWLZWIXpuQX-r145Y4zAUedCSASnpmeKZ65AOD23Fzz7SXnBE/s1600/13.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Removing Logical Volume" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5_ZkP-oD96OKGKYPgfNeH-PugDmvUU2IalvMJ_TObB-q7wzSjyTvBktPDoR4yZYfQRT2jwsP5r3Yn0B6mWe5XwGPBDDdWLZWIXpuQX-r145Y4zAUedCSASnpmeKZ65AOD23Fzz7SXnBE/s1600/13.jpg" title="Removing LV, VG and PV" /></a></div>
<b> </b><br />
<ul style="text-align: justify;">
<li> To remove Physical Volume use pvremove command:</li>
</ul>
<div style="text-align: justify;">
<b> pvremove <pvname></b></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWBAgC2QXsMeouGeZCNQ2PYLvbks9qVbajIfJjn-IxVKPDzZpRhO2vwgMHVdFKWCxW5bGvAfhQk8DI4jC-fmC8OnyTOfPVlGGhFV36VV8-OPzp2gSoCBP14dtNsSrSdtiGjGz83er78ro/s1600/14.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Removing Physical Volume" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWBAgC2QXsMeouGeZCNQ2PYLvbks9qVbajIfJjn-IxVKPDzZpRhO2vwgMHVdFKWCxW5bGvAfhQk8DI4jC-fmC8OnyTOfPVlGGhFV36VV8-OPzp2gSoCBP14dtNsSrSdtiGjGz83er78ro/s1600/14.jpg" title="Removing Volume Group" /></a></div>
<br />
<div style="text-align: justify;">
Here we complete the LVM part of RHCSA and RHCE exam objective. For any questions related to Logical Volume Manager please post comments.</div>
Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0Vasant Vihar, Thane West, Thane, Maharashtra, India19.2245131 72.968201719.2095201 72.9484607 19.2395061 72.987942699999991tag:blogger.com,1999:blog-1207220632147534751.post-85069677256205936602012-05-16T11:30:00.000+05:302013-07-17T23:05:39.583+05:30Reducing Size of Logical VolumeIn this post we will learn how to reduce size of a Logical Volume. It is not suggested to reduce a Logical Volume, as it may lead to data loss, but sometimes it is required to reduce a LV. If there is Logical Volume which is not using all the space an you have to take some space from it and give it to other mount point, in such situation we require to reduce a LV.<br />
<br />
In this example we will reduce Logical Volume <b>lvdata1</b> from 1Gb to 300Mb.<br />
<br />
1. To reduce a Logical Volume first we have to unmount the LV using <b>umount </b>command.<br />
2. Then run command <b>e2fsck </b>to verify the file system. This command will run a file system check on the Logical Volume:<br />
<b>e2fsck -f <full_path_of_Logical_Volume></b><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilHytAukPMNbjyIQ9X3Z2Y39quarw4fza0ZdDnQ7xkUaEn0G9g0HysFSmSSselOw_ijGzI-drcaozZAYkujxFiVFhSrbsrD5qmsOueVnhsru3iFmRG2O19D6xVFTpPoR0r06l8J3OgFhI/s1600/10.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Reducing Logical Volume." border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilHytAukPMNbjyIQ9X3Z2Y39quarw4fza0ZdDnQ7xkUaEn0G9g0HysFSmSSselOw_ijGzI-drcaozZAYkujxFiVFhSrbsrD5qmsOueVnhsru3iFmRG2O19D6xVFTpPoR0r06l8J3OgFhI/s1600/10.jpg" title="Reducing mount point size" /></a></div>
3. Then run command <b>resize2fs </b>to resize the file system to 300Mb.<br />
<b>resize2fs /dev/DATAVG/lvdata1 300M.</b><br />
<b> </b> <br />
Then reduce LV using <b>lvreduce </b>command:<br />
<b>lvreduce –L 300M /dev/DATAVG/lvdata1.</b><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuIFYAuyw3VMUma_nT70kom3wA2XLNMo5CRL0KwHYsbIkRfUeWqaylm6VDqL4LGWWh783uZhkk6GlJLl1esCa_lwVbIcJGrHugMiTPJADdTtvXRUI6_csauExLzA1Jk0n0jLiTQddMFxo/s1600/11.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Reducing Mount Point Size in RHEL" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuIFYAuyw3VMUma_nT70kom3wA2XLNMo5CRL0KwHYsbIkRfUeWqaylm6VDqL4LGWWh783uZhkk6GlJLl1esCa_lwVbIcJGrHugMiTPJADdTtvXRUI6_csauExLzA1Jk0n0jLiTQddMFxo/s1600/11.jpg" title="Recucing a Logical Volume" /></a></div>
<br />
After resizing mount point, mount the mount point using <b>mount -a</b> command.<br />
<br />
Be very careful when reducing the Logical Volume as it may cause data loss. In the next post we will see how to remove LV, VG and PV. <br />
If you have any questions please feel free to comment.<br />
<br />
<br />
<br />
<br />
<br />Pawan Sharmahttp://www.blogger.com/profile/15882606556703645653noreply@blogger.com0Vasant Vihar, Thane West, Thane, Maharashtra, India19.2245131 72.968201719.2095201 72.9484607 19.2395061 72.987942699999991