Tanti Technology

My photo
Bangalore, karnataka, India
Multi-platform UNIX systems consultant and administrator in mutualized and virtualized environments I have 4.5+ years experience in AIX system Administration field. This site will be helpful for system administrator in their day to day activities.Your comments on posts are welcome.This blog is all about IBM AIX Unix flavour. This blog will be used by System admins who will be using AIX in their work life. It can also be used for those newbies who want to get certifications in AIX Administration. This blog will be updated frequently to help the system admins and other new learners. DISCLAIMER: Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility. If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.

Thursday, 31 October 2013

Linux system administrator interview questions and answers for experienced

1. Ping  uses which protocol ?


ICMP, The Internet Control Message Protocol (ICMP) is one of the core protocols of the Internet Protocol Suite. It is used by the operating systems of networked computers to send error messages indicating, for example, that a requested service is not available or that a host or router could not be reached. ICMP can also be used to relay query messages.)


2. What is Syslogd?


Syslogd provides a kind of logging that many modern programs use. Every logged message contains at least a time and a hostname field, normally a program name field, too, but that depends on how trusty the logging program is.


main configuration file for syslogd is /etc/syslog.conf



3. What is Cname?


A CNAME(Canonical Name record) Record is a type of resource record in the Domain Name System (DNS) that specifies that the domain name is an alias of another, canonical domain name. Here "canonical" usually means: a more generally accepted or standard name.


4. Dns port number & protocol ?


DNS primarily uses User Datagram Protocol (UDP) on port number 53 to serve requests. DNS queries consist of a single UDP request from the client followed by a single UDP reply from the server.

The Transmission Control Protocol (TCP) is used when the response data size exceeds 512 bytes, or for tasks such as zone transfers. Some resolver implementations use TCP for all queries.

5. what is the Run levels configuration file & how to shift run levels?


A run level is a state of init and the whole system that defines what system services are operating. 


The following table defines how most Linux Distributions define the different run levels. However, run-levels 2 through 5 can be modified to suit your own tastes.

Run level numbers


0 Halt the system.

1 Single-user mode (for special administration).
2 Local Multiuser with Networking but without network service (like NFS)
3 Full Multiuser with Networking
4 Not Used
5 Full Multiuser with Networking and X Windows(GUI)
6 Reboot.

Configuration file: /etc/inittab 


to shift to different run levels use: init 1 (to shift to run level 1)


6. Dmesg command purpose?


dmesg obtains its data by reading the kernel ring buffer. A buffer is a portion of a computer's memory that is set aside as a temporary holding place for data that is being sent to or received from an external device, such as a hard disk drive (HDD). A ring buffer is a buffer of fixed size for which any new data added to it overwrites the oldest data in it.


dmesg can be very useful when troubleshooting or just trying to obtain information about the hardware on a system. Its basic syntax is


dmesg [options]


The output of dmesg is maintained in the log file /var/log/dmesg, and it can thus also be easily viewed by reading that file with a text editor, such as vi or gedit, or with a command such as cat, e.g.,


less /var/log/dmesg 


7. How to find our User login details ?


On a Linux (on Solaris/FreeBSD or any other UNIX) machine, many users will be sharing the same server.


Users will uses putty or ssh (secure and highly recommended) to login remotely.


use who comand . you can see loggedin users list.

command: who  or w

if u want to check for a particular user : who | grep


8. Purpose of nsswith.conf file ?



nsswitch.conf - System Databases and Name Service Switch configuration file



Description:


Various functions in the C Library need to be configured to work correctly in the local environment. Traditionally, this was done by using files (e.g., `/etc/passwd'), but other nameservices (like the Network Information Service (NIS) and the Domain Name Service (DNS)) became popular, and were hacked into the C library, usually with a fixed search order.


The Linux libc5 with NYS support and the GNU C Library 2.x (libc.so.6) contain a cleaner solution of this problem. It is designed after a method used by Sun Micro systems in the C library of Solaris 2. We follow their name and call this scheme "Name Service Switch" (NSS). The sources for the "databases" and their lookup order are specified in the /etc/nsswitch.conf file.



9. How to check errors in Ifconfig –a command and what information will you see in ifconfig –a ?



The following ifconfig command with -a argument will display information of all active or inactive network interfaces on server. It displays the results for eth0, lo, sit0 and tun0.


[root@testmachine ~]# ifconfig -a


eth0      Link encap:Ethernet  HWaddr 00:0B:CD:1C:18:2A

          inet addr:172.16.25.126  Bcast:173.16.25.63  Mask:255.255.255.224
          inet6 addr: fe80::20b:cdff:fe1c:185a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2344927 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2220777 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:293839516 (280.2 MiB)  TX bytes:1043722206 (995.3 MiB)
          Interrupt:185 Memory:f7fe0000-f7ff0000

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:5022927 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5022927 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2175739488 (2.0 GiB)  TX bytes:2175739488 (2.0 GiB)

sit0      Link encap:IPv6-in-IPv4

          NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00

          inet addr:10.1.1.1  P-t-P:10.1.1.2  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)



10. How To check the disk usage fot tmp directory?


du -sh /tmp


11. What is the diff b/w soft link and hard link? 


A hard link will creates another file with a link to the same underlying inode.


When you delete a file it removes one link to the underlying inode. The inode is only deleted (or deletable/over-writable) when all links to the inode have been deleted.


A symbolic link is a link to another name in the file system.


Once a hard link has been made the link is to the inode. deleting renaming or moving the original file will not affect the hard link as it links to the underlying inode. Any changes to the data on the inode is reflected in all files that refer to that inode.


Note: Hard links are only valid within the same File System. Symbolic links can span file systems as they are simply the name of another file.



12. How to change the Path in environmental variables  for /temp dir is make it temporary and permanent


Ans: will Post soon.


13. Diff b/w AD and LDAP


14. Diff b/w Terminal Service and VPN? 


15. Do you have knowledge on load balancer?


16. How you are fit in pxe and xen virtualisation?


17. How to resolve  grub reload issue to get data recovery?


18. Raid concepts what is raid 5, 1,0,1+0,0+1?


19. What is rds in vmware esxi?


20. How to monitoring running processes and how to kill particular heavy load process?


21. Diff b/w ssh and telnet? 

22. Similarity and Diff b/w AD and Ldap ?


23. What is scheduling service in windows like cron in linux?


24. What is Fault tolerance?


25. Kernal panic errors and resolving methods?


26. Type of Grub issues and fix methods ?


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//
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

Linux System Admin Interview Questions & Answers part 3

1. Echo is used to Display message on screen. Which of the following options below should be used with echo to not output the trailing newline?
answer: -n

2. mount –r is used to mount a file in read only mode
answer: True

3. Which command is most useful when you want not only to send some data down a pipe, but also to save a copy?
Answer: tee

4. There is no difference between who and whoami command?
Correct answer: False

5. When trying to compare two files using cmp, if the files differ; what is the output?
answer: tells the first byte and line number where they differ

6. Cal is used to display calendar. If no arguments are supplied, what is displayed?
answer: The current month is displayed

7. Which of the following command is used to test a network connection?
answer: ping

8. Ping will only report damaged packets.
answer: False

9. Which of the following are valid functions of Red Hat Package Manager?
Answer: Used to verify software packages.search engine to search for software’s

10. What is the Non interactive mode of nslookup used for?
answer: Fetch information about the specified host or domain

11. Nettop is used to find network usage
Answer: True

12. In _____________ state of a process, the process will be terminated and the information will still be available in the process table.
Answer: Zombie

13. Which system call is used to bias the existing property of process?
answer: bias()

14. LD_LIBRARY_PATH is a type of
answer: Environmental variable

15. What is the major difference between UNIX and LINUX?
answer: Linux is an open source and free software

16. What is the use of a pipe?
Answer: Several functions can be combined in a single statement.Stream input to output.

17. By default, the shell uses the _______________ library
answer: readline

18. The kernel cannot be updated.
answer: False

19. Which of the following below are types of shell?
answer: sh, shell

20. The ______________ file contains all the information of users on your system
Answer: /etc/passwd

21. Which directory is used to write messages when kernel is loading? answer: /var/log/messages

22. Which command is used to report on the status of the quotas that have set including the amount of allocated space and amount of used space?
answer: repquota -a

23. Linux Supports Virtualized File Systems Like RAID.
answer: True

24. When Linux is installed, which account is created by default?
answer: Root

25. Using CHMOD if we want to give ALL permissions to a user, which mode is used?
answer: 777

26. Why do we use pgrep command?
answer: To search through the currently running processes

Linux System Admin Interview Questions & Answers part 2



1. Which of the following below are true functionalities of Kernel?
answer: Allocates time and memory to programs

2. Which of the following below are true functionalities of shell?
Answer: Authenticates user Interprets commands

3. Which command is used to find what is in your home directory?
Correct answer: % ls

4. cd home to get back to your home-directory?
answer: False

5. Which command is used to clear the screen?
Correct Answer: Clear

6. The head command writes the first _____________ lines of a file to the screen.
answer: ten

7. What is used to search files for specified words or patterns?
answer: grep

8. > symbol is used to redirect the output of a command
answer: True

9. Pipe symbol is represented by
answer: |

10. Which character is used to match exactly one character?
answer: ?

11. Which command is used to see the online manual?
answer: man

12. A process is identified by a unique
answer: pid

13. A process can run only in the background
Answer: True

14. Which command reduces the size of a file?
answer: gzip

15. Find command can search for?
nswer: Files


16. How can we find the current value for shell variables?
answer: Set command

17. What is the difference between PATH and path?
answer: PATH and path specify directories to search for commands and programs

Both variables always represent the same directory list
Altering either automatically causes the other to be changed

18. What is the default number of shell commands saved in the history list of .cshrc file?
Correct answer: 200

19. What is the difference between linux file system and windows file system?
answer: Under Windows, the various partitions are detected at boot and assigned a drive letter whereas Under Linux, unless you mount a partition or a device, the system does not know of the existence of that partition or device.

20. What is the content of /etc directory?
answer: it contains all configuration file

21. /temp is a type of filesystem directory
answer: False

22. The basic function of ______________ is to search files for lines (or other units of text) that contain a
answer: awk

23. Which of the following below is/are true for Date command?
answer: It can work w/o arguments

Linux System Admin Interview Questions & Answers part 1

1. Every command in Linux is a

1. Text file
2. Stored variable
3. Executable program
4. None

 Answer: executable program

2. How long can a filename in Linux be?
Correct answer: 255 characters

3. What is the shortcut key to go to home directory?

1. shift + cd
2. cd + enter key
3. alt + ctrl + cd
4. ctrl + cd

Correct answer: cd

4. The hierarchy of a series of directories branching in a user home directory starts from?

Correct answer: /home

5. Saving open files, flush the system cache and other necessary system maintenance are allowed by.

1. Restarting the system
2. Rebooting the system
3. Logging off the system
4. Shutting down the system

Correct answer: logging off the system

6. Which directory contains configuration files that stores system and application setting?
1      /etc
2      /lib
3      /usr
4      /var

Correct answer: /etc

7. Which command is used to find data files, programs, directories that match the search argument?
Correct answer: locate

8. Applications written to provide a GUI shell for UNIX and Linux are called
Correct answer: x window

9. The advantage of using SAMBA rather than NFS for file sharing in Linux is?
Correct answer: compatibility with Windows file sharing

10. Which framework is provided for the programs to interchange information about Linux OS?

1. Resource Sharing Framework
2. Resource Security Framework
3. Information Sharing Framework
4. Resource Definition Framework

Correct answer: Resource Definition Framework

11. To implement new application on IBM z/10. Which of the following options need to be considered if it to be implemented in Linux?
Correct answer: Red Hat Linux does not support all the devices supported by IBM z/OS

12. Which of the following has greater market share of Linux SW/HW environment?
1. Linux on z10
2. Linux HP integrity servers
3. Linux on AS/400 servers locate
4. Linux on DELL Xeon

Correct answer: Linux HP integrity servers

13. Which of the following commands can be run to remove all the rules in an iptables table?
1. iptables -L
2. iptables -A
3. iptables -F
4. iptables –delete

Correct answer: iptables -F (F=Flush)

14. Which of the following is the BEST way to set up SSH(Secure Shell) for communicating between Systems without needing passwords?
1. Use ssh-keygen for generating public-private keys.
2. Disable passwords on specific accounts that will use SSH.
3. Both A and B
4. None of the above

Correct answer: Use ssh-keygen for generating public-private keys.

15. How much usable space is available, when a Linux system is configured with a RAID 5 array that consists of six 20 GB hard disk drives?
Correct answer: 100 GB

Formula: S*(N-1)
            here S=size
            N=number of HDD.  remember it is only for RAID5

16. Which of the following commands can be used to check for file corruption?

1. md5sum
2. checkfile
3. cat -vet
4. tar –checksum

Correct answer: md5sum

17. Which of the following allows to secure remote command line access?
Correct answer: SSH(Secure Shell)

18. Which of the following supports for creating a Linux VPN (Virtual Private Network)?
1. RC2
2.3DES
3. chap
4. NTLMv2

Correct answer: 3DES

19. Which of the following commands delete the files from the /tmp directory, issued by non-root user?
1.mdir -rf /tmp/*
2.rm -rf /tmp/* -su
3.su -c "rm -rf /tmp/*"
4.su "rm -rf /tmp/*"

Correct answer: su -c "rm -rf /tmp/*"

20. Which configuration does cardmgr read at Linux system startup?

1      PCMCIA     cards
2      PCI   cards
3      USB  cards
4      SCSI cards

Correct answer: PCMCIA cards

21. When a computer system is reported problems with inodes and blocks, which of the following are the problem and its solution to rectify it?

1. The file system has become corrupt and needs to be repaired.
2. The boot sector is corrupt and needs to be repaired.
3. The drive is configured using an improper file system and needs to be reformatted.
4. The partition table has become corrupt and needs to be replaced.

Correct answer: The file system has become corrupt and needs to be repaired. Use fsck command

22. Which Linux command will successfully mounts a USB drive?

1. mount /dev/uda1 /mnt/usb
2. mount /dev/sda1 /mnt/usb
3. mount -t usbfs /dev/usb001 /mnt/usb
4. mount /dev/hde1 /mnt/usb

Correct answer: mount /dev/sda1 /mnt/usb

23. ___________ is a common tool for determining services and ports running on a remote Linux.
1. arp
2. nmap
3. netstat
4. None of the above

Correct answer: nmap

24. For supporting new diskless client workstations, which of the following services needs to be installed on a server?

1      dhcpcd      and   rexec               
2      named       and   httpd                
3      remoted     and   dhcpd                        
4      PXE   (Preboot    eXecution   Environment)      and   tftpd


Correct answer: PXE (Preboot eXecution Environment) and tftpd


25. Which of the following Linux commands could be used to find what processor was detected on boot, when a laptop system is slow/
Correct answer: POST

26 . How to accomplish the LILO boot configuration updation for supporting a newly installed IDE hard drive?
Correct answer: Edit lilo.conf and run "lilo -v -v"