OPERATING SYSTEM BASICS
What is your favourite OS and why?
Any good unix candiate believes in 'the right tool for the job'. Anyone who says that 'Linux is the answer to everything' is fooling themselves. All the different Unix OS's have their advantages, and the key to having them explain theirs. They don't have to agree with you! that's the key. But they should at least make sense. But don't hold it against them if the answer is 'Because I know that OS the best'. It's a common one.
Why paging is used?
The act of moving pages of memory from RAM to virtual memory on a hard drive. Linux users term this as SWAP.
Explain the concept of virtual memory.
Physmem, Swap, and paging.
Virtual memory is hardware technique where the system appears to have more memory that it actually does. Paging + RAM = Virtual Memory
What is fragmentation?
Fragmentation occurs when a piece of data in memory is broken up into many pieces that are not close together
OR
Fragmentation occurs when the operating system cannot or will not allocate enough contiguous space to store a complete file as a unit, but instead puts parts of it in gaps between other files
Scattered Data
What is multi tasking?
Multi tasking: The concept of multitasking is quite similar to multiprogramming but difference is that the switching between jobs occurs so frequently that the users can interact with each program while it is running.
What is the difference between a ‘thread’ and a ‘process’?
Process: A process is a collection of virtual memory space, code, data, and system resources.
Thread: A thread is code that is to be serially executed within a process. At least one thread exists within each process. If multiple threads can exist within a process, then they share the same memory and file resources.
What is Semaphore?
Locking Mechanism used inside resource mangers and resourse dispensers.
Whats the difference between Cache and Buffer
Cache:
First time accessing the data gets cache in the RAM, Once the data is moved from disk into the cache, future use can be made by accessing the cached copy rather than refetching or recomputing the original data, so that the average access time is lower
Buffer:
Memory used to temporarily store output or input data, which is not yet written to disk.
LINUX BASICS
What are the main flavors of UNIX?
System V (five) from AT&T Berkeley Software Distribution
HP-UNIX FreeBSD
IBM-AIX NetBSD
SCO-UNIX
SOLARIS
Who introduced UNIX
Ken Thompson
What two organizations first developed UNIX?
Bell Labs
Berkeley Software Distribution
In what high level programming language is UNIX written?
“C” Programming Language
Whats the difference between SYSV and BSD
SysV BSD
1. Run control scripts are under /etc/init.d /etc/rc.d
2. Organises scripts for starting and stopping services It has a single script for each runlevel.
into a directory for each runlevel
IS linux comes under SYSV or BSD
Linux has features of both
What is FSF, GNU and GPL? Give a brief on each?
FSF: Free Software Foundation
The Free Software Foundation (FSF) is a non-profit organization founded by Richard Stallman to support the free software movement (free as in freedom), and in particular the GNU project
GNU: recursive acronym for "GNU's Not Unix". GNU is major project of FSF. Bash shell and basic linux commands like cp, mv have been developed under GNU project.
GNU (pronounced /gnu/) is a free software operating system consisting of a kernel, libraries, system utilities, compilers, and end-user applications.
GPL: General Public License
The GNU General Public License (GNU GPL or simply GPL) is a widely-used free software license, originally written by Richard Stallman for the GNU project.
General Public license which is governing document for all free softwares that it protects. It also follows the Copy left methodology or copy left notion instead of copy write. It says that you can redistribute, modify or make changes to existing software protected by the GPL providing that you won’t make it proprietary. So if you'll make any changes to any software protected by GPL, you need to redistribute the changes back to the project or back to the community so others may benefit , modify or study, redistribute. In other words, GPL provides a framework for keeping software free, so that it doesn’t becomes proprietary.
Who is the founder of FSF?
Richard Stallman
Who developed Linux kernel?
Linus Torvalds
Whats the version of kernel in different release of RedHat Linux?
Redhat Linux Version Name Date Kernel Version
7.3 Valhalla 2.4.18-3
8 Psyche 2.4.8-14
9 Shrike 2.4.20-8
Fedora Core Version Name Date Kernel Version
1 Yarrow November 5, 2003
2 Tettnang May 18, 2004
3 Heidelberg November 8, 2004
4 Stentz June 13, 2005
5 Bordeaux March 20, 2006
RedHat Enterprise Linux 2.1
Enterprise Server (Pensacola) March 26, 2002
Advanced Server (Panama) May 2003
RedHat Enterprise Linux 3 (Taroon) October 22, 2003
Enterprise Server
Advanced Server 2.4.21-32.ELsmp
RedHat Enterprise Linux 4 (Nahant) Feb 15 2005
Enterprise Server
Advanced Server
How would u explain 2.4.18-14?
How many variants of RHEL has been distributed by RedHat?
RHEL AS (advanced server) – for larger computer systems
RHEL ES (edge server or entry-level server) – for medium systems
RHEL WS (workstation) – for personal power-user desktops
Red Hat Desktop – for client-oriented single-user use
Name some of the other Linux distributor?
SUSE
Debian
Slackware
Gentoo
CentOS
What is Fedora?
Fedora is a set of projects, sponsored by Red Hat and guided by the Fedora Foundation. These projects are developed by a large community of people who strive to provide and maintain the very best in free, open source software and standards
Whats the differences between every release of Fedora Core
Whats the difference between RedHat Enterprise Linux and Fedora Core Projects
RHEL Fedora
1. RHEL is intended for commercial use Fedora Core is intended for personal, hobbyist, and developer use
2. RHEL 3 is based on still redhat 9 src code Fedora Core 3 is much advance having latest kernel
2.6 and newer developer tools.
3. RHEL 4 is based on FC3. Fedora Core 4 is having latest gcc and tools.
4. RedHat Support No Support
5. Cost Based Free
What is a kernel?The kernel is the core piece of most operating systems. It is a piece of software responsible for the communication between hardware and software components.
Is Linux Kernel a modular or monolithic?
Linux is a module-loading monolithic kernel
Modern monolithic kernels such as Linux, FreeBSD and Solaris can load executable modules at runtime, allowing easy extension of the kernel's capabilities as required, while helping to keep the amount of code running in kernelspace to a minimum.
Explain iostat, vmstat and netstat.
iostat - Reports on terminal, disk and tape I/O activity.
vmstat - Reports on virtual memory statistics for processes, disk, tape and CPU activity.
mpstat - Report processors related statistics.
netstat - Reports on the contents of network data structures.
Explain File System Hierarchy and brief into for each?
Name some top-level (under /) directories? (etc,bin,usr,var,tmp)
/proc:
procfs is short for process filesystem: a pseudo-filesystem which is used to access kernel information about processes. Because /proc is not a real file system, It was designed in order to replace the ptrace system call used for process tracing
What is the difference between binaries in /bin, and /usr/bin?
/bin - would contains the binaries frequently used by the normal user (as well as system administrator)
/usr/bin - would contains the binaries rarely used by the normal user (as well as system administrator)
What is SWAP?
Its an extension of RAM.
How you’ll check the swap usage summary?
cat /proc/swaps
swapon –s
How many number of swap files you will create? What is the maximum total size for SWAP?
Red Hat Enterprise Linux 2.1 supports upto 32 swap partitions, each can be a maximum size of 2GB. Maximum total swap size is 64GB.
RHEL 3 supports swap size till 1TB
Why SWAP size cant be more than 2GB ih RHEL 2.1
mkswap supports only 2GB, You have to have fixed mkswap to make swap larger than 2GB
How do you create a swapfile?
Lets say im running out of SWAP space, what u’ll do in this case.
I would create a swap file for temporary purpose 65Mb swap size
# dd if=/dev/zero of=/data/swapfile.1 bs=1024 count=65536
# mkswap /data/swapfile.1
# swapon –a /data/swapfile.1
And if incase I would need this swap file at boot time permanently
# dd if=/dev/zero of=/data/swapfile.1 bs=1024 count=65536
# mkswap /data/swapfile.1
Add an entry in /etc/fstab file
/data/swapfile.1 none swap pri=5,defaults 0 0
# swapon –a
How to list only the directories inside a directory
ls –l | grep "^d"
What is default permissions for others in a file?
Read Only
How much disk space should you allocate for the /proc filesystem?
We don’t have to. It does not consume any storage space, and it consumes only a limited amount of memory.
What are Linux Runlevels and how do they work
0 halt
1 single user mode
2 multi user mode (No network)
3 multi user mode (with network)
5 X windows
6 Reboot
init 6
|
inittab
|
/etc/rc.d/rc
|
/etc/rc.d/rc6.d/
What is difference between grep & find?
GREP: get regular expression
From grep you cant search files. Used to search for a string from a file
FIND:
From find you can search by filenames. Used to search for a string from a file
Which command is used to get UID/GID of a user?
id –u “username”
id –g “usrname”
What is difference between find and locate?
Locate or slocate (secure locate) uses database to index and quickly search for files on your system.
Find: Search for files in a directory hierarchy
Where’s the locate database stored?
/var/lib/slocate/slocate.db
What are the fields in the passwd file? What do they mean, what do they do?
7 fields
user:x:uid:gid:gecos:home:shell
1st field: user:
2nd field: x : specifies the encoded password is stored in /etc/shadow
5th field
GECOS: GECOS (General Electric Comprehensive Operating System)
Specifies general information about the user that is not needed by the system, such as an office or phone number.
What are the fields of the shadow file
Stores information about password aging.
9 fields
username:passwd:last:may:must:warn:expire:disable:reserved
username
The User Name
passwd
The Encoded password
last
Days since Jan 1, 1970 that password was last changed
min
The minimum period in days that must expire before the password can be changed
must
Days after which password must be changed
warn
Days before password is to expire that user is warned
Expire
Days after password expires that account is disabled
disable
Days since Jan 1, 1970 that account is disabled
reserved
A reserved field
The previous example might then be:
username:Npge08pfz4wuk:9479:0:10000::::How does enabling shadow passwd's change the functionality of user authentication?
Why is there an /etc/shadow (or similar, differently-named)file? What is in it, and how
is it different from /etc/passwd?
When a system has shadow passwords enabled, the password field in /etc/passwd is replaced by an "x" and the user's real encrypted password is stored in /etc/shadow.
How would you enable shadow password?
# pwconv
How would you disable shadow password?
# pwunconv
What are the fields of the fstab file?
6 fields
Fstab is a configuration file that contains information of all the partitions and storage devices and where should be mounted and how
Device name Mount Point FS type Mount Options Dump FSCK
LABEL=/usr /usr ext3 defaults 1 2
Dump is a backup utility. If its 0, it will not backup the file system
Fsck is a file system check utility. Numbers are define to tell in which order the file system should be
checked.
How you gonna check on which redhat linux version you are working on?# cat /etc/redhat-release
How do you find the version of Linux running?
cat /proc/version
OR
uname -r
How do you findout whether a command is an aliases, bash function, built-in like cd and type, or executable program?
# type -all yourcmd
CRON/ANACRON
Whats the difference between CRON and AnaCRON
CRON:
cron assumes your system is running. continuously. (and that crond is running).
AnaCRON:
Anacron uses a config file and time stamps to determine the last time a task was done. If the tasks is overdue to be done, anacron makes sure it gets done.anacron does not run continuously. It is a “one shot” command. It is usually invoked on bootup
Anacron looks at boot-time if something was missed while the computer was off.
Used to control the execution of daily, weekly, and monthly jobs
Define the fields of /etc/crontab
min h d m dw command
where:
●min minute (059)
●h hour (023)
●d day of the month (131)
●m month (112)
●dw day of the week (07)
How would edit the contents of a crontab?
# crontab –e
How would you list the contents of a crontab?
# crontab –l
Schedule a task to be run everyday 6pm daily
/etc/crontab
* 6 * * * /scriprts/rundaily.sh
When I add a new task to my crontab, I get an e-mail evertime it has been executed. Can this be avoided in some way?
Yes, append '> /dev/null' to your crontab entry.
Example:
30 04 * * * mydailyscript.sh > /dev/null
What's the difference between a hard link and a soft link?
Hard Link:
hard link is created by the following command
# ln fileA fileB
fileA and fileB have the same inode. How do you know this? Issue the stat command "stat fileA" and "stat fileB".
Soft Link:
soft link is created by the following command
# ln -s fileA fileC
Here fileC has a different inode than fileA. However, this "different inode" points to the same data as fileA.
How do you find all the programs, and there location, using sockets or pipes on your computer?
lsof
How do you create directory and subdirectories when the parent directory may exist, in one command? In other words, create the following directory structure.
/home/user/one/two The command should work whether /home/user exists or not.
mkdir -p /home/user/one/two The -p or "parents" makes the parent directory as needed.
If someone talks about ext2 and ext3 filesystems, what are they most likely running
Debian or Redhat?
RedHat
How do you create a directory that's sharable to a group, that by default, will have each file created as sharable to a group.
Mkdir
Chmod 770
What options to (GNU) tar(1) would you use to decompress and extract everything from an archive named files.tar.gz into the current directory?
# tar –zxvf file.tar.gz
If you mistype a password, how do you clear it out to retype the password again.
Ctrl-C .
What are the types of file systems
Ext2
Ext3
Reiserfs
Jfs
Xfs
iso9660 - CDROM
What is default block size in Linux?
If fsck is running, what is the one thing you shouldn't do?
Not to start any programs
Do not try to fsck on a currently mounted filesystem
What command would you use to check available disk space on all currently-mounted disk
partitions?
# df –h
how would you add a user to your system? What files get modified?"
# useradd
It modifies two files:
/etc/passwd
/etc/shadow
Does EXT3 needs to be defragged? If no, why?
No.
there is no need to defragment an ext partition (2 or 3) because of the way it arranges the data,
How do you extract a single file from a tarred file?
# tar –zxvf
Is there a way to change the date- and timestamp on a file?
Yes, this can be done with the 'touch' command using the -t flag.
Example:
touch -t 200209131600 myfile.txt
This will set the date- and timestamp to the 13th of Sept 2002, 16:00.
How do I remove those enoying ^M chars from textfiles that has been generated on a Microsoft platform?
Use the 'tr' command to remove them like this:
# cat
This will output the new file without the ^M charters to your standard output. Just redirect them using the '>' char to get the result in to a file like this:
# cat
tr – translate
-d delete
\r return
How do you give a user access to an application or program that needs to run as root without giving them the root password?
I would use sudo or setuid
What are the steps involving the recompilation of the linux kernel
- untar the tar file into /usr/src/kernel
- vi Makefile (change the ver. )
- make menuconfig or ./config or
- make deps
- make bzImage
- cp /kernel/arc/i386/boot/bsImage to /boot/bzImage
- cp /kernel/system.map to /boot/system.map
- make
- make check
- make install
How do I find out who is logged into the system?
who,w
What directory is typically used as scratchspace?
/tmp
How do I stop a UNIX system?
halt,init,shutdown
Whats the difference between halt and shutdown
Both are same
What does fsck do?
fixes filesystem errors
What kind of permission would "chmod 755" yeild on a file?
U = rwx, g/o rx
What is an "s" in a file's permission mean?
setuid
What does a "b" as the first letter of a file's permissions mean?
block special
How do I make a new disk available for files?
mkpart/newpart, mkfs, mount
If I'm logged in as root, what command lets me "become" another user id?
su
What's the difference between "su" and "su -"?
su - run's the user's login files
What command will tell me how busy the system is?
(load average) top,sar,iostat,vmstat
How to recover a system whose root password has lost?
What is a daemon?
How to put a job in background & bring it to foreground?
How do I see what print jobs are pending?
lpstat, lpc stat, etc..
What's the startup files for the C shell (or Bourne)?
.login/.cshrc or .profile
What is /etc/inittab?
Startup sequence file
What is the first process to start on a UNIX system, after the kernel?
init
What is the changed time on an inode/file mean?
Last time the inode was modified
What's an indirect block?
Pointer to a list of blocks
What is an X Server?
graphical display device,7optional
What are two X Clients?
xterm, xclock, netscape, CDE, etc...
'How about truss/ktrace/strace? What are they good for?
What is LILO?
LILO stands for Linux boot loader. It will load the MBR, master boot record, into the memory, and tell the system which partition and hard drive to boot from.
What is the main advantage of creating links to a file instead of copies of the file?
A: The main advantage is not really that it saves disk space (though it does that too) but, rather, that a change of permissions on the file is applied to all the link access points. The link will show permissions of lrwxrwxrwx but that is for the link itself and not the access to the file to which the link points. Thus if you want to change the permissions for a command, such as su, you only have to do it on the original. With copies you have to find all of the copies and change permission on each of the copies.
What is the most graceful way to get to run level single user mode?
A: The most graceful way is to use the command init s.
If you want to shut everything down before going to single user mode then do init 0 first and from the ok prompt do a boot -s.
What does the following command line produce? Explain each aspect of this line.
$ (date ; ps -ef | awk ‘{print $1}’ | sort | uniq | wc -l ) >> Activity.log
A: First let’s dissect the line: The date gives the date and time as the first command of the line, this is
followed by the a list of all running processes in long form with UIDs listed first, this is the ps -ef. These are fed into the awk which filters out all but the UIDs; these UIDs are piped into sort for no discernible reason and then onto uniq (now we see the reason for the sort - uniq only works on sorted data - if the list is A, B, A, then A, B, A will be the output of uniq, but if it’s A, A, B then A, B is the output) which produces only one copy of each UID.
These UIDs are fed into wc -l which counts the lines - in this case the number of distinct UIDs running processes on the system. Finally the results of these two commands, the date and the wc -l, are appended to the file "Activity.log". Now to answer the question as to what this command line produces. This writes the date and time into the file Activity.log together with the number of distinct users who have processes running on the system at that time. If the file already exists, then these items are appended to the file, otherwise the file is created.
Question 5: What is CVS? List some useful CVS commands.(Asked by Silicon Magic Corp.people)
CVS is Concurrent Version System. It is the front end to the RCS revision control system which extends the notion of revision control from a collection of files in a single directory to a hierarchical collection of directories consisting of revision controlled files. These directories and files can be combined together to form a software release.
There are some useful commands that are being used very often. They are
cvs checkout
cvs update
cvs add
cvs remove
cvs commit
What is PAM
What is Jouranaling
The act of moving pages of memory from RAM to virtual memory on a hard drive. Excessive paging is caused by a lack of actual system memory. In this case the system has to use the hard drive as memory frequently, and performance is degraded.
What are the main differences between Apache 1.x and 2.x?
What does the “route” command do?
What are the read/write/execute bits on a directory mean?
What is SED?
SED (which stands for Stream EDitor) is a simple but powerful computer program used to apply various pre-specified textual transformations to a sequential stream of text data.
It reads input files line by line, edits each line according to rules specified in its simple language (the sed script), and then outputs the line.
What is AWK
AWK is a complete pattern scanning and processing language, it is most commonly used as a Unix command-line filter to reformat the output of other commands.
For example, to print only the second and sixth fields of the date command (the month and year) with a space separating them, at the Unix prompt, you would enter:
date | awk ‘{print $2 ” ” $6}’
What is a dynamically linked file?
soft link (created with ln -s). Source and destination files will have the different inode. If dest removed source will be available. If source removed dest also will available but no where to go.
What is a statically linked file?
hard link (created with ln). Source and dest will have the same inode. Making two different copies causes more disk space due to redundancy.
What's your biggest fuck up, and how did you fix it?
now tell me how you would a) mirror the rootdisk, b) grow an existing filesystem, or c) modify the partition table for a disk on that OS.
Do you consider the open source movement to be a threat to the commercial software industry?
Do I need to reboot the machine after increasing the maximum number of open files at /etc/security/limits.conf
No
/etc/security/limits.conf
* - nofile 2048
Verify this with the following command:
ulimit -n
ulimit -a
Look for line:
open files (-n) 2048
System Monitoring
How do I change the priority of a process?
nice, renice, priocntl (SysV.4)
Like when you use 'uptime' (or 'w'), what do the three numbers after 'load average' represent?
What is a zombie process and how do you find them?
When a process creates a child process "fork() command" and that child process terminates, information about the child process (CPU time, memory, etc.) exists for the parent to fetch. The parent can use the "wait" or "waitpid" to fetch this signal. The child process becomes a zombie as soon as it finishes; but, the SIGCHLD hasn't been caught.
ps -aux, will show all processes. Look for "Z" in that stat and defunct under the command.
Note: wait may still produce zombies. This can happen of child A terminates, and it's signal has been caught. While this signal is being process child B terminates. Since these signals won't queue, child B could stay in the zombie state. It's safer to use the waitpid call.
Describe the various metrics and procedures you would use to evaluate the performance and system utilization of a linux machine
What are some shells you'd find on a Unix box?
Answer should include at least: Bourne shell (sh), C-Shell (csh) and Korn shell (ksh). Might also mention Tom's C shell (tcsh), Bourne-again shell (bash), or z-shell (zsh).
What are some other common unix scripting "languages?"
Looking for sed, awk, perl, tcl/tk, etc
What are the standard editors on a Unix system?
ed and vi. Others are emacs and pico
What common unix utility do you use to compile complex C programs?
make.
How would you find the most recently changed file in a directory?
ls –ltr
How would you find all the processes being run by user "joe?"
System 5: ps -fe | grep joe
Berkeley: ps -auxww | grep joe
There are two unix machines named A and B that are on the same subnet. Describe to me, in as much detail as possible, what happens when I type "telnet B" from a terminal on machine A.
Linux Boot Process
How would you grab the middle 300 lines of a 1000 line file, grab the second field of every line in that range, and sort the result alphabetically using only piped commands from the toolbox?
Backup and Restore
What is a level 0 backup?
Q1: level 0 backup is normal or full backup. A normal backup disregards
the archive bit in all files and backs up all files and folders selected, regardless of when they were modified. A normal backup is the most complete type of backup, and the only type of backup that can be used to back up the registry and other critical system files. A normal backup takes the longest amount of time to back up and recover. A normal backup clears the archive bit on all files after backing up.
Q2. An incremental backup is the quickest method for performing backups of data. An incremental backup only backs up files that have been created or modified (their archive bit is set to 1) since the last normal or incremental backup. An incremental backup also clears the archive bit (sets the archive bit back to 0) of all files that it backs up.
Q3. reinstall the os.
start -> run -> type “ntbackup” -> ok -> next -> select restore -> next -> select backup files -> next -> finish
Basic Networking
What's a socket? What's a port? How do you reserve them? how are they related? How do you find out what's going on with them on a system?
Normally, a server runs on a specific computer and has a socket that is bound to a specific port number.
The server just waits, listening to the socket for a client to make a connection request.
Socket: IP + Port
Port: is a virtual data connection. Programs binds on the port to exchange the data.
What would you use to view the contents of TCP packets on the network
# tcpdump
How would you check TCP packets coming from Remote IP?
# tcpdump –i
How do I set my SSH server to accept only protocol 2 connections?
Change the Protocol Parameter to “2”
/etc/ssh/sshd_config
Protocol 2
service sshd restartQ. How do you setup multiple IP address on one NIC (Network Interface Card)...assume ethernet.
What should be found in the /etc/hosts file?
How would you check the route table on a workstation/server
Trouble Shooting
4. Where would you look for startup and error messages on a Unix server?
/var/adm/messages (/usr/adm/syslog on HP-UX boxes). They can also run the command dmesg.
TROUBLESHOOTING
How would you restore GRUB boot loader (MBR)
1.boot from RHEL CD 1.
Boot: linux rescue
2. chroot /mnt/sysimage
3. grub-install /dev/hda3
Type "grub" which makes a GRUB prompt appear.
1. Type "find /boot/grub/stage1". You'll get a response like "(hd0)" or in my case "(hd0,2)". Use whatever your computer spits out for the following lines.
1.boot from RHEL CD 1.
Boot: linux rescue
2. grub> root (hd0,2)
3. grub> setup (hd0,2)
4. grub> quit
KERNEL COMPILATION
When would you want to reconfigure the kernel and how would you do it?
If incase your hardware doesn’t supports, Enabling SMP
RAID
RAID
===
Fs it advisable to put a swap partion in RAID1 (mirroring?) pros & cons?
What is RAID?
Redundant Array of Independant Disks, striping, mirroring, etc..
What is striping?
A technique for spreading data over multiple disk drives. Disk striping can speed up operations that retrieve data from disk storage. The computer system breaks a body of data into units and spreads these units across the available disks. Systems that implement disk striping generally allow the user to select the data unit size or stripe width.
Disk striping is available in two types. Single user striping uses relatively large data units, and improves performance on a single-user workstation by allowing parallel transfers from different disks. Multi-user striping uses smaller data units and improves performance in a multi-user environment by allowing simultaneous (or overlapping) read operations on multiple disk drives.
What are the different RAID levels?
What is RAID 0? RAID’s are of 2 types H/W and S/W RAID.
RAID 0 is bascially a type of S/W RAID that ships with Windows Server..
It is a highly perfomance striped volume without parity..
The data is distributed into different parts and the placed over different volumes and hence improving the responce time.. you can use this with disks Betw. 2 to 32. you can not mirror a striped volume rather u can make fault toulerent by backing it up..
What is RAID 0+1? Why is it better than 0?
What is RAID-5?
What is striping?
RAID levels; pros & cons of diffrent levels; what is RAID 1+0
Mail Server
6. If you send an e-mail to someone and it comes back "Message Undeliverable", what could be wrong.
7. You can receive e-mail, but can't send any. What is wrong?
- Name at least two types of server process that can be an open mail relay but are not SMTP server processes.
- Explain in what ways each of the IMAP, POP3, and SMTP protocols are used.
- Give at least two differences between IMAP and POP3.
- Explain at least one way that SMTP is used that does not involve a mail user agent.
(Bonus points for creative answers.)
- What is an open mail relay?
- How would you test an SMTP server to see if it is an open mail relay?
- Name at least two types of server process that can be an open mail relay but are not
SMTP server processes.
- What are the basic commands to send a message to an SMTP server?
(Hint: Begin with HELO.)
What is /etc/aliases? mail aliases for systems
Is there an easy way to find out which mailservers that handles incoming e-mail for a domain?
Answer
Yes, this can be done with the 'host' command. Have a look at the manpage for more information on how to use it.
Example:
# host mreriksson.net
mreriksson.net has address 62.20.106.119
mreriksson.net mail is handled (pri=10) by mail.mreriksson.net
#
Is there some interactive way to view active processes in the system based on their size or cpu-usage?
Answer
Many unix/linux systems comes with a command called 'top' that does this. See the manpage for top for detailed information on how to display processes based on cpu- or memory-usage.
Web Server
how to install and configure an Apache Web server.
How do I know what modules I have availible in my installation of apache?
Answer
Execute: 'httpd -l', this will show you a list of all availible modules.
--------------------------------------------------------------------------------
Question 2
What user should the stand-alone server be ran as?
Answer
It should be ran as root to be able to attach to port 80. Apache will then spawn it's children with the owner you specify in the httpd.conf file. (Which should be a user without any additional access)
--------------------------------------------------------------------------------
Question 3
When would I use the inetd daemon to execute Apache?
Answer
Since running Apache from inetd will slow down new client connections quite alot, it's best suited for servers which doesn't handle alot of requests, and would are low on memory.
Note: To run Apache from inetd can also make life a bit easier when working with apaches configuration files, since they will be re-read as soon as a new client connects.
--------------------------------------------------------------------------------
Question 4
Can I prevent a user to override my global settings with the .htaccess file?
Answer
Yes, you can do this with the 'AllowOverride' option in the config file.
Example:
AllowOverride None
This will prevent users from using the .htaccess file in all directories.
--------------------------------------------------------------------------------
Question 5
Is the UserDir module safe to use?
Answer
The UserDir module is said to be safe if the html pages arn't stored in the users homedirectory. Instead you should set up an additional directory for each user outside it's homedirectory, and use the following configuration:
UserDir /home/httpd/*/
And for each user have a directory, which they own, under /home/httpd/, with the same name as the user. This will enable users to have an URL like http://host.fo/~user
--------------------------------------------------------------------------------
Question 6
How should I configure Apache to make it serve WAP pages?
Answer
You should add these lines to your Apache configuration:
AddType text/vnd.wap.wml .wml .wml
AddType Application/vnd.wap.wmlc .wmlc
AddType text/vnd.wap.vmlscript .wmls
AddType Application/vnd.wap.wmlscriptc .vmlsc
AddType image/vnd.wap.wbmp .wbmp
The you should locate the 'DirectoryIndex' directive in the file, and add the 'index.wml' tag to it, should look something like this afterwards:
DirectoryIndex index.html index.wml
This tells Apache to look for a file named index.wml if no file is specified in the requested URL. (Example: http://host.fo/wap/ )
Note: There might be more arguments here if you, for example, have installed support for PHP or Perl.
--------------------------------------------------------------------------------
Question 7
How do I use Apaches user authentication (htaccess) ?
Answer
First of all, you need to configure your Apache server to allow usage of the .htaccess file for authentication control. This is done by adding the keyword 'AuthConfig' to the 'AllowOverride' option in the current
Options FollowSymLinks
AllowOverride AuthConfig
This enables the usage of .htaccess in all directories in your filesystem. (For security reasons, you might want to limit this to a certin directory instead of the filesystem root)
To limit the access to a directory and all it's sub-directories, you should create a file called '.htaccess' within it. This file should contain the following options:
AuthName ZoneName
AuthType Basic
AuthUserFile /usr/local/etc/apache/htusers
Require valid-user
AuthName configures the name of this authenticated zone. By defining the same name in several zones, they can be included in the same authentication session, and thereby only require the user to login once to access all zones on the site.
AuthType defines the type of authentication that should be used, the 'Basic' type is the most widespread one and will provide the best compatibility.
AuthUserFile referes to the htpassword file to fetch login information from. This file can be generated by using the htpasswd(1) command provided with the Apache package, or via the online tool availible at http://mreriksson.net/online/htgenerator/ .
The Require option tells Apache which usernames to accept for this zone. Using the 'valid-user' keyword will allow all users defined in the AuthUserFile to login. The 'user' keyword allows a whitespace separated list of usernames that are allowed from the given userfile. Example: Require user user1 user2 user3
--------------------------------------------------------------------------------
Question 8
Is there a way to allow virtual hosts to have their own cgi-bin directory?
Answer
Yes, this can be specified using the ScriptAlias-option in the
Example:
ServerAdmin webmaster@foo.bar
DocumentRoot /home/httpd/www.foo.bar/public_html/
ServerName foo.bar
ServerAlias www.foo.bar
ScriptAlias /cgi-bin/ /home/httpd/www.foo.bar/cgi-bin/
ErrorLog /home/httpd/www.foo.bar/logs/error_log
CustomLog /home/httpd/www.foo.bar/logs/access_log common
Note:
It's important that you end the path to the cgi-bin directory with a slash (/), or Apache will fail to find your cgi's.
--------------------------------------------------------------------------------
Question 9
When using ScriptAlias to allow site-specific cgi-bin-directories, is there a way to require the user to log in before the cgi's can be accessed?
Answer
Yes, this can be done in the normal way with the htaccess-system. Just place a .htaccess-file that configures the authentication-requirements in the cgi-bin directory.
DNS Server
- What is found in a DNS zone file? (Assume BIND running on a POSIX operating system.)
- What is the purpose of an MX record?
- What data is transferred in a DNS zone transfer?
- In what circumstances would you permit systems outside of your local/corporate network
to perform DNS zone transfers? In what circumstances would you not?
2. What files are used to configure DNS on a Unix box
/etc/resolv.conf and /etc/nsswitch.conf
-
Know the options available in /etc/named.conf.
DNS
-------------
# What is DNS
DNS stores the database of domain name and its corresponding IPs.
It is used for translating domain name to IP and vice versa
# What port no does DNS uses?
53
# What are the types of DNS?
Caching Name Server named.ca (root servers)
Authoritive Name Server
# How many Root Name Servers worldwide
13
# what is the configuration file?
/etc/named.conf
defining Zones
/etc/resolv.conf
defining Name Server
/etc/nsswitch.conf
# Where would you define the Zone Records?
/etc/named.conf
# What are the types of Resource Records?
NS
A
PTR
CNAME
MX Mail Exchanger
Q. What is use of CNAME
CNAME is used for giving an alias for Domain name
Q. How to check any RR record for domainname ?
# dig domainname
# nslookup domainname
# dig MX domainname
# nslookup -query=NS linobox.com
Q. What is found in a DNS zone file
Resource Records
Q. What is the purpose of an MX record?
To define the Mail Server
Q How one can configure round robin in DNS server in linux www.dgshiping.com IN A 1.2.3.1
www.dgshiping.com IN A 1.2.3.2
www.dgshiping.com IN A 1.2.3.3
www.dgshiping.com IN A 1.2.3.2
www.dgshiping.com IN A 1.2.3.3
Q How to set MX Priority in DNS Server
Eg Priority can be given for any three Server
MX 10 mailhost
MX 100 mailhost.matrix.co.in.
MX 200 www.matrix.com.
Q on what ver. The BIND was running?
9.2 ver.
NFS ServerWhat is NFS?
NFS is Network File System
It is basically used for sharing files & directories on a network.
What is its job?
allow machines to mount a disk partition on a remote machine
Why is it necessary to start portmap service before nfs service
Portmap serves RPC calls which is necessary for NFS
What is RPC
Library routines for remote procedure calls
These routines allow C programs to make procedure calls on other machines across the network.
On which port NFS runs?
2049
Which service is required for NFS?
# service portmap start
# service nfs start
Which daemons are required for NFS?
Rquotad
Mountd
Nfsd
Nlockmgr
Name the configuration file for NFS?
/etc/exports
How would you share /home/exports to a specific machine (192.168.20.10) with read/write permission?
# vi /etc/exports
/home/exports 192.168.20.10(rw)
# What is the default permission for NFS mount point?
Read only with root_squash option
what do you mean by “no_root_squash”
no_root_squash - Allows root users on client computers to have root access on the server. Mount requests for root are not be mounted to the anonomous user. This option is needed for diskless clients
no_root_squash will make sure root users on the clients have actual root permissions on the nfsd as well
what is root_squash?
Root users mounted as nobody user and privileges given for ‘others’ (other users) on mounted directory will be assigned for root user.
How to mount NFS filesystem remotely?
# mount –t nfs 192.168.20.100:/home/exports /nfsmount
Remote NFS filesystem should be automounted on startup?
# vi /etc/fstab
192.168.20.100:/gome/exports /nfsmount nfs defaults 0 0
# what command would you use to see running services
rpcinfo -p
Who developed it?
Sun
NFS is a RPC protocol that runs atop UDP and IP. Explain
RPC is simply a system call that is processed by a remote server. When a prg makes a I/O call, for an NFS file, the call is intercepted by the NFS file system and sent over the NW to the remote server for
processing.
The NFS startup script is ______________
/etc/rc.d/init.d/nfs
What is the name of the NFS binary?
/usr/sbin/rpc.nfsd
The NFS config file is __________________
/etc/exports
Which daemon/s should be started to enable an NFS server?
portmap, nfs actually portmap*, rpc.nfsd
The NFS daemon starts up some helper daemons alongwith? What are they?
A: rpc.rquotad,rpc.lockd, rpc.mountd
9. These helper damons, like all daemons, needs ports to bind to [monitor] and
run on. Are these ports given in /etc/services?
A: No
10. Then how do these daemons get ports?
A: portmapper daemon is used to dynamically assign port nos to these RPC
services which can be seen by "rpcinfo -p". In /etc/rpc
11. What port does NFS use?
A: 2049
12. And how do you know that?
A: /etc/services
13. What port does portmapper use?
A: 111
14. RPC services have their own config file. What is it?
A: /etc/rpc
15. Display a list of NFS shares from a client if the server is shiva
A: showmount -e shiva
16. How does one check the status of a NFS server?
A: showmount -e localhost
17. Which file is configured on a NFS server to facilitate sharing across a NW?
A: /etc/exports
18. How does one refresh NFS shares?
A: exportfs -ra
19. What does this refresh mean?
A: Telling the NFS daemon to re-process /etc/exports and rebuild the NFS
mount table config file, which is...., cannot say, since it a question.
See later.
20. Which NFS file shows the export permissions of all exported directories ?
A: /var/lib/nfs/rmtab
21. Which NFS file shows the info about currently exported dirs, which 'mountd'
reads when processing client mount requests and is rebuilt every time
'exportfs' is run?
A: /var/lib/nfs/xtab
22. How would you check who [remote hosts ] were using your NFS server and
which files were in use?
A: nfsstat -a
23. I wish to temporarily export a dir /jokes on shiva to brahma with r/w
perms. How?
A: exportfs brahma:/jokes -o rw
24. Temporarily? What's that?
A: It isn't configured in /etc/exports and on a 'service nfs restart'
would no longer exist!
25. How would you do the same permanently ?
A: Configure /etc/exports : /jokes brahma(rw)
26. Then how would you unexport this temporary dir, if I did not wish to do a
'service nfs restart'?
A: exportfs -u brahma:/jokes
27. Can I unexport all exported dirs w/o shutting down/restarting the NFS
daemons? How?
A: Yes.
28. How?
A: exportfs -ua
29. How would you know there are no shares now which are exported?
A: showmount -e
30. Explain the following /etc/exports file on NFS server ganesh:
/ shiva brahma
A: Exports the entire / filesystem on ganesh to remote hosts shiva and
brahma in r/o mode
31. How would a user foo on a remote client brahma mount this on her local
empty dir /win ?
A: Cannot. Only root can do remote NFS mounts. This is how :
mount ganesh:/ /win
32. Can a user foo delete any files in the NFS share win?
A: No
33. What about the local root?
A: No
34. Why not ?
A: Local root is squashed by the NFS server by default
35. squashed ?
A: Local root is converted to another user.
36. So what user is this local root squashed to?
A: nfsnobody.
37. And is this a VLU ?
A: Yes!
38. And what is this nfsnobody's user/group id?
A: 65534/65534
39. Did you create this user?
A: No way! It's what's called a system a/c. Created on install by RH
40. Now examine this /etc/exports file on ganesh:
/ shiva(rw) brahma(rw,no_root_squash)
Can local root on both hosts now delete files in / ?
A: No. Only local root on brahma can!
41. Why can't user foo on shiva delete files on ganesh. It does have NFS'
share's rw perms on it. So ?
A: ls -ld / on ganesh show this : drwx-r-xr-x
Although NFS does allow it, dir perms of the OS do not for
[no "w" for 'others'].
'root', meanwhile, has also been squashed!
42. Explain the following /etc/exports file :
/ shiva(rw)
A: Exports the entire filesystem to machine shiva with r/w access.
43. Explain the following /etc/exports file [Note the space]:
/ shiva (rw)
A: Exports the entire filesystem to machine shiva with r/o access and to the
entire world with write access. Precisely what you did not want, in reverse!
44. Explain the following /etc/exports file :
/ 192.168.0.
A: Exports the entire FS to all m/cs on segment 192.168.0 with r/o access.
45. Explain the following /etc/exports file :
/projects proj*.local.domain(rw)
A: This is an example of wildcard hostnames.
46. Explain the following /etc/exports file :
/usr @trusted(rw)
A: This is an example of wildcard netgroups [NIS]. Do u believe in NIS?
47. Explain the following /etc/exports file :
/home/foo pc001(rw,all_squash,anonuid=100,anongid=100)
A: These options explicitly set the uid and gid of the anonymous account
which would normally have been nfsnobody [65534/65534]. So why bother ?
Primarily useful for PC [M$] / NFS clients, where you might want all
requests to appear to be from one user.
Here, all requests are mapped to uid 100 (which is supposedly that of
user foo).
48. Explain the following /etc/exports file :
/pub (ro,insecure,all_squash)
A: Exports the public FTP directory to every host in the world, executing
all requests under the nfsnobody account.
The insecure option in this entry also allows clients with NFS
implementations that do not use a reserved port for NFS.
49. Remote NFS client brahma mounts /jokes on local dir /funny using the
following :
[root@brahma root] # mount ganesh:/jokes /funny
Now, for some reason, the NFS server on ganesh goes down.
What will happen on brahma?
A: Client will hang indefinitely.
50. Would you be able to interrupt with the keyboard?
A: No
51. What would you do?
A: Use intr
52. How would you use a timeout?
A: Use soft
53. You suddenly get smart overnite. How would you do all this before mounting
a NFS share?
A: mount ganesh:/jokes /funny -o soft,intr
54. How would you further speed up NFS Client accesses?
A: mount ganesh:/jokes /funny -o soft,intr,rsize=8192,wsize=8192
55. How would you automate a NFS Client with all the above considerations in
mind?
A: In /etc/fstab append the following line :
ganesh:/jokes /funny nfs soft,intr,rsize=8192,wsize=8192 0 0
and make sure the netfs daemon starts at boottime. And of course
portmap
56. What is the default for the read and write buffer ?
A: 4096
57. How many columns does /etc/fstab have?
A: 6
58. What are they?
A:
* Block sp. device [devdrv], or remote FS to be mounted.
One can use LABEL too which points to a hardware partition.
* Mt point for the FS
* Type of FS
* Mount options associated with the FS
* Dump details
* fsck
59. The fifth field of /etc/fstab contains mount options associated with the
FS viz. ext3.
What does defaults mean?
A: rw,suid,dev,exec,auto,nouser,async
60. Explain them
61. How would you remount all the FS's in /etc/fstab w/o rebooting?
A: mount -a
62. By default, can a user mount a cdrom?
A: Yes
63. How would you disallow this?
A: The fifth field of /etc/fstab for cdrom contains noauto,owner.
Change to owner to noowner!
64. What is a synonym for owner?
A: user [nouser]
65. foo mounts a cdrom and logs out? Can bar log in and use his own cdrom?
A: No. He will have to unmount foo's cdrom first, for which he has no
permission.
66. So how would you help bar!
A: No problem. Change owner to users!
67. You just said that owner and user and synonymous! Can I use 'owners' above ?
A: No ! Will not work!
68. The fifth field of /etc/fstab for cdrom contains noauto,owner.
Is it a good idea to change the noauto to auto?
A: No. If you forget to have a CD in the drive on boottime, system could
hang!
69. Are there any GUI tools to configure a NFS server?
A: Yes. redhat-config-nfs.
70. I tried it but it is not working? Help me.
A: The file /etc/exports must be missing. It must, at the very least,
be touched!
Q Which of the following packages must be installed to host an NFS server? a. knfsd
b. knfsd-clients
c. netfs ====
d. portmap =====
Q. Which daemon/s should be started to enable an NFS server?
A Portmap , nfsd
Q. What port does NFS use?
A. 2049
Q. Display a list of NFS shares from a client if the server is
shiva.bom.labs.net
Ans : showmount –e shiva.bom.labs.net
Q. How does one check the status of a NFS server?
A. showmount –e shiva.bom.labs.net
Q. Which file is configured on the NFS server to facilitate sharing across
a Network?
A. /etc/exports
Q. How does one refresh NFS shares?
A. exportfs -r
Q. How many columns does /etc/fstab have?
A. 6 feilds
Q. Which of the following lines would work in /etc/exports?
A. /root 192.168.0.0/255.255.255.0(ro)========
B. /home/mike 192.168.0.0/24
C. WORKGROUP
D. mount -t nfs nfsserver:/home/shared
More questions : 572
You have just added a new NFS share to the appropriate file. What must you do
to activate the share?
A. reboot
B. exportfs -a =======================
C. ndc restart
D. server nfs start
E. mount -A
Q. How can I see what directories are being shared via NFS on a remote host
called fileserver?
A. ping fileserver
B. mount -a -t NFS fileserver
C. showmount -e fileserver =======================
D. nfstalk --query fileserver
E. None of the above
Q. What is Portmap?
It servers RPC calls
Converts RPC program numbers intp DARPA protocol numbers
Q. What is RPC?
Remote Procedure Calls
It is a set of C programs which make procedure calls on the server
(remote machine)
Samba Server
Proxy using Squid
Firewall (IPTABLES)
What is DMZ
What is Bastion Host
What do you know about Firewalls?
Printing
What is the lp command?
How can you find out the status of your print job?
What command would you enter to cancel a print job
How do I install a new printer?
lpadmin, /etc/printcap
How do I setup a printer? lpadmin, printcap, YMWV
Shell Programming
Write a script to convert all DOS style backslashes to UNIX style slashes in a list of files.
How do I test for the presence of a file in Bourne Shell? test -f
___ In a shell script, how do I print the scripts arguments? $@ $* or $1..$2..
___ How do you make a shell-script executable?chmod ___ script
___ What is the difference between ' ` and "? Protect, Process and Group
___ How do I connect processes, so stdout of one becomes stdin of another? pipes
___ How do I redirect stderr under a Bourne Shell? 2>
___ How do I determine the home directory of a user in a shell script? $HOME, ~, /etc/passwd
___ What is a regular expression? pattern matching language
___ Explain shell job control. fg,bg,&,^Z
___ Whats the differences between a Bourne and C-Shell? startup file, script syntax, etc..
___ How are new processes created? fork/exec
You have 20 servers that need to be updated named server01,server02...server20. Write a bash script to update all the computers, assuming they all use ssh, with the account bozo.
Ans:
#!/bin/bash
user="bozo";
updatecmd="ls -l"; # put in rpm command here
errorfile="updatelog";
for i in `seq -w 20`
do
ssh "${user}@server$i" $updatecmd || echo "Error on server $i >> $errorfile";
done
The command seq -w 20 pads with the necessary zeros (01,02,03...09).
The || executes only the left side on success. However, if the ssh fails, the right side is executed and an error message to piped to the file.
How do you pass and use a command variable to an awk script?
How can you easily print quotes in an awk script? U sing a sed script print only the
data between "
How do you create a C like for loop in Bash?
How do you find the length of an array in bash?
You have 20 servers that need to be updated named
Ans:
Yours is woefully unportable. For starters, you can't rely on bash.
Second, you can't rely on GNU-specific tools like seq.
> for i in `seq -w 20`
If you're using bash, why add an extra shell invocation here?
for i in {01..20} should get the same effect in recent versions of bash2.
Write a regular expression (or sed script) to replace all occurrences of the letter ‘f’, followed by any number of characters, followed by the letter ‘a’, followed by one or more numeric characters, followed by the letter ‘n’, and replace what’s found with the string “UNIX”.
Write a script to list all the differences between two directories.
Write a program in any language you choose, to reverse a file.
PERL
What does the @ in a variable indicate? its an array
___ What's the current version of Perl? 4 or 5, prefer 5. 5.005 is MRV
___ What is a Hash? a key-data pair type of array variable
ADVANCE LINUX QUESTIONS
8. How do you create a file that even root can't remove?
Ans:
You't can't really; but, the "chattr +i file" command can make a file immutable. This file can't be removed until "chatt -i file" is performed. True, even root can't remove a file with the immutable attribute set.
But, root can unset this attribute, then, delete the file.
What is an inode?
Pointer to block of disk, referenced in a directory
The inode contains information about the file size, file location, ownership, etc. Plus, it contains a pointer to the first few blocks of data in the file.
What is a superblock and what kind of data is in it?
Any file system broken enough to need the alternate superblock is too broken to use... after all, that is why you have backups.
Any Unix today that requires one to play with the file system at the superblock level is also too broken to use in any kind of production environment. It is simply not "production quality," let alone "state of the art."
All that kind of stuff went away with the development of fsck some 20+ years ago.
While playing with superblocks and file system structure may be fine on a hobby system, a commercial system cannot afford the downtime, the introduced lack of reliability associated with playing with the file system on the bit level or the time while someone plays -- that time is better spent on recovery which you are willing to "bet the company on."
FIND
Using the find command how do you find directory names that "do not contain" a
particular file?
Using the find command, how do you find all files with the immunitable attribute set?
Write a command to find all of the files which have been accessed within the last 30 days.
find / -type f -atime -30 > December.files
This command will find all the files under root, which is ‘/’, with file type is file. ‘-atime -30′ will give all the files accessed less than 30 days ago. And the output will put into a file call December.files.
NET
What is the difference between IP Masq and Proxy?
SSH
How would I configure sshd to not ask for a password when connecting with a given user from a certain host?
The best solution for this is to create a DSA key which can be used to authorize you when you log into the computer. This is done in two steps, 1) Create the key, 2) Transfer the public part of the key to the server.
Step one:
On the machine which you want to connect from, execute the following command:
ssh-keygen -b 768 -d -f ~/.ssh/id_dsa -P ""
This will create two files under .ssh/ in your homedirectory. They will be called 'id_dsa' and 'id_dsa.pub' which contains the public (id_dsa.pub) and the private (id_dsa) parts of your key.
Step two:
The public part of your key will now need to be transfered to the server which you want to connect to without entering a password. This can be done using the 'scp' command provided with most ssh clients:
scp ~/.ssh/id_dsa.pub yourusername@myserver.fo.bar:~/.ssh/authorized_keys2
In reality, you should just find a way to transfer your '.ssh/id_dsa.pub' file to the remote machine, rename it to 'authorized_keys2' and place it under '.ssh/' in your homedirectory. Also, if you want to add more keys to the same account on a server, you'll just append the data in your new id_dsa.pub file to the .ssh/authorized_keys2 file on the server.
Note: This solution is based on the ssh v2.0 protocol since it's more secure than v1.x in general. Therefor, if your ssh client supports v1.x and the server is configured to try that version first, you'll probably have to tell the client to use v2.0, or you will get a password question anyway. (With OpenSSH, this is done using the '-2' flag)
- How to create alternative super user in linux
- How to add swap space
- How to add hard disk. & create file system
- How to find password less users in linux / solaris
- how to change shell for user
- how to check free disk space
- how to find kernel information
- how many partition u create on single diak
- what is maximum partition size supported by linux
- what is RAID ---
- Mnimum nos. of HDD reqired for RAID 0,1,5 & 0+1
- what is OS hardening
- what is awk
- what is sticky bit
- is use of setuid & setgid
- what u will do if any partition is full
Maximum Number of Partitions
Please note that under Linux maximum 63 IDE partitions can be created and 15 SCSI partitions can be created per disk.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
How do you create multiple virtual hosts?
How will you load properties file?
Can I set Java system properties differently for each webapp?
How do I configure Tomcat to work with IIS and NTLM?
How do I override the default home page loaded by Tomcat?
How can I access members of a custom Realm or Principal?
How do I enable Server Side Includes (SSI)?
Answers will be given shortly
NICHE SOFTWARE (PUNE) 02026434194/96(They work in Lamp)
*******************************************************
1.How to change guimode to text mode
2.Install Apache 2.0
with upgrade mysql 4.1 to 5.1
and php 4.1 to 5.1
and perl 4.1 to 5.1
complete php with Apache
3.Create a Virtual host with apache
set documentroot /var/www/html/emma
set ip 192.168.0.200
web browser find web page at 192.168.0.200
4.Install postfix 2.5.1 with rpm
configure postfix mail agent as relay server.
5.what is lilo.
6.what is the advantage of symblinks instead of copying a file.
7.How to go to a sg user mode in a superior way.
8.Print the output of following line
$(date;ps -el|awk`(print$1)`|sort|uniq|wc -l) >> activity.log
and explain the line and each and every term.
9.give the tool to update debian, slackware, redhat & suse.
10.what is the diff iptables & ipchians.
11.Explian the foll term eth0 ppp0 wlan0 ttys0.
12.what are the different dir in /.
13.Define a partition scheme for a new web server
14.If U forget root passwd then how do u login.
15.How can u disable ping reply.
QUEEN STREET (Pune)
*************
1.What are different shells.
2.What commandline argument you will pass to count a file in a script
3.what script used to start a shell
4.What is the command for checking network configuration
5.What is the command for checking network speed
6.Type of virtual host
7.How will you create virtual host for different domains
8.What is 3 tier architecture
9.What is a su & Sudo
10.What is ssh protocol
11.How you login from 1 linux box to another without passwd
12.What are different networking protocols
13.How to start & Stop apache
14.What is the port no of http & https
15.How http works
16.How you login remotely to a linuxbox
17.What are different linux distributions
18.What is tomcat edward
19.Apache is full socket or half socket ?
*********************************************************************
1.What lilo -v does (Full Explaination)
2.How to share a printer from windows to linux
3.How to find the access file for 30days
4.What is the new web server partition for webserver
5.How to check the loadable modules
6.How to do performance tuning
7.What is the use of shadow file
8.What is tomcat ? what is used for?
9.How to compile the kernel
10.How to check Load Average
11.Apache web hosting where does log file stores
12.What make commamnd does
13.How to check load Average
Reliance
*********
1.What is swap
2.What is ssh-keys
3.When system crashes Is any other option other than fsck
4.What is major file for nfs
5.Why apache runs in application layer
6.What is server aliasing in Apache
7.What is the maintainance mode in zmail
8.What is the difference between telnet & ssh
IN2M (Belapur)
*****
1.What file is for tcpwrappers found
2.What command to run after makex config
3.What is the maintainance mode under linux (ctrlD)
4.What is sudo used for?
5.Explain Boot Process from scratch
6.How to login in ssh without password
7.What is the differnce between lilo & grub
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Hi,
GE questions
1) In which file ip-address is stored
2) how will u create a user amit having primary group as
abc and secondary grp as def
3) I have created a directory under /home
the directory name is abhilash
The directory is having only rw permission for root and owned by root
U want to assign this directory as home directory for new user abhilash how
will u do it
( Break :- adduser -d /home/abhilash abhilash , change permission of
/home/abhilash to be owned by abhilash copy all file from /etc/skel
Double check 6th field in /etc/passwd for user abhilash)
4) On what port does nfs runs
5) how to check from client whether nfs server is running or not
( showmount -e nfsservername)
6) port number for nfs ( 2049), portmapper ( 111) , samba ( 137-139 ) , http
( 80 ) , https ( 443 ) ,
imap ( 143) , imaps ( 943 ) , pop ( 110 ) , pops ( 995 ), telnet ( 23 ) ,
squid ( 3128 )
ftp ( 21) , ssh (22) and all the ports u can remember , he may ask anything
anytime
DHCP ( 67) , DNS ( 53)
7) Daemons running/required for nfs
8) U want to export/share one directory to only one client/ipaddress(
windows box) how will u do it
( U can do it with both nfs and samba ), windows now have client to
recoganise nfs share.
9) How to check whether http is running or not
service httpd status
or check for # ps -ef | grep httpd , atleast 8 httpd daemon , if u are using
default httpd.conf configuration file.
10) How to check what pci devices are there in ur system
# lspci -v
11) where is the network information stored on linux filesystem , i.e
whether ur computer is connected to the network or not
/etc/sysconfig/ network should have
NETWORKING=YES
/etc/sysconfig/ network-scripts/ ifcfg-eth0
Contains ip address and other info
12)U want to setup squid proxy server and allow only ur internal network to
access internet
Tell him exact acl syntax / http_allow to be put in squid.conf
13) How to Debug DNS server
14) Regarding Hardware RAID 5, one harddisk in raid 5 blew up , how will u
check . Remember don't give answers like i used 3 party utilies to check ,
there is inbuilt linux command for that .
cat /proc/mdstat
15) /var is full , You have got a new harddisk and you want to add it to an
existing lvm group vg00 how will u do that. and increase /var , can it be
done online without umounting /var
16) How many types of virtual hosting are there
2 types
Name Based Virtual Hosting / IP based virtual hosting.
17) What are the different shells used in linux
/bin/bash
/bin/nologin/
/bin/false
/bin/ksh
/bin/sh
/bin/csh
do onething cat /etc/shells
18) Difference between IPtables and IPchains
19) When mounting nfs share from client u get error , RPC timed out. what is
the problem.
Ans: Client is not able to connect to RPC ( Portmapper ) service on server.
TCS
1. Step by step procedure to configure LVM
2. I want to add new hardisk to a Volume group, how can I add ? steps with
command
3. Differnce between hardware and software RAID
4. differnce between grub and lilo
5. PORTS.....mysql (3306) smtp, imaps, https ......etc
6 have u worked on SAN basic Idea how it works
7 differnce between iptables and ipchains
8. what are types of security in Linux ( IPtables, tcpwrappers, xinetd
services security, ipchains)
9 what is importace of Xinetd services
10 how to restart telnet service for root
11. which is good qmail or sendmail or postfix and why
12. configuration and log files path
13. differnce between ip based and name based virtual hosting
14 have you configured DNS server on linux files path and their importance
15. To rename all files in one directory having extension *.htm to *.html
from command line
ANS: In Bourne Again shell
# for i in *.htm; do mv $i `basename $i.htm`.html; done
Redhat
1. Step by step procedure to setup Transpareny Squid Proxy Server.
2. Is nfs secure or not.
3. Does nfs run on tcp or udp.
4.How to debug a shell script. Line by line debugging without actual
execution.
set -n
5. How ping works, step by step.
6. A user connects laptop to the network which is configured to give ip
address by dhcp server. But his laptop doesn't get the ip address from dhcp
server. How will u start debugging.
7. What is next-server parameter in dhcpd.conf
8. Question on ssh tunneling. Types of ssh protocol and what is the diff.
betn ssh ver1 and 2.
9. On DNS server itself , u are able to resolve every website . But when u
try to resolve any website from client machine using that DNS server. U are
not able to resolve any of the website.Also you can connect to port 53 from
client machine to the DNS server. So what may be the problem and how will u
debug. ???????
10.How to take backup of filesystem starting from / in linux.
EMC2 ( EMC Square)
1) Explain Linux Boot Process.
2) Every time u reboot ur linux box it ask for password even during normal
boot , i.e u don't pass any parameter to kernel, how to disable this.
3) what is os level parameter in smb.conf
4) How to create temporary swap space is linux.
5) What is the size of /proc filesystem. ( Its virtual filesystem , snapshot
of ur memory)
6) How to increase tty consoles from default 1 to 6 & 7 for X11.
7) One harddisk in LVM failed , can u recover data after replacing and
adding new disk. he gave some hint ( pvmove , need to surf on this)
8) In which file u set all kernel parameters u want to pass to kernel
( /etc/sysctl. conf)
9) ssh tunneling thru command line. U want to redirect your local port 5902
to connect to port 5900(VNC server) on remote machine 192.168.52.1 .The port
5900 is blocked on the remote machine . how will u create ssh tunnel.
ssh -L 5902:localhost: 5900 -l root 192.168.52.1
Above will make u connect to the port 5900 of remote machine thru your local
port 5902, then in vncviewer u can type ( localhost:2) or localhost::5902 ,
this will connect u to vncserver on remote machine thru ssh tunnel.
10) How to take cache dump of DNS.
11) What is setuid and setgid. Explain with example.
GE questions
1) In which file ip-address is stored
2) how will u create a user amit having primary group as
abc and secondary grp as def
3) I have created a directory under /home
the directory name is abhilash
The directory is having only rw permission for root and owned by root
U want to assign this directory as home directory for new user abhilash how
will u do it
( Break :- adduser -d /home/abhilash abhilash , change permission of
/home/abhilash to be owned by abhilash copy all file from /etc/skel
Double check 6th field in /etc/passwd for user abhilash)
4) On what port does nfs runs
5) how to check from client whether nfs server is running or not
( showmount -e nfsservername)
6) port number for nfs ( 2049), portmapper ( 111) , samba ( 137-139 ) , http
( 80 ) , https ( 443 ) ,
imap ( 143) , imaps ( 943 ) , pop ( 110 ) , pops ( 995 ), telnet ( 23 ) ,
squid ( 3128 )
ftp ( 21) , ssh (22) and all the ports u can remember , he may ask anything
anytime
DHCP ( 67) , DNS ( 53)
7) Daemons running/required for nfs
8) U want to export/share one directory to only one client/ipaddress(
windows box) how will u do it
( U can do it with both nfs and samba ), windows now have client to
recoganise nfs share.
9) How to check whether http is running or not
service httpd status
or check for # ps -ef | grep httpd , atleast 8 httpd daemon , if u are using
default httpd.conf configuration file.
10) How to check what pci devices are there in ur system
# lspci -v
11) where is the network information stored on linux filesystem , i.e
whether ur computer is connected to the network or not
/etc/sysconfig/ network should have
NETWORKING=YES
/etc/sysconfig/ network-scripts/ ifcfg-eth0
Contains ip address and other info
12)U want to setup squid proxy server and allow only ur internal network to
access internet
Tell him exact acl syntax / http_allow to be put in squid.conf
13) How to Debug DNS server
14) Regarding Hardware RAID 5, one harddisk in raid 5 blew up , how will u
check . Remember don't give answers like i used 3 party utilies to check ,
there is inbuilt linux command for that .
cat /proc/mdstat
15) /var is full , You have got a new harddisk and you want to add it to an
existing lvm group vg00 how will u do that. and increase /var , can it be
done online without umounting /var
16) How many types of virtual hosting are there
2 types
Name Based Virtual Hosting / IP based virtual hosting.
17) What are the different shells used in linux
/bin/bash
/bin/nologin/
/bin/false
/bin/ksh
/bin/sh
/bin/csh
do onething cat /etc/shells
18) Difference between IPtables and IPchains
19) When mounting nfs share from client u get error , RPC timed out. what is
the problem.
Ans: Client is not able to connect to RPC ( Portmapper ) service on server.
TCS
1. Step by step procedure to configure LVM
2. I want to add new hardisk to a Volume group, how can I add ? steps with
command
3. Differnce between hardware and software RAID
4. differnce between grub and lilo
5. PORTS.....mysql (3306) smtp, imaps, https ......etc
6 have u worked on SAN basic Idea how it works
7 differnce between iptables and ipchains
8. what are types of security in Linux ( IPtables, tcpwrappers, xinetd
services security, ipchains)
9 what is importace of Xinetd services
10 how to restart telnet service for root
11. which is good qmail or sendmail or postfix and why
12. configuration and log files path
13. differnce between ip based and name based virtual hosting
14 have you configured DNS server on linux files path and their importance
15. To rename all files in one directory having extension *.htm to *.html
from command line
ANS: In Bourne Again shell
# for i in *.htm; do mv $i `basename $i.htm`.html; done
Redhat
1. Step by step procedure to setup Transpareny Squid Proxy Server.
2. Is nfs secure or not.
3. Does nfs run on tcp or udp.
4.How to debug a shell script. Line by line debugging without actual
execution.
set -n
5. How ping works, step by step.
6. A user connects laptop to the network which is configured to give ip
address by dhcp server. But his laptop doesn't get the ip address from dhcp
server. How will u start debugging.
7. What is next-server parameter in dhcpd.conf
8. Question on ssh tunneling. Types of ssh protocol and what is the diff.
betn ssh ver1 and 2.
9. On DNS server itself , u are able to resolve every website . But when u
try to resolve any website from client machine using that DNS server. U are
not able to resolve any of the website.Also you can connect to port 53 from
client machine to the DNS server. So what may be the problem and how will u
debug. ???????
10.How to take backup of filesystem starting from / in linux.
EMC2 ( EMC Square)
1) Explain Linux Boot Process.
2) Every time u reboot ur linux box it ask for password even during normal
boot , i.e u don't pass any parameter to kernel, how to disable this.
3) what is os level parameter in smb.conf
4) How to create temporary swap space is linux.
5) What is the size of /proc filesystem. ( Its virtual filesystem , snapshot
of ur memory)
6) How to increase tty consoles from default 1 to 6 & 7 for X11.
7) One harddisk in LVM failed , can u recover data after replacing and
adding new disk. he gave some hint ( pvmove , need to surf on this)
8) In which file u set all kernel parameters u want to pass to kernel
( /etc/sysctl. conf)
9) ssh tunneling thru command line. U want to redirect your local port 5902
to connect to port 5900(VNC server) on remote machine 192.168.52.1 .The port
5900 is blocked on the remote machine . how will u create ssh tunnel.
ssh -L 5902:localhost: 5900 -l root 192.168.52.1
Above will make u connect to the port 5900 of remote machine thru your local
port 5902, then in vncviewer u can type ( localhost:2) or localhost::5902 ,
this will connect u to vncserver on remote machine thru ssh tunnel.
10) How to take cache dump of DNS.
11) What is setuid and setgid. Explain with example.
----------------------------------------------------------------------------------------------------------------------------------------------
How do you assign a value to a variable in your favourite shell
Display a routing table
Determine which processes are consuming resources
A user calls up to say their dialup connection is periodically
Freezing for 2 minutes.
A user calls up to say they cannot connect to the server
The server is slower than normal the system disk has failed. What
are the basic steps to recoverying the system.
your maintenance window will expire in 1 hour and you have 3 hours
Remaining in your procedure. What do you do? How could you have
prepared for this?
1) Is your current system more BSD or System IV based and why?
2) How do you boot into single user mode?
3) What are the options for the shutdown command?
4) What is the su du command used for?
5) What is a super block?
6) What command do you use to access the Super Block?
7) What is the difference between a symbolic and hard link? When
would you use each?
8) What directory holds file with the sticky bit andwhen is it used?
9) What command do you use to change file ownership and privileges?
10) What is another name for the kill command?
11) What is the default value if you put no options on the kill command?
12) What is the letter equivalent of the -9 and -15 options?
13) What are the nice and renice commands used for?
14) What are the 7 fields in the /etc/passwd file? (on 1 line)
15) What command do you use to create a device? What are the 2
numbers associated with it?
16) What are the termcap and terminfo commands used for?
17) What is /etc/remote file used for?
18) What command or tool do you use to format a disk?
19) How do you create a mount point for a disk partition?
20) How do you create a file system on a new disk?
21) Why wouldn't you use default options on mkfs?
22) What it the lost+found directory and where does it live?
23) Name 3 tape mediums for backup
24) What is a level 0 backup? Level 1? Level 2?
25) Where is the backup info kept?
26) Other than dump, name 2 other backup commands.
27) What is SYSLOG? How does it work?
28) What is a loadable kernel module?
29) What is the difference between a classful and classless IP address?
30) What is the difference between the ARP and Reverse ARP commands?
31) What is a subnet mask?
32) What is a default router? Where is used?
33) What protocol does ping use?
34) What is the difference between a hub, a switch, and a router?
35) What is the difference between DNS lookup and reverse DNS lookup?
36) What is PPP?
37) Do you use USENET? What version of Sendmail?
38) Name 3 deamons on a UNIX system.
39) What deamon is the system master deamon?
40) What is the portmap deamon?
41) What is the difference between x-server and x-client?
1. What is the difference between .xinitrc and .xsession?
2. What is the difference between a gateway and a router?
3. Describe your experience with Microsoft Windows registry?
4. How many SCSI devices can be connected to a workstation with one
single channel SCSI-2 controller?
5. Name the basic data types in PERL.
6. What must a text file begin with to be recognized as postscript code?
7. What does the UNIX gutinteg command do?
8. What files, ownerships and permissions must be set for rsh to work
without a password?
9. How do you calculate the total number of blocks or sectors
available on a disk?
10. If a SCSI hard drive was formatted on a SUN workstation and no
data has yet been written to it, what needs to be do to use it on a
non -SUN Linux system?
11. Describe an SNMP application you have developed.
12. Describe the procedure for permanently modifying the initialization string
on a modem connected to a Cisco terminal server.
13. In what subdirectory is the X windows hardware configuration file
XF86Config found on a system configured with Linux?
14. Describe some of the software project management tools you have used.
15. What is the path to the shutdown command on a DEC Alpha running OS/F?
16. Name the seven most important tools a System Administrator uses?
17. Describe methods you have used to assure completion of projects on
schedule.
18. How would you set up cron entries for a non-priviledged account?
19. What is the path to the sendmail configuration file?
20. How would you remove all the core files on a filesystem.
21. What is the difference between Cnews and INN?
22. Briefly describe the sequence of events when printing a file under BSD..
23. What do the options 2755 mean to chmod?
24. What is RAID level 5? Level 0?
25. Describe the steps, tools and procedures you have used in project
management.
26. Describe the most complex client/server anomaly you have
encountered and how you solved it.
27. Describe your experience in forecasting server load and equipment
replacement.
28. What were your considerations in specifying a PC hardware standard?
************ ********* ********* ********* ********* ********* ********* ********* *****
1) What is the first line of defense in system security?
2) What should be used to maintain the /etc/shadow file?
3) What is the default shell for the "root" logonid? What other
shells are acceptable for this logonid?
4) What is the function of the kernel?
5) Using the Bourne shell syntax, show the command that sets the PATH
environment variable to look in /usr/bin first, /usr/local/bin second,
and the current directory last.
6) Show the command to search for any files or directories with
question marks in their names.
7) Which of the following commands redirects output to a file?
rd somefile > test
cat somefile > test
cat somefile >> test
cat somefile | test
8) You are using "vi" to edit a file with multiple pages. Which
command will take you down one page the fastest?
9) What command do you use to quit "vi" without saving changes?
10) Which command do you use to display a directory listing of files,
including the file type?
11) What is the command to display on-line help for a unix command?
12) To display a list of all manual pages containing the keyword
"date", what command would you type?
13) What command will display the first 10 lines of a file called "junk"?
14) What file will tell you where system log files are being written (if any)?
15) What command diplays a full listing of processes, including headers?
16) How do you terminate a process?
17) Using symbolic mode, add group write permissions to the file "junk".
Do the same using octal mode.
18) In the following, where does the output for standard error go?
/usr/lib/sendmail -OQueueSortOrder= host -oQ/var/spool/ mqueue-8h \
-q >> /var/adm/log/ mqueue-8h 2>&1
19) What is the command to check the available free disk space on all local
filesystems? Which operating environment does the syntax used apply to?
20) You have need to configure a new network client and have been given the IP
128.194.49.48 in the 128.194.48.0/ 23 subnet. You configure the machine
with that IP and set the default router as you were told but are not
getting packets or response to pings. What is probably wrong?
21) Describe the X Window system client/server model.
22) Please list and describe 2 or more authentication mechanisms when displaying
X applications on remote displays. Which one is "better" in terms of security?
23) You added a line to /etc/aliases, but it doesn't seem to be working. Why?
24) You commented out a server in inetd.conf, but it's still active. Why?
25) What's a process? What's an inode? Describe the difference between
a symlink and a hard link.
26) Name as many shells as you can.
27) How do you plan to document changes to this environment?
28) You have a problem and you don't know how to solve it. Name all
the resources you can think of that you might consult.
29) What have you done recently that you particularly liked, or are proud of?
30) I have a file named 'dash fr' (-fr); how do I get rid of it?
31) Why did I just ask that question?
32) What's the difference between a library function and system call?
33) The command to see who is on the system is:
who
what
why
where
34) Which commercial UNIX platform dominated the computer industry?
FreeBSD
Microsoft McUnix
Solaris
HP-UX
Linux
35) In which file is the default router address kept?
/etc/resolv. conf
/etc/nsswitch. conf
/etc/hosts
/etc/defaultrouter
36) The first field field in an /etc/passwd entry is:
The uid
The name
The gid
The home directory.
37) According to POSIX.2, which of the following tests to see if file
foo exists and is readable?
test -f foo
test -r foo
test -w foo
test -x foo
38) According to POSIX.2, which option tells sort to compare the keys
in a case-insensitive manner?
-c
-f
-i
-v
39) The renice command may alter the priority of:
A single process
All process in a process group
All processes owned by a user
All of the above
40) To setup a master/slave NIS system such that the slave takes over
lookup requests when the master crashes:
run ypserv on the master; ypbind on the slave
run ypserv,ypbind on the master; ypset on the slave
run ypserv,ypbind on the master; ypserv,ypbind on the slave
run ypserv on the master; ypserv -s on the slave
41) You boot a client machine and attempt to mount an NFS drive from
the server. The NFS mount worked yesterday, and neither the server
nor its NFS export list has been modified since then. The mount
command just hangs. Where do you look for the problem?
42) Acceptable levels of bad nfs calls fall under what percentages?
10-15%
1-2%
45-55%
anything under 90%
43) When debugging a core in gdb, what does the command "bt" give?
the core memory
heap usage
the calling stack
44) Please describe the complete boot process for a Unix system (your choice,
but preferably Sun if known). Start at the moment the power switch
is turned on.
45) What is the main negative aspect of telnet/rshell/ rlogin with
respect to security?
Please list 2 or more mechanisms of overcoming that aspect.
46) How many devices can be attached to a SCSI/SCSI-2 bus? A "wide" SCSI bus?
47) A user performed a "cd;chmod 644 ." before logging out. What
problem occurs when they log in the next time, and what level of
privileged is required to correct the problem?
48) Please describe the path and types of programs that handle an
e-mail message starting from when a system receives the first packet
of information until the recipient reads it.
49) A customer has created a web page and complains that attempts to view
it result in "forbidden" messages. What is the main problem?
Directory listing is as follows:
# ls -al
total 240
drwxr-xr-x 2 joeuser other 8192 Apr 19 17:54 .
drwx------ 57 joeuser other 8192 Apr 16 14:13 ..
-rw------- 1 joeuser other 6311 Apr 19 17:50 back.xbm
-rw------- 1 joeuser other 9650 Apr 19 17:50 daemon.gif
-rw------- 1 joeuser other 11230 Apr 19 17:50 ferret.jpg
-rw------- 1 joeuser other 11925 Apr 19 17:50 giraffe.gif
-rw------- 1 joeuser other 32760 Apr 19 17:50 help.gif
-rw-r--r-- 1 joeuser other 967 Apr 19 17:46 index.html
-rw------- 1 joeuser other 3871 Apr 19 17:50 kewl.jpg
-rw------- 1 joeuser other 9018 Apr 19 17:50 luser.jpg
-rw------- 1 joeuser other 2143 Apr 19 17:50 news.gif
-rw------- 1 joeuser other 9055 Apr 19 17:50 noms.gif
-rw------- 1 joeuser other 3071 Apr 19 17:50 race.gif
-rw------- 1 joeuser other 3301 Apr 19 17:50 sailbot.jpg
-rw------- 1 joeuser other 10511 Apr 19 17:50 tamu.gif
-rw------- 1 joeuser other 19696 Apr 19 17:50 tsip.jpg
-rw------- 1 joeuser other 6376 Apr 19 17:50 unix.gif
-rw------- 1 joeuser other 2267 Apr 19 17:50 xray.gif
-rw------- 1 joeuser other 3858 Apr 19 17:50 zoom.jpg
50) What happens when you issue the following commands (as root):
# kill -1 1
# kill -1 -1
# init 0
# sync
# rm /dev/console
1) What are your responsibilities in your present job?
2) What has been your biggest contribution at your most recent job?
3) Which of your jobs have you enjoyed the most?
4) What type of management style do you work best for?
5) If you could change one thing in your current job, what would it be?
6) What would your manager say are your strengths?
7) What might your manager say as a criticism?
8) How do you keep up with the changes in technology?
9) Tell me about a time when you were not satisfied with your performance.
10) How would your co-workers describe you?
11) What did you like best about working at your most recent job?
12) What did you like least?
13) In your last job, when did you feel pressured? Why? How do you
handle the pressure?
14) Why did you choose this profession? What rewards does it give you?
15) o How do you know when you're doing a good job? (internal or
external standards?)
16) o Where do you see your career headed? What would you like to be
doing in five years?
17) What is your reason for wanting to leave your present job?
18) What are you looking for in a job that you haven't had before?
19) What would make you want to stay in a job?
20) Salary requirements?
1. You have 20 servers that need to be updated named
Ans: Yours is woefully unportable. For starters, you can't rely on bash.
Second, you can't rely on GNU-specific tools like seq.
If you're using bash, why add an extra shell invocation here?
for i in {01..20} should get the same effect in recent versions of bash2.
> 2. How do you findout whether a command is an aliases, bash function,
> built-in like cd and type, or executable program?
>
> Ans:
>
> type -all yourcmd
This is, again, bash-specific. All common shells support the use of
which (either by builtin or, in some cases, by which(1)), which
will answer the same question.
> 3. What is a zombie process and how do you find them?
[...]
> ps -aux, will show all processes. Look for "Z" in that stat and defunct
> under the command.
That answer's incomplete; that's relying on BSD ps(1) syntax. On
Solaris, at least, you can use /usr/ucb/ps (though it's quite slow),
but on a true SysV system, you'll need to know how to read ps -ef
output as well.
Also, BSD ps(1) syntax has long deprecated the use of the -.
> 4. How do you find the version of Linux running and the version of gcc
> used?
> Ans:
> cat /proc/version
Why would you give a Linux-specific question, much less answer, on a
test for a Unix sysadmin? The POSIX way to get this information is
uname(1).
> 5. How do you setup multiple IP address on one NIC (Network Interface
> Card)...assume ethernet.
>
> Ans:
> Normally, /etc/sysconfig/ network-scripts/ ifcfg-eth0 is the setup for the
> first card. To add additional IP addresses, create another file
> "ifcfg-eth0: 1" with the new IP address information in it.
That's disgustingly Linux-specific. BSD systems will use
/etc/ifconfig.
> 6. What is an inode?
>
> Ans:
> The inode contains information about the file size, file location,
> ownership, etc. Plus, it contains a pointer to the first few blocks of data
> in the file.
That's true, but it neglects the FS-dependent implementation details
(sysadmins should be familiar at least with the file systems they
need to manage, and should have a basic understanding of what design
decisions are made when designing a FS) and neglects to ask the
important "and why do you care?" piece of the question.
> 7. What's the difference between a hard link and a soft link?
Why do people use the term "soft link"? The correct term is
"symbolic link".
> Ans:
[...]
> fileA and fileB have the same inode. How do you know this? Issue the stat
> command "stat fileA" and "stat fileB".
stat(1) isn't defined in POSIX, but ls's -i flag is.
> One important note about hard links. Editors like emacs will create a new
> inode for a file. So if you edit the fileB above, you won't see the changes
> in fileA. Instead, that inode becames the backup.
That's a pretty irrelevant note, I think, unless you're interested
in the internal functionings of Emacs. A salient point you neglect
to mention is what kind of links one can make across file system
boundaries.
> 8. How do you create a file that even root can't remove?
>
> Ans:
> You't can't really; but, the "chattr +i file" command can make a file
> immutable. This file can't be removed until "chatt -i file" is performed.
> True, even root can't remove a file with the immutable attribute set. But,
> root can unset this attribute, then, delete the file.
chattr(1) isn't just Linux-specific, it's ext{2,3}-specific. Some
other file systems provide other ways of doing this same thing.
The real answer to the question is that you create the file and then
set a physical read-only marker on the device itself (tabs on floppy
disks and tape media, jumpers on disk devices, ro= in
dfstab/exports on an NFS server to which the root user in question
doesn't have access).
> 9. How do you find all the programs, and there location, using sockets or
^^^^^
> pipes on your computer?
Spellcheck is insufficient. Proofread.
> Ans:
> "netstat -na" will give a list of listening connections; but, it doesn't do
> an adequate job of listing the programs. Instead, use
> "lsof"
lsof is rather portable (in that it can be built on most, if not
any, POSIX systems), but many operating systems provide a native
mechanism for this. (BSD systems have fstat(1), for instance.)
> Other items to know: What is a superblock and what kind of data is in it?
More importantly, why would you need that information?
> If someone talks about ext2 and ext3 filesystems, what are they most likely
> running Debian or Redhat?
If someone talks about ufs, what are they most likely using, SunOS
or BSD/OS?
> Using the find command, how do you find all files
> with the immunitable attribute set?
GNU-find and ext{2,3}-specific.
> How do you create a directory that's sharable to a group,
A more general question would ask what attributes can be set in a
file's mode bits and which have special implications for files that
are directories or that are executable. One should also note that
certain popular file system implementations overload certain mode
bits; for example, Sun's ufs and, because of that, Veritas's vxfs.
Explaining which of these interactions will function across NFS
between same-OS servers and clients and different-OS servers and
clients would also be desirable.
> that by default, will have each file created as sharable to a group.
This presumes changes outside of the directory's mode bits. (You
need to force a umask on the users.)
> What's an effective UID and how is it set?
Relatedly, what's a saved UID, and why would you care about them?
> Is the speed of light constant in a vacuum and does light travel
> in a straight line? Careful on this last one..don't let your formal
> education throw you off.
Heh.
high position admin?
The former, we certainly hope, though my experience dictates that
people referring to themselves as senior couldn't answer some of the
modifications I made above.
I've attached an incomplete list of questions I would ask in an
interview for a senior Unix and Linux systems administrator. These are
based on a list of questions a friend of mine who prefers to
remain anonymous asked for my feedback on recently. I've made some
modifications to that person's questions and would prefer to make some
significant additions before I made use of this list. (My
friend also had questions specific to Windows 2000; I've elided those
here, but if you'd like to see them, let me know.)
There's a significant lack of file-system- related questions here,
which I pointed out to my friend at the time. The questions Mike
provided above aren't a bad starting point for that component of
this list.
************ ********* ********* ********* ********* ********* ********* ********* *****
TCP/IP Networking
useable for hosts.
address is 192.168.0.254, and the new address is 192.168.0.1.
server on that subnet? (The DHCP server is not acting as the gateway
for this network, and the system acting as the gateway is not
receiving its IP address from the DHCP server. Assume whatever
operating system and DHCP server software you're familiar with, though
answers for a POSIX operating system and ISC dhcpd are preferred.)
connectivity to a host, but you're able to access other services
running on the same system. Give at least one possible
explanation for this.
specific to any particular OS, please state that. More specific
answers are preferred to more general ones.)
operating system(s).
operating system.)
accepted: what standards-non- compliant data is frequentlyplaced in MX
records?)
your local/corporate network to perform DNS zone transfers?
E-Mail
mail user agent. (Bonus points for creative answers.)
relay but are not SMTP server processes.
(Hint: Begin with HELO.)
OS-level Tools
extract everything from an archive named files.tar.gz into the
current directory?
partition to another, preserving all file metadata, with minimal
interruption to the user?
currently-mounted disk partitions?
which directory under a given disk partition was using the most space?
file? What is in it, and how is it different from /etc/passwd?
Linux admin interview questions
1. How do you take a single line of input from the user in a shell script?
2. Write a script to convert all DOS style backslashes to UNIX style
slashes in a list of files.
3. Write a regular expression (or sed script) to replace all
occurrences of the letter 'f', followed by any number of characters,
followed by the letter 'a', followed by one or more numeric
characters, followed by the letter 'n', and replace what's found with
the string "UNIX".
4. Write a script to list all the differences between two directories.
5. Write a program in any language you choose, to reverse a file.
6. What are the fields of the password file?
7. What does a plus at the beginning of a line in the password file signify?
8. Using the man pages, find the correct ioctl to send console output
to an arbitrary pty.
9. What is an MX record?
10. What is the prom command on a Sun that shows the SCSI devices?
11. What is the factory default SCSI target for /dev/sd0?
12. Where is that value controlled?
13. What happens to a child process that dies and has no parent
process to wait for it and what's bad about this?
14. What's wrong with sendmail? What would you fix?
15. What command do you run to check file system consistency?
16. What's wrong with running shutdown on a network?
17. What can be wrong with setuid scripts?
18. What value does spawn return?
19. Write a script to send mail from three other machines on the
network to root at the machine you're on. Use a 'here doc', but
include in the mail message the name of the machine the mail is sent
from and the disk utilization statistics on each machine?
20. Why can't root just cd to someone's home directory and run a
program called a.out sitting there by typing "a.out", and why is this
good?
21. What is the difference between UDP and TCP?
22. What is DNS?
23. What does nslookup do?
24. How do you create a swapfile?
25. How would you check the route table on a workstation/ server?
26. How do you find which ypmaster you are bound to?
27. How do you fix a problem where a printer will cutoff anything over 1MB?
28. What is the largest file system size in solaris? SunOS?
29. What are the different RAID levels?
Interview questions for Linux admin
1. Advantages/disadvan tages of script vs compiled program.
2. Name a replacement for PHP/Perl/MySQL/ Linux/Apache and show main
differences.
3. Why have you choosen such a combination of products?
4. Differences between two last MySQL versions. Which one would you
choose and when/why?
5. Main differences between Apache 1.x and 2.x. Why is 2.x not so
popular? Which one would you choose and when/why?
6. Which Linux distros do you have experience with?
7. Which distro you prefer? Why?
8. Which tool would you use to update Debian / Slackware / RedHat /
Mandrake / SuSE ?
9. You're asked to write an Apache module. What would you do?
10. Which tool do you prefer for Apache log reports?
11. Your portfolio. (even a PHP guest book may work well)
12. What does 'route' command do?
13. Differences between ipchains and iptables.
14. What's eth0, ppp0, wlan0, ttyS0, etc.
15. What are different directories in / for?
16. Partitioning scheme for new webserver. Why?
Unix/Linux programming interview questions
Question 1: What is the major advantage of a hash table? (Asked by
Silicon Magic Corp. people)
Answer: The major advantage of a hash table is its speed. Because the
hash function is to take a range of key values and transform them into
index values in such a way that the key values are distributed
randomly across all the indices of a hash table.
Question 2: What are the techniques that you use to handle the
collisions in hash tables?(Asked by Silicon Magic Corp. people)
Answer: We can use two major techniques to handle the collisions. They
are open addressing and separate chaining. In open addressing, data
items that hash to a full array cell are placed in another cell in the
array. In separate chaining, each array element consist of a linked
list. All data items hashing to a given array index are inserted in
that list.
Question 3: In Unix OS, what is the file server? (Asked by Silicon
Magic Corp. people)
Answer: The file server is a machine that shares its disk storage and
files with other machines on the network.
Question 4: What is NFS? What is its job?(Asked by Silicon Magic Corp. people)
Answer: NFS stands for Network File System. NFS enables filesystems
physically residing on one computer system to be used by other
computers in the network, appearing to users on the remote host as
just another local disk.
Question 5: What is CVS? List some useful CVS commands.(Asked by
Silicon Magic Corp.people)
Ans: CVS is Concurrent Version System. It is the front end to the RCS
revision control system which extends the notion of revision control
from a collection of files in a single directory to a hierarchical
collection of directories consisting of revision controlled files.
These directories and files can be combined together to form a
software release.
There are some useful commands that are being used very often. They are
cvs checkout
cvs update
cvs add
cvs remove
cvs commit
Unix/Linux administration interview questions
What is LILO?
LILO stands for Linux boot loader. It will load the MBR, master boot
record, into the memory, and tell the system which partition and hard
drive to boot from.
What is the main advantage of creating links to a file instead of
copies of the file?
A: The main advantage is not really that it saves disk space (though
it does that too) but, rather, that a change of permissions on the
file is applied to all the link access points. The link will show
permissions of lrwxrwxrwx but that is for the link itself and not the
access to the file to which the link points. Thus if you want to
change the permissions for a command, such as su, you only have to do
it on the original. With copies you have to find all of the copies and
change permission on each of the copies.
Write a command to find all of the files which have been accessed
within the last 30 days.
find / -type f -atime -30 > December.files
This command will find all the files under root, which is '/', with
file type is file. '-atime -30? will give all the files accessed less
than 30 days ago. And the output will put into a file call
December.files.
What is the most graceful way to get to run level single user mode?
A: The most graceful way is to use the command init s.
If you want to shut everything down before going to single user mode
then do init 0 first and from the ok prompt do a boot -s.
What does the following command line produce? Explain each aspect of this line.
$ (date ; ps -ef | awk '{print $1}' | sort | uniq | wc -l ) >> Activity.log
A: First let's dissect the line: The date gives the date and time as
the first command of the line, this is followed by the a list of all
running processes in long form with UIDs listed first, this is the ps
-ef. These are fed into the awk which filters out all but the UIDs;
these UIDs are piped into sort for no discernible reason and then onto
uniq (now we see the reason for the sort - uniq only works on sorted
data - if the list is A, B, A, then A, B, A will be the output of
uniq, but if it's A, A, B then A, B is the output) which produces only
one copy of each UID.
These UIDs are fed into wc -l which counts the lines - in this case
the number of distinct UIDs running processes on the system. Finally
the results of these two commands, the date and the wc -l, are
appended to the file "Activity.log" . Now to answer the question as to
what this command line produces. This writes the date and time into
the file Activity.log together with the number of distinct users who
have processes running on the system at that time. If the file already
exists, then these items are appended to the file, otherwise the file
is created.
Network developer interview questions
Pls Check the Answer I think Some Answer are not Fully Correct.
1) What ports does FTP traffic travel over?
Ans :21
2) What ports does mail traffic utilize?
Ans : SMTP 25 ,, POP3 110
3) What ports do HTTP and HTTPS use?
Ans: HTTP 80, HTTPS 443
4) Why is NTP required in an NFS network?
Ans : NFS, the Network File System, has long been known for its remote
exploits and vulnerabilities. Even secure NFS has vulnerable points.
However, NFS is also a very reliable means of copying and backing up
systems to a central backup server. In order to synchronize the backup
clients with a central backup server extremely accurate timing is
needed. That's where NTP comes in.
5) Name some common mal software on the server side
Ans: DeepThroat, BladeRunner, Hackers Paradise (Postfix, Sendmail,
Qmail, Exim)
6) What is CPAN? How do you access it?
Ans: Perl programmer's paradise!
7) What is PEAR?
Ans : PHP programmer's paradise!
8) What advantages does mod_perl have over a perl CGI?
Ans: CGI is one of the first methods of creating dynamic web content.
The problem is that it forks a new process and loads a copy
of the interpreter
for each request, using too much memory.mod_perl includes the
Perl interpreter within Apache
9) What is required to do SSL in Apache 1.x?
10) What is Tcl?
11) What is a servlet engine/container?
Ans : An application server that provides the facilities for running
Java servlets. Also called a "servlet engine" and "servlet womb,"
examples of servlet containers are JServ and Tomcat from the Apache
Jakarta Project. Today, servlet containers also support JavaServer
Pages (JSPs) by converting them to servlets. For example, Tomcat
supports JSPs, but its predecessor, JServ, did not. Full blown
J2EE-compliant application servers generally handle servlets, JSPs and
Enterprise JavaBeans (EJBs).
11) What is BIND?
Ans : BIND (Berkeley Internet Name Domain) is an implementation of the
Domain Name System (DNS) protocols and provides an openly
redistributable reference implementation of the major components of
the Domain Name System.
12) Name the steps to setup a slave zone in BIND
13) Name the steps to setup a primary zone in BIND
14) What commands would you use under Solaris or Linux to modify/view
an LDAP tree?
Interview questions for a sysadmin
1. Difference between layer 2 and layer 3 devices?
2. What is VLAN?
3. What is the subnet for a class C network?
4. Are you familiar with automounter?
5. Have you configured an NIS server/client?
6. Have your configured a NFS server?
7. Windows and Linux interoperability how to?
8. What is RAID 1?
Topics for a Unix/Linux sysadmin interview
1) Job Scheduling; mainly crontab, at, batch command
Ans : 1. crontab - to run a job(in background) at regular intervals of time.
crontab -l -> lists all the cronjobs running under ur login.
crontab -e -> to edit the cronjobs running under ur login.
crontab -r -> to remove all the cronjobs running under ur login.
at - command is for running a job at some point of time(given)
{at
list of jobs/scripts}
1) Backup stetegy; incremental, full system back up; diff between tar & ufsdump
Ans : Ufsdump is a flavour specific command for backup in Solaris
where as tar is a general unix command for the backup.With ufsdump we
have incremental backup and we take offline backup also where as with
tar we cant do it
2) diff between hard link & softlink
3) How to list only the directories inside a directory (Ans. ls -l|grep "^d")
4) RAID levels; pros & cons of diffrent levels; what is RAID 1+0
5) How to recover a system whose root password has lost?
6) What is a daemon?
7) How to put a job in background & bring it to foreground?
Ans : to move it to background, bg
to bring it to foreground, fg
8) What is default permissions for others in a file?
9) Questions on shell initialization scripts?
10) Questions on restricted shell
11) What is diff betwn grep & find?
12) What is egrep?
Ans : egrep - to search for multiple - patterns or expressions( stored
in a file).
13) Questions on shell programming
14) What is a pipe?
Ans : pipe - redirection operator, the output of a command will be
provided as an input to another.
15) Questions on Solaris patch management like pkgadd etc
16) Questions on file system creation; actually what happens when we
create a file system?
17) Questions on RBAC? what is a role accound & what is a profile?
18) From command line how will you add a user account? the full
command will all arguments.
19) Fs it advisable to put a swap partion in RAID1 (mirroring?) pros & cons?
Apache interview questions
1. On a fresh install, why does Apache have three config files -
srm.conf, access.conf and httpd.conf? - The first two are remnants
from the NCSA times, and generally you should be ok if you delete the
first two, and stick with httpd.conf.
2. What's the command to stop Apache? - kill the specific process that
httpd is running under, or killall httpd. If you have apachectl
installed, use apachectl stop.
3. What does apachectl graceful do? - It sends a SIGUSR1 for a
restart, and starts the apache server if it's not running.
4. How do you check for the httpd.conf consistency and any errors in
it? - apachectl configtest
5. When I do ps -aux, why do I have one copy of httpd running as root
and the rest as nouser? - You need to be a root to attach yourself to
any Unix port below 1024, and we need 80.
6. But I thought that running apache as a root is a security risk? -
That one root process opens port 80, but never listens to it, so no
user will actually enter the site with root rights. If you kill the
root process, you will see the other kids disappear as well.
7. Why do I get the message "? no listening sockets available,
shutting down"? - In Apache 2 you need to have a listen directive.
Just put Listen 80 in httpd.conf.
8. How do you set up a virtual host in Apache?
ServerAdmin admin@techinterview s.com
DocumentRoot /home/apache/ share/htdocs/ hostedsites
ServerName www.techinterviews. com
ErrorLog /home/apache/ logs/error/ hostedsites/ error_log
TransferLog /home/apache/ logs/access/ hostedsites/ access_log
9. What is ServerType directive? - It defines whether Apache should
spawn itself as a child process (standalone) or keep everything in a
single process (inetd). Keeping it inetd conserves resources. This is
deprecated, however.
10. What is mod_vhost_alias? - It allows hosting multiple sites on the
same server via simpler configurations.
11. What does htpasswd do? - It creates a new user in a specified
group, and asks to specify a password for that user.
12. If you specify both deny from all and allow from all, what will be
the default action of Apache? - In case of ambiguity deny always takes
precedence over allow.
Network administrator interview questions
1) What is the difference between layer 2 and layer 3 in the OSI model?
Ans : Layer 2 is responsible for switching data whereas Layer 3 is
responsible for routing the data.
Layer3: With information gathered from user, Internet protocol make
one IP packet with source IP and Destination IP and other relevant
information. It can then route packet through router to the
destination.
Layer2: Soon after it receives IP packet from layer 3, it encapsulate
it with frame header (ATM header in case of ATM technology) and send
it out for switching. In case of ethernet it will send data to MAC
address there by it can reach to exact destination
2) What is the difference between a hub, switch, and router?
Ans : Hub: 1.it is a layer1 device..used to connect various machine on Lan.
2.It forwards broadcast by default.
3.It supports one collision domain and one broadcast domain.
4.it works on Bus topolog resulting less speed.
Switch: 1. A layer2 device.
2. Forward broadcast first time only.
3. one broadcast domain & colliosion domains depends on no. of ports.
4.It is based on Star Topology giving 100mbps to every pc on Lan.
Router: 1. Does not Broadcast by default.
2. breaks up Broadcast domain.
3. Also called Layer3 switch.
3) What is a VLAN?
Ans: VLANs logically segment switched networks based on the functions,
project teams, or applications of the organization regardless of the
physical location or connections to the network.
VLANs provide segmentation based on broadcast domains.
All workstations and servers used by a particular workgroup share the
same VLAN, regardless of the physical connection or location.
VLANs are created to provide segmentation services traditionally
provided by physical routers in LAN configurations.
VLANs address scalability, security, and network management. Routers
in VLAN topologies provide broadcast filtering, security, and traffic
flow management.
4) What is the difference between TCP and UDP?
Ans TCP is a connection oriented protocol, which means that everytime
a packet is sent say from host A to B, we will get an acknowledgement.
Whereas UDP on the other hand, is a connection less protocol.
Where will it be used : TCP -> Say you have a file transfer and you
need to ensure that the file reaches intact, and time is not a factor,
in such a case we can use TCP.
UDP-> Media Streaming, question is say you are watching a movie?would
you prefer that your movie comes..perfectly?.but u need to wait a long
time before you see the next frame ?..or would you prefer the movie to
keep streaming?Yes?The second option is definely better?.This is when
we need UDP
5) How do you distinguish a DNS problem from a network problem?
Ans: The first thing to do is to ping any switches, routers, or any
other devices on the network. If your pings come back complete with 0%
lost, then it will most likely be a DNS issue. If you can ping other
devices but can not ping the switch that sits in front of the DNS,
then it will be a network issue.
6) What is a runt, Giant, and collision?
Ans : A RUNT is a packet that is too small to traverse the network.
Network protocols such as Ethernet often require that packets be a
minimum number of bytes in order to travel the network. Runts are
often the result of packet collisions along a busy network or can
result from faulty hardware that is forming the packets or from
corrupted data being sent across the network.
A giant is a packet that is too large to traverse the network. Network
protocols such as Ethernet often require that packets can not be over
a specific number of bytes in order to travel the network.
7) What is a broadcast storm?
Ans: A broadcast storm means that your network is overwhelmed with
constant broadcast or multicast traffic. Broadcast storms can
eventually lead to a complete loss of network connectivity as the
packets proliferate.
If a certain broadcast transmit threshold is reached, the port drops
all broadcast traffic. Firewalls are one of the best ways to protect
your network against broadcast storms.
A state in which a message that has been broadcast across a network
results in even more responses, and each response results in still
more responses in a snowball effect. A severe broadcast storm can
block all other network traffic, resulting in a network meltdown.
Broadcast storms can usually be prevented by carefully configuring a
network to block illegal broadcast messages.
8) What is the purpose of VRRP?
9) Ans: The purpose of the VRRP packet is to communicate to all VRRP
routers the priority and the state of the Master router associated
with the Virtual Router ID.
VRRP packets are sent encapsulated in IP packets. They are sent to the
IPv4 multicast address assigned to VRRP.
10) What is a VPN?
Ans: VPN(Virtual Private Network )? these are bascially the logical
networks on the physical line? you can have many VPN oveer same line..
Need of VPN arises when your company need to increase the network but
don't want to buy any more switches.. take an eg. your dept. your room
is packed with employees and ur company need to add 4 more persons to
ur deptt. what will they do.. the solution is to create VPN's?you can
configure the switch ports in other deptts. and create a specific VLAN
of ur deptt.so that the persons can sit there and access to the
required pcs.
11) What information about a peer would I need to establish a VPN?
12) What is a full-class C in CIDR notation?
Ans : For class A ..default subnet mask is 255.0.0.0 so CIDR notation is /8
For class B ..default subnet mask is 255.255.0.0 so CIDR notation is /16
For class C ..default subnet mask is 255.255.255. 0 so CIDR notation is /24
13) What is a default route?
Ans : While configuring the Routers we need to give the specific
routes if we are configuring a Static route..and for Default..we need
not give the single route,, we just have to set the default route
command on the router and we set this command on the router of last
resort?that is it discovers the near by routes itself..
14) What is a metric?
Ans: Routing tables contain information used by switching software to
select the best route.
Routing algorithms have used many different metrics to determine the
best route. Sophisticated routing algorithms can base route selection
on multiple metrics, combining them in a single (hybrid) metric. All
the following metrics have been used:
15) What is a MAC address?
Ans : MAC is a machines Physical address, The internet is addressed
based on a logical addressing approach. Say,when the packet reaches
say the bridge connection a LAN, the question is..how does it
identify, which computer it needs to send the packet to. For this it
uses the concept of ARP, Address Resolution Protocol, which it uses
over time to build up a table mapping from the Logical addresses to
the Physical addresses. Each computer is identified using its
MAC/Physical address ( u can use the ipconfig -all option to get ur
MAC address).
16) What is ARP/RARP?
Ans : ARP: Stands for Address Resolution Protocol?whenever a request
is sent by a node on one network to the node on another network the
Physical address(MAC) is required and for this the IP address need to
be flow over the network..whenver a router with that network (IP) gets
the msg. the required MAC address is sent through the network this
process of converting the IP address to MAC address is Called ARP..and
the reverse thats the convertion of the Mac address to the IP address
is called RARP ( Reverse Address Resolution Protocol)
RARP: RARP is a TCP/ IP protocol term similar to ARP. RARP is the
method that some machines use to determine their own IP address.
Essentially, a machine sends out a packet that includes a machine
hardware address. A server on the same network receives the packet and
looks up the hardware address. The server then sends back the
associated IP address of that machine. It is used for machines that do
not have the capability to store their own IP addresses locally.
ARP:-
Address Resolution Protocol. ARP is the protocol used by IP (as in
TCP/IP) for address resolution. Address resolution refers to the
ability of a station to resolve another station's MAC (hardware)
address given its IP address.
17) Describe a TCP connection sequence
18) Ans: The TCP three-way handshake describes the mechanism of
message exchange that allows a pair of TCP devices to move from a
closed state to a ready-to-use, established connection. Connection
establishment is about more than just passing messages between devices
to establish communication. The TCP layers on the devices must also
exchange information about the sequence numbers each device wants to
use for its first data transmission, as well as parameters that will
control how the connection operates. The former of these two data
exchange functions is usually called sequence number synchronization,
and is such an important part of connection establishment that the
messages that each device sends to start the connection are called SYN
(synchronization) messages.
You may recall from the TCP fundamentals section that TCP refers to
each byte of data individually, and uses sequence numbers to keep
track of which bytes have been sent and received. Since each byte has
a sequence number, we can acknowledge each byte, or more efficiently,
use a single number to acknowledge a range of bytes received
19) What is MTU?
Ans : The MTU is the "Maximum Transmission Unit" used by the TCP
protocol. TCP stands for Transmission Control Prototcol. The MTU
determines the size of packets used by TCP for each transmission of
data. Too large of an MTU size may mean retransmissions if the packet
encounters a router along its route that can't handle that large a
packet. Too small of an MTU size means relatively more overhead and
more acknowledgements that have to be sent and handled. The MTU is
rated in "octets" or groups of 8 bits. The so-called "official"
internet standard MTU is 576, but the standard rating for ethernet is
an MTU of 1500.
20) What other TCP setting can you modify besides MTU to shorten packets?
21) What is Socket?
Ans : When a computer program needs to connect to a local or wide area
network such as the Internet, it uses a software component called a
socket. The socket opens the network connection for the program,
allowing data to be read and written over the network. It is important
to note that these sockets are software, not hardware, like a wall
socket. So, yes, you have a much greater chance of being shocked by a
wall socket than by a networking socket.
Sockets are a key part of Unix and Windows-based operating systems.
They make it easy for software developers to create network-enabled
programs. Instead of constructing network connections from scratch for
each program they write, developers can just include sockets in their
programs. The sockets allow the programs to use the operating system's
built-in commands to handle networking functions. Because they are
used for a number of different network protocols (i.e. HTTP, FTP,
telnet, and e-mail), many sockets can be open at one time.
--------------------------------------------------------------------------------------------------------------
PATNI
1. what is diff between 32bit & 64 bitos
2.Difference between su & su -
3.how u mount a share from client machine in samba server
4.how you set eth0 card to eth1 for a particular ip
5.what is lsof command
6.what is the command to see open ports an ip
7.what is block file & character file (eg)
8.how you know the arch of machine when you download rpm from net
9.diff between i686 & i386
10.what is the machine type of your server
11.what is the command to know cpu info
12.what is diff between top & ps -el
13.what is multi threading.
14.Have you knowledge of system testing
15.vmware diff distribution
16.write a script inserting & deleting kernel modules
17.how you know your kernel module of ram
COGNIZANT
1.What is hda hdb & what is for scsi disk
2.Kernel compilation process
3.Whatmkproper mkdep mkclean mkbzimage does
4.What is MBR
5.What is the magic no ? why 2bytes of magic no defined seprately
6.Diff between lilo & grub
7.How to add new hdd in system What you do in bios part
8.No of ways to install linux
9.Boot process
10.What happens between init script & inittab examination
11.how you install linux
12.how to install softwares except rpm
TRIMAX
1.How you do scheduling
2.What you do when server goes slow
3.How you do perfomance tunning
4.Fullfrom of GRUB
5.What is iptables explain
6.Iptables explain
7.What is your daily routine
8.Whare passwd stores
9.Field of /etc/passwd
10.Linux filesystem type
11.How you know samba is install
12.where MBR is stored in harddisk in outerrage 0r innerrage
13.what type of shells are their & what will you use why
14.How to secure NFS
GAJSHIELD
1.How to set permisson for one of the group HR
2.How to block port 80
--------------------------------------------------------------------------------------------------------------
Linux Fundamentals:-
1. Mention the steps to change hostname of a machine without reboot.
__________________
__________________
2. Mention the command to check network interface media status for all NICs.
__________________
__________________
3. ON A Red Hat Linux Variant how do you control whether a service starts when the system boots. Give some examples.
__________________
__________________
__________________
4. What are the different process states in unix?
a)__________________
b)__________________
c)__________________
d)__________________
5. You need to view the contents of the tarfile called abc.tar.bz2. What command would you use?
__________________
6. Mention output of the below command.
$(date;ps -ef|awk'{print $1}'|sort|uniq|wc -l)>>Activity.log
__________________
__________________
7. What command do you run to check file system consistency?
__________________
__________________
8. What does below cron entry indicate:
15 1-3 * * * myscript.sh
__________________
__________________
__________________
9. Write a command to list all regular files named "core" starting in the directory /prog and not modified since last 30days.
__________________
__________________
Troubleshooting :-
1. Mention 5 steps you will take when you discover that www.yahoo.com is not opening up from your office laptop connected in the office
LAN.
__________________
__________________
__________________
__________________
__________________
2. Mention ways of upgrading packages in Redhat and Debian distros.
__________________
__________________
__________________
3. What is difference between TCP and UDP. Mention 2 areas where UDP protocol is used
__________________
__________________
__________________
4. Mention few commands/steps to troubleshoot NFS related problems.
__________________
__________________
__________________
5. List few commands related to disk, cpu, memory, processes, etc. which are used for performance monitoring.
a)__________________
b)__________________
c)__________________
d)__________________
e)__________________
f)__________________
APACHE/MYSQL/PHP/TOMCAT/PERL.
1. Mention few important directives in Apache.
a)__________________
b)__________________
c)__________________
d)__________________
e)__________________
f)__________________
2. What are various ways of integrating tomcat with apache.
__________________
__________________
__________________
3. What does htpasswd do?
__________________
4. Use mysqldump to create a copy of the database named "db3"
__________________
5. What is SLL and which port does it run?
__________________
__________________
6. How will you install or update a perl package?
__________________
__________________
__________________
7. List few apache error/response code?
a)__________________
b)__________________
c)__________________
d)__________________
DNS:-
1. Mention min 3 imp. details will you find from WHOIS record of a Domain name.
a)__________________
b)__________________
c)__________________
d)__________________
2. Mention any 5 DNS records and their purpose.
a)__________________
b)__________________
c)__________________
d)__________________
e)__________________
3. What are various types of Nameservers ?
__________________
__________________
4. List few tools/websites used for DNS lookups.
a)__________________
b)__________________
c)__________________
d)__________________
e)__________________
f)__________________
MAIL & LDAP:-
1. Mention imp. postfix configuration files.
__________________
__________________
__________________
__________________
2. What is LDAP & where is it used?
__________________
__________________
3. Mention few techniques/checks used in spam prevention applications.
__________________
__________________
__________________
__________________
4. List imp. files in a qmail-based mail server.
a)__________________
b)__________________
c)__________________
d)__________________
e)__________________
f)__________________
5. List few known LDAP servers.
a)__________________
b)__________________
c)__________________
d)__________________
6. Mention few steps to troubleshoot if email for a desktop user is not working.
__________________
_________________
__________________
__________________
----------------------------------------------------------------------------------------------------------------------------------------------
1. Mention the steps to change hostname of a machine without reboot.
__________________
__________________
2. Mention the command to check network interface media status for all NICs.
__________________
__________________
3. ON A Red Hat Linux Variant how do you control whether a service starts when the system boots. Give some examples.
__________________
__________________
__________________
4. What are the different process states in unix?
a)__________________
b)__________________
c)__________________
d)__________________
5. You need to view the contents of the tarfile called abc.tar.bz2. What command would you use?
__________________
6. Mention output of the below command.
$(date;ps -ef|awk'{print $1}'|sort|uniq|wc -l)>>Activity.log
__________________
__________________
7. What command do you run to check file system consistency?
__________________
__________________
8. What does below cron entry indicate:
15 1-3 * * * myscript.sh
__________________
__________________
__________________
9. Write a command to list all regular files named "core" starting in the directory /prog and not modified since last 30days.
__________________
__________________
Troubleshooting :-
1. Mention 5 steps you will take when you discover that www.yahoo.com is not opening up from your office laptop connected in the office
LAN.
__________________
__________________
__________________
__________________
__________________
2. Mention ways of upgrading packages in Redhat and Debian distros.
__________________
__________________
__________________
3. What is difference between TCP and UDP. Mention 2 areas where UDP protocol is used
__________________
__________________
__________________
4. Mention few commands/steps to troubleshoot NFS related problems.
__________________
__________________
__________________
5. List few commands related to disk, cpu, memory, processes, etc. which are used for performance monitoring.
a)__________________
b)__________________
c)__________________
d)__________________
e)__________________
f)__________________
APACHE/MYSQL/PHP/TOMCAT/PERL.
1. Mention few important directives in Apache.
a)__________________
b)__________________
c)__________________
d)__________________
e)__________________
f)__________________
2. What are various ways of integrating tomcat with apache.
__________________
__________________
__________________
3. What does htpasswd do?
__________________
4. Use mysqldump to create a copy of the database named "db3"
__________________
5. What is SLL and which port does it run?
__________________
__________________
6. How will you install or update a perl package?
__________________
__________________
__________________
7. List few apache error/response code?
a)__________________
b)__________________
c)__________________
d)__________________
DNS:-
1. Mention min 3 imp. details will you find from WHOIS record of a Domain name.
a)__________________
b)__________________
c)__________________
d)__________________
2. Mention any 5 DNS records and their purpose.
a)__________________
b)__________________
c)__________________
d)__________________
e)__________________
3. What are various types of Nameservers ?
__________________
__________________
4. List few tools/websites used for DNS lookups.
a)__________________
b)__________________
c)__________________
d)__________________
e)__________________
f)__________________
MAIL & LDAP:-
1. Mention imp. postfix configuration files.
__________________
__________________
__________________
__________________
2. What is LDAP & where is it used?
__________________
__________________
3. Mention few techniques/checks used in spam prevention applications.
__________________
__________________
__________________
__________________
4. List imp. files in a qmail-based mail server.
a)__________________
b)__________________
c)__________________
d)__________________
e)__________________
f)__________________
5. List few known LDAP servers.
a)__________________
b)__________________
c)__________________
d)__________________
6. Mention few steps to troubleshoot if email for a desktop user is not working.
__________________
_________________
__________________
__________________
----------------------------------------------------------------------------------------------------------------------------------------------
SDG in NOIDAhttp://www.sdgc.com
1. Why do we need Apache, Does the Tomcat can handle the same ?
2. How can we integrate Apache with Tomcat ?
3. Versions that you are using for Apache,Tomcat,Mysql ?
4. Working of Nagios ?
5. How to add a new server to Nagios for monitorng ?
6. How to create a repository in SVN ?
7. Why we remove the work folder in Tomcat while deploying new war files ?
8. Mysql replication, advantages, which all files need to be edited for replication ?
9. What is a contest ?
10.Difference between Mysql and Sql ?
11.Why and what we do for OUT OF MEMORY error ?
12.Configuration files for Tomcat ?
13.How can we increase the memory in Tomcat ?
14.Is there any diffrence between Tomcat and JBoss ?
15.How can we do Virtual hosting in Tomcat ?
16.Memory Heap ?
REDHAT - Round 1
http://www.redhat.in/
1. Two Diffrent ways to configure Apache and how ?
2. Name virtual host or IP virtual host is good ? Why?
3. What is SMARTHOST in sendmail ?
4. How can we disable a users login ?
5. Can we change the primary group of a user after creating a user?
6. How you secure a linux box?
7. Situavation in a big company - They have 2mbps leased line and 1mbps line, you have to give the 2mbps line to developers and 1 mpbs line to sales peoples with any controllers? How can you handle this situvation ?
8. Port numbers for telnet and pop3?
9. Diffrence between Hardlink and Softlink?
10.File systems in Linux?
11.What will you do when a file system corrupt. How you handle it?
REDHAT - Round 2
http://www.redhat.in/
1. How to take apache core dump?
2. Difference between IMAP and POP3?
3. Ext2 and Ext3 ?
4. How to point abc.com to a serverlet page ?
5. How to handle segmentation faults in apache?
6. Tcpdump ?
7. Difference between TCP and UDP ?
8. SSL ? what is its significance?
9. Which service is using UDP protocol ?
10.Which is using TCP protocol ?
11. .htaccess importance ?
12.Which one you opt - changes in apache config or change in .htaccess ?
13. Difference between RAID1 and RAID 5?
14. What is lost+found in linux ?
http://google.com
1.Introduction.
2.Current work setup.
3.Most challenging job that done in life.
4.Job that i can't handle in my life.
5.Difference between windows and linux.
6.Why the need for varoius linux distributions live Debian, redhat,fedora etc.
7.Different package management in linux.
8.Purpose of Load balancer
9.How to implement load balancer
10.If a call from a loadbalancer to an application server, then the reply to that call from loadbalancer to the client or directly to the client.
11.Difference between http and https.
12.Steps in SSL.
13.How the browser knows the site is https or not.
14.Kernal compilation.
15.What is GPL license
16.Whats the purpose of master-master db replication.
17.In an organization there are 1000 pupils, they need different levels of access, how we can implement it. If an marketing guy in travel needs to access local network as well as VPN, how we can implement.
--------------------------------------------------------------------------------------------------------------
1. What wud u do to secure http?
2. What wud u do to secure ftp?
3. how would you create ssl based virtual hosting? explain steps
4. How wud u create ssl certificate? explain steps and cmds.
5. How the process of ssl encryption and certificate works? what is the
basic idea behind it?
6. who issues ssl certificate from the server side when a client request
access to the website?
7. what wud u do if ur server crahes?
8. suppose if ur system is booting n halt at filesystem mounting, what wud u do?
9. how to repair filesystem?
10. why we umount filesystem before giving repairing cmds to it?What
happens when we keep the filesystem mounted and isssues a filesystem
11. repairing cmd like say $fsck -yk /dev/sdx
12. what is the cmd to format a partition?
13. what is the to see the exit status of a process ?
In samba, what wud u do if u want every user to create file with
ownership of 1 single user.
14. How to take backup of the mysql database?
15. How would u secure mysql database ?and how to u restrict users through
priveleges?
16. When was the last time you resolved a critical issue on ur own?
what is your daily routine in your present company?
How you manages a critical server?
17. In iptables how will u connect the clients to different networks
----------------------------------------------------------------------------------------------------------------------------------------------
katalyst partners (mape)
1. Types of kernel
2. what will u do if u get a blank page from one of the site
hosted in ur apache srv
3. mysql slows down after 2 hrs, wht can be the issue.
4. up to what extent ur apache logs can grow, is there any limit
5. how will increase the performance of apache
6.how will secure mountpoints
What wud u do to secure http?
What wud u do to secure ftp?
how would you create ssl based virtual hosting? explain steps
How wud u create ssl certificate? explain steps and cmds.
How the process of ssl encryption and certificate works? what is the
basic idea behind it?
who issues ssl certificate from the server side when a client request
access to the website?
what wud u do if ur server crahes?
suppose if ur system is booting n halt at filesystem mounting, what wud u do?
how to repair filesystem?
why we umount filesystem before giving repairing cmds to it?What
happens when we keep the filesystem mounted and isssues a filesystem
repairing cmd like say $fsck -yk /dev/sdx
what is the cmd to format a partition?
what is the to see the exit status of a process ?
In samba, what wud u do if u want every user to create file with
ownership of 1 single user.
How to take backup of the mysql database?
How would u secure mysql database ?and how to u restrict users through
priveleges?
When was the last time you resolved a critical issue on ur own?
what is your daily routine in your present company?
How you manages a critical server?
----------------------------------------------------------------------------------------------------------------
What is Linux and why is it so popular?
Answer - Linux is an operating system that uses UNIX like Operating system.......
Unix interview questions with answers
Discuss the mount and unmount system calls, What are the process states in Unix?, What is use of sed command?, What is 'inode'?,What are the Unix system calls for I/O?, How are devices represented in UNIX?, Brief about the directory representation in UNIX ......
What is LILO?
Answer - LILO is Linux Loader is a boot loader for Linux. It is used to load Linux into the memory and start the Operating system.......
What is the difference between home directory and working directory?
Answer - Home directory is the default working directory when a user logs in. On the other hand, working directory is the user’s current directory.......
What is the difference between internal and external commands?
Answer - Internal commands are commands that are already loaded in the system. They can be executed any time and are independent.......
Explain the difference between a static library and a dynamic library.
Answer - Static libraries are loaded when the program is compiled and dynamically-linked libraries are loaded in while......
What is LD_LIBRARY_PATH?
Answer - LD_LIBRARY_PATH is an environment variable. It is used for debugging a new library or a non standard library.......
What is the file server in Linux server?
Answer - File server is used for file sharing. It enables the processes required fro sharing.......
What is NFS? What is its purpose?
Answer - NFS is Network File system. It is a file system used for sharing of files over a network.......
How do I send email with linux?
Answer - Email can be sent in Linux using the mail command. ......
Explain RPM (Red Hat Package Manager) features.
Answer - RPM is a package managing system (collection of tools to manage software packages).......
What is Kernel? Explain the task it performs.
Answer - Kernel is used in UNIX like systems and is considered to be the heart of the operating system.......
What is Linux Shell? What is Shell Script?
Answer - Linux shell is a user interface used for executing the commands. Shell is a program the user......
What are Pipes? Explain use of pipes.
Answer - A pipe is a chain of processes so that output of one process (stdout) is fed an input (stdin) to another.......
Explain trap command; shift Command, getopts command of linux.
Answer - Trap command: controls the action to be taken by the shell when a signal is received. ......
What Stateless Linux server? What feature it offers?
Answer - A stateless Linux server is a centralized server in which no state exists on the single workstations. ......
What does nslookup do? Explain its two modes.
Answer - Nslookup is used to find details related to a Domain name server. Details like IP addresses of a machine, MX records,......
What is Bash Shell?
Answer - Bash is a free shell for UNIX. It is the default shell for most UNIX systems. It has a combination of the C and Korn shell features. ......
Explain some Network-Monitoring Tools in Linux: ping, traceroute, tcpdump, ntop
Answer - Network monitoring tools are used to monitor the network, systems present on the network, traffic etc.......
How does the linux file system work?
Answer - Linux file structure is a tree like structure. It starts from the root directory, represented by '/', and then expands into sub-directories.......
What are the process states in Linux?
Answer - Process states in Linux.......
What is a zombie?
Answer - Zombie is a process state when the child dies before the parent process. In this case the structural information of the process is still in the process table.......
Explain each system calls used for process management in linux.
Answer - System calls used for Process management......
------------------------------------------------------------------------------------
Unix Interview questions with answers
What are the Unix system calls for I/O?
The following are the UNIX system calls for I/O: Open: to open a file. Syntax: open (pathname, flag, and mode)......How are devices represented in UNIX?
UNIX represents all devices as files. These files are located in the directory /dev..........Brief about the directory representation in UNIX
A UNIX directory is representing a file that consists of a correspondence between file names and inodes........Discuss the mount and unmount system calls
The attaching of a file system to another file system is done by using mount system call........What are the process states in Unix?
UNIX has the following process states:.......What is use of sed command?
Sed command reads from a standard input and places it into the pattern space.......What is 'inode'?
A file in UNIX is given a unique number. This unique number is known as ‘inode’.......What are links and symbolic links in UNIX file system?
Link is a utility program in UNIX which establishes a hard link from one directory to another directory........Explain fork() system call.
fork() system call is used to create processes. It returns a process id. After calling fork() system call......What is a zombie?
A zombie is a process which is completed the execution and still available in the process table........How do you create special files like named pipes and device files?
Special files are created by the system call ‘mknod’. Upon using the following sequence of steps, a special file will be created.......How do I use poll()?
poll() allows an event to wait on a file descriptor. A pointer is accepted by poll() to a list of ‘struct pollfd’...........More Unix interview questions
What is Linux and why is it so popular?
Answer - Linux is an operating system that uses UNIX like Operating system.......
What is LILO?
Answer - LILO is Linux Loader is a boot loader for Linux. It is used to load Linux into the memory and start the Operating system.......
What is the difference between home directory and working directory?
Answer - Home directory is the default working directory when a user logs in. On the other hand, working directory is the user’s current directory.......
What is the difference between internal and external commands?
Answer - Internal commands are commands that are already loaded in the system. They can be executed any time and are independent.......
Explain the difference between a static library and a dynamic library?
Answer - Static libraries are loaded when the program is compiled and dynamically-linked libraries are loaded in while......
Describe initial process sequence while the system boots up.
1) BIOS 2) Master Boot Record (MBR) 3) LILO or GRUB 4) Kernel 5) init 6) Run Levels.............What is a shell? What are shell variables?
A shell us an interface to the user of any operating system..............Explain how the inode maps to data block of a file.
There are 13 block addresses in inode. The file descriptions – type of file, access rights.............Explain some system calls used for process management.
The following are the system calls: fork() - For creating child process .............Explain how to get/set an environment variable from a program.
An environment variable can get using the function getenv()..............Describe how a parent and child process communicates each other.
The inter communication between a child process and a parent process can be done through normal communication.............What is a Daemon?
Daemon is the short form for Disk and Execution Monitor..............What is 'ps' command for?
The shortage for “process status” is ps. This command is used to display the currently running processes on Linux/Unix systems..............How the Swapper works?
Moving the information from fast access memory and slow access memory and vice versa is known as swapping..............What is the difference between Swapping and Paging?
Swapping performs the whole process to transfer to the disk, where as paging performs.............What is Expansion swap?
Expansion swap is a part of hard disk. This is reserved for the purpose of storing chunks of a program.............What is Fork swap?
For creation of child process, fork() system call is invoked. At the time of processing the fork() call by parent.............What are the requirements for a swapper to work?
The functionality of a swapper is on the scheduling priority which is highest. The swapper searches.............What is ‘the principle of locality’?
The next most data item or instruction is the closest to the current data item or instruction..............What is page fault? Its types.
One of the critical parts of code in the Linux kernel. It has a major influence on memory subsystem’s performance..............Difference between the fork() and vfork() system call.
fork: Both the parent and child share all of the page tables until any one of them does a write..............What is BSS(Block Started by Symbol)?
UNIX linkers produce uninitialized data segments..............What is Page-Stealer process? Explain the paging states for a page in memory.
The pages that are eligible for swapping are found by the Page-Stealer’.............Explain the phases of swapping a page from the memory.
The phases of swapping a page from the memory are:.............What is Demand Paging? Explain the conditions for a machine to support Demand Paging.
The process of mapping a large address space into a relatively small amount of physical memory is known as demand paging..............Difference between Fault Handlers and the Interrupt handlers.
Fault handlers can sleep, where as interrupt handlers cannot..............What is validity fault? In what way the validity fault handler concludes?
Validity fault is the result of non setting of valid bits in main memory at the time of refererring a page by a process ..............What is protection fault?
Protection fault is a name of an error. This error occurs when accessing storage space is tried.............Explain how the Kernel handles both the page stealer and the fault handler.
When the memory shortage occurs then the page stealer and fault handler thrashes..............What is ex and vi? Explain their purposes.
ex – the line editor mode of ‘vi’ editor. It allows to.............What is kill()? Explain its possible return values.
kill() is a system call which stops a process. The return values of kill() are:.............Explain the steps that a shell follows while processing a command.
The sequence of executing commands by shell are as follows:.............What is the difference between cmp and diff commands? Provide an example for each.
Byte by byte comparision performed for two files comparision and displays the first mismatch byte..............What is the use of ‘grep’ command? Provide an example
Grep stands for regular expression. ‘grep’ command is used to find the patterns in a text file provided by the user..............Difference between cat and more command.
The file contents are displayed by ‘cat’ command..............What is ‘du’ command? What is its use?
The du (disk usage) command is used to report the size of directory trees..............Explain the various prompts that are available in a UNIX system.
UNIX supports 4 prompts: PS1: default prompt.............Describe how the kernel differentiates device files and ordinary files.
There are 2 device files. They are character device file and block device file..............Explain how to switch to a super user status to gain privileges.
The command ?su? is used to get super user status..............What is Linux and why is it so popular?
AnswerLinux is an operating system that uses UNIX like Operating system. However, unlike UNIX, Linux is an open source and free software. Linux was originally created by Linus Torvalds and commonly used in servers.Popularity of Linux is because of the following reasons
- It is free and open source. We can download Linux for free and customize it as per our needs.
- It is very robust and adaptable.
- Immense amount of libraries and utilities
What is LILO?LILO stands for Linux Loader which is a bootstrap program. LILO is a code snippet which loads PC BIOS into the main memory at the time of starting the computer system. LILO handles the following tasks:
-Locating Linux kernel
-Identifying other supporting programs and loading them in the memory
-Staring Kernel
The selection of various kernel images and boot routines is supported by LILO. For this reason, LILO is known as boot manager.
What is the file server in Linux server?
A file server is dedicated for persisting files in a location from which the networked systems can access. Certain access privileges can be set for files.
Linux has software named as ‘samba’ which allows the files to be shared, viewed and edited on any remote system which may has Windows 9 x/ME/2000/NT or Macintosh computer systems. These files on the file server are backed up from time to time. If a file is deleted inadvertently, the file can be recovered from the backup tape.
Explain RPM (Red Hat Package Manager) features.
AnswerRPM is a package managing system (collection of tools to manage software packages).
Features:
- RPM can verify software packages.
- RPM can be served as a powerful search engine to search for software’s.
- Components, software’s etc can be upgraded using RPM without having to reinstall them
- Installing, reinstalling can be done with ease using RPM
- During updates RPM handles configuration files carefully, so that the customization is not lost.
What is Kernel? Explain the task it performs.
AnswerKernel is used in UNIX like systems and is considered to be the heart of the operating system. It is responsible for communication between hardware and software components. It is primarily used for managing the systems resources as well.Kernel Activities:
- The Kernel task manager allows tasks to run concurrently.
- Managing the computer resources: Kernel allows the other programs to run and use the resources. Resources include i/o devices, CPU, memory.
- Kernel is responsible for Process management. It allows multiple processes to run simultaneously allowing user to multitask.
- Kernel has an access to the systems memory and allows the processes to access the memory when required.
- Processes may also need to access the devices attached to the system. Kernel assists the processes in doing so.
- For the processes to access and make use of these services, system calls are used.
What is Linux Shell? What is Shell Script?
AnswerLinux shell is a user interface used for executing the commands. Shell is a program the user uses for executing the commands. In UNIX, any program can be the users shell. Shell categories in Linux are:Bourne shell compatible, C shell compatible, nontraditional, and historical.
A shell script, as the name suggests, is a script written for the shell. Script here means a programming language used to control the application. The shell script allows different commands entered in the shell to be executed. Shell script is easy to debug, quicker as compared to writing big programs. However the execution speed is slow because it launches a new process for every shell command executed. Examples of commands are cp, cn, cd.
What are Pipes? Explain use of pipes.
AnswerA pipe is a chain of processes so that output of one process (stdout) is fed an input (stdin) to another. UNIX shell has a special syntax for creation of pipelines. The commands are written in sequence separated by |. Different filters are used for Pipes like AWK, GREP.e.g. sort file | lpr ( sort the file and send it to printer)
Uses of Pipe
- Several powerful functions can be in a single statement
- Streams of processes can be redirected to user specified locations using >
What Stateless Linux server? What feature it offers?
AnswerA stateless Linux server is a centralized server in which no state exists on the single workstations. There may be scenarios when a state of a partilcuar system is meaningful (A snap shot is taken then) and the user wants all the other machines to be in that state. This is where the stateless Linux server comes into picture.Features:
- It stores the prototypes of every machine
- It stores snapshots taken for those systems
- It stores home directories for those systems
- Uses LDAP containing information of all systems to assist in finding out which snapshot (of state) should be running on which system.
What does nslookup do? Explain its two modes.
AnswerNslookup is used to find details related to a Domain name server. Details like IP addresses of a machine, MX records, servers etc. It sends a domain name query packet to the corresponding DNS.Nslookup has two modes. Interactive and non interactive. Interactive mode allows the user to interact by querying information about different hosts and domains.
Non interactive mode is used to fetch information about the specified host or domain.
Interactive mode:
Nslookup [options] [server]
Explain some Network-Monitoring Tools in Linux: ping, traceroute, tcpdump, ntop
AnswerNetwork monitoring tools are used to monitor the network, systems present on the network, traffic etc.Ping: Ping command is used to check if the system is in the network or not. To check if the host is operating.
e.g. ping ip_address
When the command is executed, it returns a detailed summary of the host. Packets sent, received, lost by estimating the round trip time.
Traceroute: the command is used to trace the path taken by the packet across a network. Tracing the path here means finding out the hosts visited by the packet to reach its destination. This information is useful in debugging. Roundtrip time in ms is shown for every visit to a host.
Tcpdump: commonly used to monitor network traffic. Tcdump captures and displays packet headers and matching them against criteria or all. It interprets Boolean operators and accepts host names, ip address, network names as arguments.
Ntop: Network top shows the network usage. It displays summary of network usage by machines on the network in a format as of UNIX top utility. It can also be run in web mode, which allows the display to be browsed with a web browser. It can display network traffic statistics, identify host etc. Interfaces are available to view such information.
How does the linux file system work?
AnswerLinux file structure is a tree like structure. It starts from the root directory, represented by '/', and then expands into sub-directories. All the partitions are under the root directory. If a partition is mounted (The mount point defines the place of a particular data set in the file system) anywhere apart from a “device”, the system is not aware of the existence of that partition or device. Directories that are only one level below the root directory are often preceded by a slash, to indicate their position.Explain file system of linux. The root "/" filesystem, /usr filesystem, /var filesystem, /home filesystem, /proc filesystem.
AnswerRoot "/" file system: The kernel needs a root file system to mount at start up. The root file system is generally small and should not be changed often as it may interrupt in booting. The root directory usually does not have the critical files. Instead sub directories are created. E.g. /bin (commands needed during bootup), /etc (config files) , /lib(shared libraries).
/usr filesystem : this file system is generally large as it contains the executable files to be shared amongst different machines. Files are usually the ones installed while installing Linux. This makes it possible to update the system from a new version of the distribution, or even a completely new distribution, without having to install all programs again. Sub directories include /bin, /include, /lib, /local (for local executables)
/var filesystem : this file system is specific to local systems. It is called as var because the data keeps changing. The sub directories include /cache/man (A cache for man pages), /games (any variable data belong to games), /lib (files that change), /log (log from different programs), /tmp (for temporary files)
/home filesystem: - this file system differs from host to host. User specific configuration files for applications are stored in the user's home directory in a file. UNIX creates directories for all users directory. E.g /home/my_name. Once the user is logged in ; he is placed in his home directory.
/proc filesystem : this file system does not exist on the hard disk. It is created by the kernel in its memory to provide information about the system. This information is usually about the processes. Contains a hierarchy of special files which represent the current state of the kernel .Few of the Directories include /1 (directory with information about process num 1, where 1 is the identification number), /cpuinfo (information about cpu), /devices (information about devices installed), /filesystem (file systems configured), /net (information about network protocols), /mem (memory usage)
What are the process states in Linux?
The following are the process states:
1. Running: This is a state where a process is either in running or ready to run.
2. Interruptible: This state is a blocked state of a process which awaits for an event or a signal from another process
3. Uninterruptible: It is also a blocked state. The process is forced to halt for certain condition that a hardware status is waited and a signal could not be handled.
4. Stopped: Once the process is completed, this state occurs. This process can be restarted
5. Zombie: In this state, the process will be terminated and the information will still be available in the process table.
Operating system Interview questions with answers posted on August 06, 2008 at 18:10 pm by Amit Satpute
Explain the meaning of Kernal.
The kernel is the essential center of a computer operating system, the core that........ Read answerWhat is a command interpreter?
The part of an Operating System that interprets commands and carries them out.........Read answer
What is a daemon?
In Unix and some other operating systems, a daemon is a computer program that runs.........Read answer
Explain the basic functions of process management.
The basic functions of the OS wrt the process management are :........Read answer
What is a named pipe?
A connection used to transfer data between separate processes, usually on separate computers. ........Read answer
What is pre-emptive and non-preemptive scheduling?
Tasks are usually assigned with priorities. At times it is necessary to run a certain.........Read answer
What is a semaphore?
A semaphore is a variable. There are 2 types of semaphores:.........Read answer
Explain the meaning of mutex.
A mutex and the binary semaphore are essentially the same..........Read answer
What are the different types of memory?
the types of memory in a computer system are: .........Read answer
Explain the meaning of virtual memory.
Virtual memory is an approach to make use of the secondary storage devices as an extension.........Read answer
Operating system Interview questions with answers posted on May 06, 2009 at 13:10 pm by Vidya Sagar
What is RTOS?
A certain capability within a specified time constraint is guaranteed by an operating system called ‘real time operating system’....... Read answerWhat is the difference between hard real-time and soft real-time OS?
Critical task completion on time is guaranteed by a hard real time system......Read answerWhat type of scheduling is there in RTOS?
The tasks of real time operating system have 3 states namely, ‘running’, ’ready’, ‘blocked’...........Read answerWhat is interrupt latency?
The time between a device that generates an interrupt and the servicing of the device that generated the interrupt is known as interrupt latency...........Read answerWhat is priority inheritance?
Priority inversion problems are eliminated by using a method called priority inheritance...........Read answerWhat is spin lock?
In a loop a thread waits simply (‘spins’) checks repeatedly until the lock becomes available............Read answer
What is an operating system? What are the functions of an operating system?
An operating system is an interface between hardware and software. OS is responsible for managing and co-ordinating the activities of a computer system..................Read answerWhat is paging? Why paging is used?
OS performs an operation for storing and retrieving data from secondary storage devices for use in main memory. Paging is one of such memory management scheme.................Read answerDifference between a process and a program
- A program is a set of instructions that are to perform a designated task, where as the process is an operation which takes the given instructions and perform the manipulations as per the code...............Read answerWhat is the meaning of physical memory and virtual memory?
Physical memory is the only memory that is directly accessible to the CPU. CPU reads the instructions stored in the physical memory and executes them continuously...............Read answerWhat is the difference between socket and pipe?
Sockets: Socket is a part of OSI layer model. Communication among different layers is performed through sockets. Application layer serves through some sockets to the presentation layer and upper application layer................Read answerWhat are the difference between THREAD, PROCESS and TASK?
A program in execution is known as ‘process’. A program can have any number of processes. Every process has its own address space..................Read answerDifference between NTFS and FAT32
The differences are as follows:NTFS:- Allows the access local to Windows 2000, Windows 2003, Windows NT with service pack 4 and later versions may get access for some file..................Read answerDifferentiate between RAM and ROM
RAM: - Volatile memory - Electricity needs to flow continuously - Program information is stored in RAM - RAM is read / write memory..............Read answerWhat is DRAM? In which form does it store data?
DRAM – Dynamic Random Access Memory. One of the read / write memory. DRAM is cheap and does the given task................Read answerWhat is cache memory? Explain its functions.
Cache memory is RAM. The most recently processing data is stored in cache memory. CPU can access this data more quickly than it can access data in RAM................Read answerDifferentiate between Complier and Interpreter
- The program syntax is checked by the compiler; where as the keywords of the program is checked by the interpreter......................Read answerDescribe different job scheduling in operating systems.
Job scheduling is an activity for deciding the time for a process to receive the resources they request.First Come First Served: In this scheduling, the job that is waiting for a long time is served next................Read answer
What is a Real-Time System?
Real-time system is the study of hardware and software, which are subject to the operational deadlines from event to the system response.................Read answerWhat do you mean by deadlock?
Dead lock is a situation of two or more processes waiting for each other to finish their tasks. In this situation no progress or no advancement is made...............Read answerDifference between Primary storage and secondary storage
Primary memory storages are temporary; where as the secondary storage is permanent. Primary memory is expensive and smaller, where as secondary memory is cheaper and larger................Read answer--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Linux admin interview questions
- How do you take a single line of input from the user in a shell script?
- Write a script to convert all DOS style backslashes to UNIX style slashes in a list of files.
- Write a regular expression (or sed script) to replace all occurrences of the letter ‘f’, followed by any number of characters, followed by the letter ‘a’, followed by one or more numeric characters, followed by the letter ‘n’, and replace what’s found with the string “UNIX”.
- Write a script to list all the differences between two directories.
- Write a program in any language you choose, to reverse a file.
- What are the fields of the password file?
- What does a plus at the beginning of a line in the password file signify?
- Using the man pages, find the correct ioctl to send console output to an arbitrary pty.
- What is an MX record?
- What is the prom command on a Sun that shows the SCSI devices?
- What is the factory default SCSI target for /dev/sd0?
- Where is that value controlled?
- What happens to a child process that dies and has no parent process to wait for it and what’s bad about this?
- What’s wrong with sendmail? What would you fix?
- What command do you run to check file system consistency?
- What’s wrong with running shutdown on a network?
- What can be wrong with setuid scripts?
- What value does spawn return?
- Write a script to send mail from three other machines on the network to root at the machine you’re on. Use a ‘here doc’, but include in the mail message the name of the machine the mail is sent from and the disk utilization statistics on each machine?
- Why can’t root just cd to someone’s home directory and run a program called a.out sitting there by typing “a.out”, and why is this good?
- What is the difference between UDP and TCP?
- What is DNS?
- What does nslookup do?
- How do you create a swapfile?
- How would you check the route table on a workstation/server?
- How do you find which ypmaster you are bound to?
- How do you fix a problem where a printer will cutoff anything over 1MB?
- What is the largest file system size in solaris? SunOS?
- What are the different RAID levels?
Interview questions for Linux admin
- Advantages/disadvantages of script vs compiled program.
- Name a replacement for PHP/Perl/MySQL/Linux/Apache and show main differences.
- Why have you choosen such a combination of products?
- Differences between two last MySQL versions. Which one would you choose and when/why?
- Main differences between Apache 1.x and 2.x. Why is 2.x not so popular? Which one would you choose and when/why?
- Which Linux distros do you have experience with?
- Which distro you prefer? Why?
- Which tool would you use to update Debian / Slackware / RedHat / Mandrake / SuSE ?
- You’re asked to write an Apache module. What would you do?
- Which tool do you prefer for Apache log reports?
- Your portfolio. (even a PHP guest book may work well)
- What does ‘route’ command do?
- Differences between ipchains and iptables.
- What’s eth0, ppp0, wlan0, ttyS0, etc.
- What are different directories in / for?
- Partitioning scheme for new webserver. Why?
What is SELinux?
Write a command to find all of the files which have been accessed within the last 10 days.
What is LILO?
What is Grub?
Explain the difference between LILO and Grub
What is NFS?
What is NAMED?
What is MySQLD?
What is mysql?
What is CVS?
Why You Shouldn't Use the root Login for everyday work?
Describe the default partition scheme in Redhat Linux?
Describe the default partition scheme in Solaris? What is the slice number?
Describe all default mount point?
What is boot block?
What is logical block?
Describe the process for adding a new hard disk to UNIX box?
Describe the process for adding a new hard disk to Linux box?
Describe the process for adding a new hard disk to Linux LVM to grow /home?
Explain one major difference between a regular file system and a journaling file system?
Define JFS
Define UFS
How do you lock and unlock user account / password?
Describe RPM and command to install / remove / update Linux system?
Explain difference between rpm and up2date command.
Explain difference between rpm and apt-get command.
Explain difference between rpm and yum command.
Describe usage for pkgadd, pkginfo and pkgchk command
How do you find files on UNIX or Linux system?
Explain /etc/rc3.d
Explain ntsysv or chkconfig command
How do you get rid of process if kill PID is not working for you?
What is the purpose of the command?
grep
sed
awk
ifconfig
netstat
df
du
prtvtoc
fdisk -l
umaks
getfacl
setfacl
sudo
fsck
probe-scsi
vmstat
Explain LVM
1) What is a superblock ?
2) What is a parity bit?
3) What is an inod?
4) Explain top command ?
5) How to disable the root login in SSH ?
6) use of sysctl command ?
7) LVM how to ?
Different RAID levels ?
- Why was it that you left the last job that you were at?
- What do you think your top 3 strengths are?
- What is most important to you in a job?
- Major difference between FAT and NTFS on a local machine?
- How many passwords by default are remembered in an active directory?
- What is a C name record (in DNS)?
- What is a LM host file used for?
- Can you name the FSMO roles in active directory?
- What tolls would you use to gage the effect of group policy before using any tools?
- Explain Active Directory sites and services and linked cost routing?
- When would you use circular logging and exchange?
- Exhange related question - as an echange admin if someone asked you how to determine if mail was delivered or not which tool would you use?
- Can you explain how you configurated SMS.
- Rate yourself in 3 different areas (1-5, 5 is expert)
- Difference between layer 2 and layer 3 devices?
- What is VLAN?
- What is the subnet for a class C network?
- Are you familiar with automounter?
- Have you configured an NIS server/client?
- Have your configured a NFS server?
- Windows and Linux interoperability how to?
- What is RAID 1?