Friday, January 24, 2014

Linux Administarator Interview Questions

1. Difference between ext3 and ext4

Ans: The main benefits that ext4 has over ext3 are:

    * faster timestamping
    * faster file system checking
    * journaling checksums
    * extents (basically automatic space allocation to avoid fragmentation)

6. Set user ID, set group ID, sticky bit

In addition to the basic permissions discussed above, there are also three bits of information defined for files in Linux:

    * SUID or setuid: change user ID on execution. If setuid bit is set, when the file will be executed by a user, the process will have the same rights as the owner of the file being executed.
    * SGID or setgid: change group ID on execution. Same as above, but inherits rights of the group of the owner of the file on execution. For directories it also may mean that when a new file is created in the directory it will inherit the group of the directory (and not of the user who created the file).
    * Sticky bit. It was used to trigger process to "stick" in memory after it is finished, now this usage is obsolete. Currently its use is system dependant and it is mostly used to suppress deletion of the files that belong to other users in the folder where you have "write" access to.

. Numeric representation
Octal digit Binary value Meaning
0 000 setuid, setgid, sticky bits are cleared
1 001 sticky bit is set
2 010 setgid bit is set
3 011 setgid and sticky bits are set
4 100 setuid bit is set
5 101 setuid and sticky bits are set
6 110 setuid and setgid bits are set
7 111 setuid, setgid, sticky bits are set


1.SUID ->set userid (4)
  suid is special permission(4) set along with existing permissions, which
  allows normal user to execute command with privilege of root.

  ex:-      chmod 4770  /bin/cat

2.GUID ->set groupid (2)
  guid is special permission(2) in set to dir  by which files created
  under dir gets same owner of that of dir
 
  ex:-   chmod 2770  dir1

3.STICKYBIT ->STICKYBIT (1)
  stickybit is special permission(1) which stops non-owner of file from
  deleting the file from a dir for which  stickybit is set.
 
  ex:-   chmod 1770  /var

M1012683 M1012687 M1012692


mount -t cifs  //172.22.192.214/UNIX_RELATED -o username=administrator /mnt/


Difference between softlink and hard link


1. You cannot create a hardlink for a directory.
2. If you remove the original file of a hardlink, the link will still show you the content of the file.
3. A symlink can link to a directory.
4. A symlink, like a Windows shortcut, becomes useless when you remove the original file.

No comments:

Post a Comment