Skip to main content

Posts

Showing posts from March, 2016

UNIX/Linux Advanced File Permissions - SUID,SGID and Sticky Bit

UNIX/Linux Advanced File Permissions - SUID,SGID and Sticky Bit After you have worked for a while with Linux you discover probably that there is much more to file permissions than just the "rwx" bits. When you look around in your file system you will see "s" and "t" $ ls -ld /tmp drwxrwxrwt 29 root root 36864 Mar 21 19:49 /tmp $ which passwd /usr/bin/passwd $ ls -l /usr/bin/passwd -rwsr-xr-x 1 root root 22984 Jan 6 2007 /usr/bin/passwd What is this "s" and "t" bit? The vector of permission bits is really 4 * 3 bits long. Yes there are 12 permission bits,not just 9.The first three bits are special and are frequently zero. And you almost always learn about the trailing 9 bits first.Some people stop there and never learn those first three bits. The forth permission bit is used only when a special mode of a file needs to be set. It has the value 4 for SUID, 2 for SGID and 1 for the sticky bit. The other 3 bits have

6 Stages of Linux Boot Process (Startup Sequence)

6 Stages of Linux Boot Process (Startup Sequence) Press the power button on your system, and after few moments you see the Linux login prompt. Have you ever wondered what happens behind the scenes from the time you press the power button until the Linux login prompt appears? The following are the 6 high level stages of a typical Linux boot process. 1. BIOS BIOS stands for Basic Input/Output System Performs some system integrity checks Searches, loads, and executes the boot loader program. It looks for boot loader in floppy, cd-rom, or hard drive. You can press a key (typically F12 of F2, but it depends on your system) during the BIOS startup to change the boot sequence. Once the boot loader program is detected and loaded into the memory, BIOS gives the control to it. So, in simple terms BIOS loads and executes the MBR boot loader. 2. MBR MBR stands for Master Boot Record. It is located in the 1st sector of the bootable disk. Typically /dev/hda, or /dev/sda MBR is

Determining the Number of IP Subnets and Hosts

Determining the Number of IP Subnets and Hosts Step One Use the first octet of the IP address to determine the class of address (A, B, or C). 169 . 199.109.137   = CLASS B 255.255.255.192 Step Two Use the class of the address to determine which octets are available for hosts. CLASS B =  Network. Network.   Host. Host                                      169.199. 109.137                                      255.255. 255.192 Step Three Look at the host octet(s) in the subnet mask. Use the  "Possible Masks" chart  to determine which bits are set to one. If no bits are set to one, there are no subnets. If any bits are set to one, proceed to step four. 169.199. 109.137 255.255. 255.192 = 11111111 11000000 (host octets only) Step Four Count the total number of ones in the host octet(s) of the subnet mask. Call this number X. Raise 2 to the power of X. Use the  "Powers of 2" chart  if necessary. This is the numbe

Understanding IP Addresses, Subnets, and CIDR Notation for Networking

Understanding IP Addresses, Subnets, and CIDR Notation for Networking Introduction Understanding networking is a fundamental part of configuring complex environments on the internet. This has implications when trying to communicate between servers efficiently, developing secure network policies, and keeping your nodes organized. In a previous guide, we went over some basic networking terminology . You should look through that guide to make sure you are familiar with the concepts presented there. In this article, we will discuss some more specific concepts that are involved with designing or interacting with networked computers. Specifically, we will be covering network classes, subnets, and CIDR notation for grouping IP addresses. Understanding IP addresses Every location or device on a network must be addressable . This is simply a term that means that it can be reached by referencing its designation under a predefined system of addresses. In the normal

Setting Up An iSCSI Environment On Linux

Setting Up An iSCSI Environment On Linux Nowadays, the iSCSI technology is quite popular in the storage world. This article shows an iSCSI demo environment which consists of one Debian Linux host and one Netapp Filer.We try to show the most important features of this protocol. 1. What is iSCSI? It is a network storage protocol above TCP/IP. This protocol encapsulates SCSI data into TCP packets. iSCSI allows us to connect a host to a storage array via a simple Ethernet connection (tape drive). This solution is cheaper than the Fibre Channel SAN (Fibre channel HBAs and switches are expensive). From the host view the user sees the storage array LUNs like a local disks. iSCSI devices should not be confused with the NAS devices (for example NFS). The most important difference is that NFS volumes can be accessed by multiple hosts, but one iSCSI volume can by accessed by one host. It is similar to SCSIi protocol: usually only one host has access to one SCSI disk (the difference is th