Wednesday, April 11, 2012

Linux System Admin Interview Questions & Answers part 4

1.  What is the default UID when we are creating first user.(useradd)?
A: The first user created by root will always have a UID 500.
User ID=uid. The uid of root is 0.
UID from 1 to 499 is reserved for system services such as tha user apache,nagios,etc.

2. How many users are created by default.
A: Maximum users=60,000 by default.This could be increased.

3. Fields in password and shadow file.
A: Passwd file
Root:x:0:0:0:root:/root:/bin/bash
(username: encrypted form of password: uid: gid: personal info: home dir:shell)

4. When user is created which are the files it is updated.
A: /etc/passwd – contains various pieces of information for each user account
/etc/shadow – contains the encrypted password information for user’s accounts and optional the password aging information.
/etc/gshadow – group shadow file (contains the encrypted password for group)
/home –All users data is stored here.
/etc/login.defs---Shadow password suite configuration.

5. What is the owner of /tmp (is sticky bit applied on it)
A: drwxrwxrwt  11  root 20480 Apr 21 23:27 tmp (yes).

6. How to check which kernel module is installed?
A: modinfo-c
Also you can lok for the modules at:
Code:
/lib/modules
#rpm –qa  | grep ^kernel
#uname –r
#uname –rsv

7. What are modules,advantages and disadvantages of modules.
A: Modules are non-linked drivers.
Use of modules
Allow third party commercial development of drivers
Minimise kernel size
Allow smaller generic kernels
What is a Module
Contains device specific system routines
Fills in non-boot gaps in the kernel
Can be loaded and removed dynamically
Modules In Linux
Modules are compiled per Linux release
Multiple modules live in
/lib/modules/<kernel version>/
Hence only the active version modules will load
Accept parameters.

15. How to check which disk is fault in hardware Raid level
A: # watch cat/proc/mdstat       -    Check RAID status
#mdadm /dev/md1 –fail/add/remove /dev/sda6 - For RAID partition fail,add & remove


3 comments: