Apr 12, 2007

Interview Questions for Linux Administrator

The following are some questions which I faced from the interview board for the post of Linux Administrator. This will be update when I get more resources.
1.When do you need a virtual hosting ?
The term Virtual Host refers to the practice of maintaining more than one server on one machine, as differentiated by their apparent hostname. For example, it is often desirable for companies sharing a web server to have their own domains, with web servers accessible as www.company1.com and www.company2.com, without requiring the user to know any extra path information.
2.In which port telnet is listening?
23
3.How to get the listening ports which is greater than 6000 using netstat ?
4.How to block and openrelay ?
Open relays are e-mail servers that are configured to accept and transfer e-mail on behalf of any user anywhere, including unrelated third parties.
The qmail-smtpd daemon will consult the rcpthosts control file to determine valid destination addresses, and reject anything else.
5.What is sandwitch configuration in qmail ?
Qmail + Clam + Spamassassin- This is normally called Sandwitch configuration in qmail.
6.Advantages of Qmail ?
More secure, better designed, modular, faster, more reliable, easier to configure, don't have to upgrade it every few months or worry about being vulnerable to something due to some obscure feature being enabled
qmail supports host and user masquerading, full host hiding, virtual domains, null clients, list-owner rewriting, relay control, double-bounce recording, arbitrary RFC 822 address lists, cross-host mailing list loop detection, per-recipient checkpointing, downed host backoffs, independent message retry schedules, etc. qmail also includes a drop-in ``sendmail'' wrapper so that it will be used transparently by your current UAs.
7.What is the difference between POP3 and IMAP ?
The Difference
POP3 works by reviewing the inbox on the mail server, and downloading the new messages to your computer. IMAP downloads the headers of the new messages on the server, then retrieves the message you want to read when you click on it.
When using POP3, your mail is stored on your PC. When using IMAP, the mail is stored on the mail server. Unless you copy a message to a "Local Folder" the messages are never copied to your PC.
Scenarios of Use
POP3
· You only check e-mail from one computer.
· You want to remove your e-mail from the mail server.
IMAP
· You check e-mail from multiple locations.
· You use Webmail.
8.How to drop packets using iptables ?
Iptables -A INPUT -s xx.xx.xx.xx -d xx.xx.xx.xx -j DROP
9.Daily routines of Linux Administrators ?
*.Check the health of servers
*.Check for updates
*.Check the Backup
*.Check with the trouble ticketing system for any unread ticket.
*.Troubleshoot if there any problem
*.Installation of new servers, if needed.
*.Report to the Boss
10.How to take the Dump of a MySQL Database ?
Mysqldump databasename > dumpname
11.How to know the CPU usage of each process ?
Top, uptime
12.How to bind another IP in a NIC ?
Copy the contents eth0 to eth1, and change the ipaddress. Restart the network. .
13.Transparently proxy all web-surfing through Squid box
iptables -t nat -A PREROUTING -i eth1 -tcp --dport 80 -j DNAT --to
iptables -t nat -A PREROUTING -i eth1 -tcp --dport 80 -j DNAT --to
14.Transparently redirect web connections from outside to the DMZ web server.
iptables -t nat -A PREROUTING -i eth0 -d 192.168.1.1 -dport 80 -j DNAT –to
15 Howto Activate the forwarding
echo 1 >/proc/sys/net/ipv4/ip_forward
16.Kill spoofed packets
for f in /proc/sys/net/ipv4/conf/*/rp_filter; do
echo 1 > $f
done.
$iptables -A LDROP --proto tcp -j LOG --log-level info \ --log-prefix “TCP Drop”

12 comments:

Amal said...

The answer to the 12th question is not correct.
1) Here you are binding an ip to a 2nd NIC. not valid if the server has only one NIC.
2) Also, we cannot assume that every server will be using eth0. some may have eth0 and eth1 and eth0 may be disabled.

Amal said...

For question 15,

The solution is valid only until your next reboot. Add it to sysctl.conf to make it permanent.

ശ്രീ said...

ഉപകാരപ്രദം, നന്ദി

അമല്‍ പറഞ്ഞതും ശരി തന്നെ

സമാധാനം said...

Amal

Sorry for the Delay. I am trying to create a virtual NIC card. We can assign a different IP into the new virtual NIC card and can access through HTTP /SSH.

സമാധാനം said...

Amal
For the 15th Question you are right. But I assume this setting through script,not in command line.
So you are right. If you need it permanently,we need to add in sysctl.conf

Thanks

Unknown said...

Hi for Q12 i think you should goto the network path such as /etc/sysconfig/network-script

and copy ifcfg-eth0 as ifcfg-eth0:1

after that edit ifcfg-eth0:1
replace eth0 to eth0:1

and put the ip whatever u want ot assigned...

tombrumaht said...

Hi

I like this post:

You create good material for community.

Please keep posting.

Let me introduce other material that may be good for net community.

Source: Computer interview questions

Best rgs
Peter

Anonymous said...

Hi

Tks very much for post:

I like it and hope that you continue posting.

Let me show other source that may be good for community.

Source: Administrative interview questions

Best rgs
David

TwIsTuD™ said...

For question 12, AlIASing would be the right way to go I believe....

rhce chinmay said...

Thanks a lot.
Nice work keep update.
Regards,
Chinmay

Unknown said...

Thanks for a great information in your blog. I have read all the post of your blog.
Regards,
Linux Online Training in India

Unknown said...

Aloha,

I’ve often thought about this Interview Questions for Linux Administrator. Nice to have it laid out so clearly. Great eye opener.

I want to download Linux Mint 16; can I use the Torrent Linux Mint 16 from Kickass via Vuze easier for me as I have unreliable broadband.
Delayed allocation Ext4 uses a filesystem performance technique called allocate-on-flush, also known as delayed allocation. It consists of delaying block allocation until the data is going to be written to the disk, unlike some other file systems, which may allocate the necessary blocks before that step.
Can anybody put me right on what I actually do with the file once downloaded I want install on new desktop AMD PC I am building. Thanks for any help I receive.
Appreciate your effort for making such useful blogs and helping the community.

Obrigado,
Kevin