Linux admin interview questions Part – I

Linux admin interview questions Part – I

In this post I have explained all possible linux admin interview questions. This linux administrator interview questions are applicable for Linux beginners to linux experts. If you are going for interview be sure that you are very strong in linux basic concepts. If you are very good in basics you can easily get offer. Previously we have seen about linux interview questions for programmers.

 

Linux admin interview questions Part - I

 

1. Which command is used to view the processor details ?

ps command is used to view the process details in linux machine.

ps -ef or ps -aux

 

2. How do you monitor the live process in linux machine ?

Live process in linux machine can be monitored by using top and ps command. Monitoring tools are explained in post few linux monitoring tools

 

3.What is inode and how to view inode of a file ?

Human way of representing a file is said to be file name. Computer way of representing a file name is said to be Inode number. ls -i <filename> command is used to view inode number of a fle.

ls -i /etc/passwd
34048712 /etc/passwd

 

4. How do you find opened ports in linux operating system.

You can find opened ports using netstat command. It is explained in the post How to find out opened ports on Linux system

 

5. How do you see routing table in linux machine

The routing table of a linux machine can be found by following commands

netstat -ntpl

and

route -n

 

6. How do you check the physical memory size in linux

free -m

and

cat /proc/meminfo

we can check the physical memory size of a linux box using “free -m” command. The Memory size can also be found in “/proc/meminfo” file. Checking physical memory ram is well explained in post few ways to check memory size in linux.

 

7. How does linux operating system boots? or Explain Linux booting process?

Linux booting process is already explained in post linux os booting process

 

8.How do u schedule a task in linux? or Explain the fields in Crontab?

We can schedule a task in linux using cronjob tool. The fields of crontab and working process of crontab are explained in post crontab the job scheduler in linux.

Some times they will give you scenario with cronjob like how do you execute a script at 11:00 PM every day.

 

9.What is Swap memory and why it is used can u explain?

The swap memory is explained in post swap space it explains all the uses of swap memory.

 

10. If you lost or forget your root user password how do you recovery or reset it?

We can reset the root password by entering in to single user mode. To login to single user mode we have already seen post how to enter single user mode in linux with screenshots. Once you are login in to the single user mode user password command to reset root password.

password root

 

11. What is the port number of ssh, squid, smtp, smtps, dns, dhcp server and dhcp client,ftp, telnet, imap, pop3, imaps, pop3s and mysql.

DNS – 53
FTP Data connection – 20
FTP Control connection – 21
SSH – 22
SCP – 22
telnet – 23
imap – 143
imaps – 993
pop3 – 110
pop3s – 995
mysql – 3306
http – 80
https – 443

I have mentioned only few port numbers for more detail you can check post protocols port numbers. The file “/etc/services” in linux operating system contains all the port number details.
12. How to find linux system related information ?

Linux system related information are stored in “/proc/cpuinfo”
13.Explain about /etc/passwd, /etc/shadow and /etc/group file in linux

/etc/passwd file is explained in post details of passwd file linux.
/etc/shadow file is explained in post details of shadow file linux.
/etc/group file is explained in post details of group file in linux.

Fields of /etc/passwd, /etc/shadow and /etc/group files are also very important in interview point of view.
14. How to add a user in different folder rather inside /home/<username> ?

useradd -d /var/www/html/ftpuser ftpuser

The above command will add ftpuser inside /var/www/html/ftpuser. This command will create ftpuser folder also.

If you want to create test1 user with out home directory use following command.

useradd -d /var/www/html/ test1

 

15. How to kill a process in linux ?

We can kill a process using kill command in linux.

kill -9 <pid>

kill -15 <pid>

To know more about kill command check out post kill command with examples in linux / unix.

 

16. How to disable root ssh login in linux

Open ssh configuration file /etc/ssh/sshd_config using vim editor.

search with keyword PermitRootLogin. Then change the value of PermitRootLogin as no.

vim /etc/ssh/sshd_config
PermitRootLogin no

restart ssh service
/etc/init.d/sshd restart

That’s it root login is disabled.

 

17. How to configure apache virtual host and How many virtual host we can create in apache

If you saw you know apache webserver in interview. Then how to configure apache virtual host is an mandatory question. We can create “n” number of virtual host using apache web server but respective dns entry has to be configured. I have explained already about how to create virtual host in post install and configure apache webserver in linux

 

18. What is the use of resolve.conf file ?

The /etc/resolve.conf is client DNS file. The /etc/resolv.conf file contains nameserver entries. The nameserver which points to your DNS server.

Example:

[root@client ~] cat /etc/resolv.conf
nameserver 8.8.8.8
nameserver 192.168.1.1

In my scenario 8.8.8.8 is google open dns server and 192.168.1.1 is local dns server.

19. How to add default route in linux operating system.

syntax:

route add default gw <gateway IP > <Device>

Example:

route add default gw 10.60.1.5 eth0

 

20. How do you find which shell you are using in linux and how do you find it from linux command prompt.

Using echo $SHELL and echo $0 command we can determine linux shell.

echo $SHELL

echo $0

21.How to create a partition in linux.

In most of the interview this question will be asked. I have created a post regarding how to create a partition in linux I hope this will help.

 

 22. What is the main difference between SSH and TELNET ?

Both SSH and TELNET services are used to connect remote machine. The main difference between SSH and TELNET is at the time of connecting machine using TELNET password is send in plan text format and while connecting through SSH password is send in encrypted  method. So ultimately SSH is good when compare to TELNET.

 

23. How do you install packages in linux ?

We can install packages in linux with 3 methods

1.RPM,

2.TAR and

3. Yum repository server.

 

24. What is LILO and GRUB ?

LILO and GRUB are linux boot loader. LILO is nothing but Linux Loader and GRUB is nothing but GRand Unified Bootloader.

 

25. What are minimum partition required while installing linux operation system ?

Minimum of two partitions are enough to install linux operation system. The two linux partitions are

/boot partition and

/root partition.

Even we can configure /swap partition later after OS installation done.

Hope it is helpful. Linux admin interview question post will be continued.




One thought on “Linux admin interview questions Part – I

Leave a Reply

Your email address will not be published. Required fields are marked *