Linux Windows Networking Interview Questions Asked 11111

193
1 By having the perfect answer to the Top Ten Linux Interview Questions asked, you can easily ace any Linux Interview. I’ve been working as a Freelance Linux System Administrator for the past seven years. Over all those years, I’ve been in more than a dozen of roles, attended tens of face-to-face interviews and probably close to a hundred of phone interviews. Few painfully obvious things struck me during my time: A) Your encyclopedic knowledge of Linux is far more likely to get you a job than your actual problem solving skills. B) Technical questions asked during phone interviews and even face-to- face interviews tend to be fairly basic. Employers rarely ever go into detailed technical scenarios. C) You will be asked almost the same technical questions at almost all interviews you attend. This means that even if you feel your knowledge of Linux is limited at the moment, make sure to know detailed answers to the following Top Linux Interview Questions and you double your chances of getting the job. You are virtually guaranteed that at least half of the questions asked will sound very similar to the following: 1) What is the difference between TCP and UDP? The basic difference is that TCP establishes a connection before sending data and this allows it to control the dataflow and guarantee that all packets get delivered. UDP simply chucks datagrams onto the wire and if some get lost or arrive in bad order there’s no way to request a resend. However UDP has low network overhead so some services such as DNS resolution, SNMP, DHCP, RIP and VOIP use UDP for its speed and any errors are usually dealt with on the application layer rather than network layer. 2) What is the TCP hand shake? TCP requires three packets to set up a socket connection, before any user data can be sent. This is called the tree way TCP handshake. First the requester sends a SYN packet and expects a SYN-ACK packet, to which the initiator replies with ACK packet plus the first chunk of user data. From there on the TCP connection is established and two sides exchange user data using features such as message acknowledgment, retransmission and timeout. 3) How does DNS resolution work? A client application requests an IP address from the name server usually by connecting to UDP port 53. The name server will attempt to resolve the

description

Most frequently asked linux interview questions

Transcript of Linux Windows Networking Interview Questions Asked 11111

Page 1: Linux Windows Networking Interview Questions Asked 11111

1

By having the perfect answer to the Top Ten Linux Interview Questions asked, you can easily ace any Linux Interview. I’ve been working as a Freelance Linux System Administrator for the past seven years. Over all those years, I’ve been in more than a dozen of roles, attended tens of face-to-face interviews and probably close to a hundred of phone interviews.

Few painfully obvious things struck me during my time:

A) Your encyclopedic knowledge of Linux is far more likely to get you a job than your actual problem solving skills.B) Technical questions asked during phone interviews and even face-to-face interviews tend to be fairly basic. Employers rarely ever go into detailed technical scenarios.C) You will be asked almost the same technical questions at almost all interviews you attend.

This means that even if you feel your knowledge of Linux is limited at the moment, make sure to know detailed answers to the following Top Linux Interview Questions and you double your chances of getting the job.

You are virtually guaranteed that at least half of the questions asked will sound very similar to the following:

1) What is the difference between TCP and UDP?

The basic difference is that TCP establishes a connection before sending data and this allows it to control the dataflow and guarantee that all packets get delivered. UDP simply chucks datagrams onto the wire and if some get lost or arrive in bad order there’s no way to request a resend. However UDP has low network overhead so some services such as DNS resolution, SNMP, DHCP, RIP and VOIP use UDP for its speed and any errors are usually dealt with on the application layer rather than network layer.

2) What is the TCP hand shake?

TCP requires three packets to set up a socket connection, before any user data can be sent. This is called the tree way TCP handshake. First the requester sends a SYN packet and expects a SYN-ACK packet, to which the initiator replies with ACK packet plus the first chunk of user data. From there on the TCP connection is established and two sides exchange user data using features such as message acknowledgment, retransmission and timeout.

3) How does DNS resolution work?

A client application requests an IP address from the name server usually by connecting to UDP port 53. The name server will attempt to resolve the FQDN based on its resolver library, which may contain authoritative information about the host requested or cached data about that name from an earlier query. If the name server does not already have the answer, it will turn to root name servers to determine the authoritative for the FQDN in question. Then, with that information, it will query the authoritative name servers for that name to determine the IP address.

4) What is an MX record?

MX record numerically ranks the mail servers you would prefer to receive email for a domain. The MX record with the lowest number is preferred over the others, but you can set multiple email servers with the same value for simple load balancing.

5) Describe Linux boot-up sequence

Page 2: Linux Windows Networking Interview Questions Asked 11111

2

BIOS reads the MBR where Boot Loader sits, Boot Loader reads Kernel into memory, Kernel starts Init process, Init reads inittab, executes rc.sysinit, the rc script than starts services to reach the default run level and once this is done the last thing that gets run is the rc.local script.

6) What is an INODE?

All files have its description stored in a structure called ‘inode’. The inode contains info about the file-size, access and modification time, permission and so on. In addition to descriptions about the file, the inode contains pointers to the data blocks of the file.

7) How do you search for a pattern and than replace it in an entire file?

Using Sed or in Vi editor the search usually involves character ‘s’ slash the pattern to be searched, slash the pattern to replace it with, slash ‘g’ which stands for entire file.

8) How do you list and flush all IPtables?

Using the iptables command with –L switch first to see all the rules currently present in memory and than –F to flush them.

9) How do you list compiled-in Apache modules?

Run the httpd daemon as a command with –l parameter.

10) What is a zombie?

Zombie processes can be identified in the output of ‘ps’ by the presence of ‘Z’ in the STAT column. Zombies are child processes whose parent process died without reaping its children. Zombies can’t be killed with the usual KILL signal.

So… there you go. This is the technical part of your Linux interview handled. Don’t ask me why but these are the top most repeated Linux questions at interviews. If it is recruiters lack of creativity or laziness. It is simply a fact.

What command can you use to review boot messages?

The dmesg command displays the system messages contained in the kernel ring buffer. By using this command immediately after booting your computer, you will see the boot messages.

root@server root]#cd /var/logroot@server log]#cat messagesif u wanna to check for that particular user u can do like root@server log]#cat messages |grep username

HOW CAN YOU SPY OTHER USERS KEYSTRIKES?Feb-21-2011 By nonova

ps aux | grep pts | grep “\-bash” | grep -v grep

root 30562 0.0 0.1 4136 1356 pts/0 S 09:59 0:00 -bashroot 30648 0.0 0.1 4140 1388 pts/2 R 10:45 0:00 -bash

strace -f -p 30648 2>&1 | egrep “read|recv|write|send|exec|socket|connect”

Page 3: Linux Windows Networking Interview Questions Asked 11111

3

this will show you every keystrike which user does, and all answers whichhe recieves on terminal, INCLUDING PASSWORDS

Posted in: Uncategorized, Unix-fu (complex shell commands)ADD COMMENTSHow do you unpack all files in an RPM?Feb-21-2011 By nonova

# rpm2cpio foo.rpm | cpio -idmv –no-absolute-filenames

Posted in: RPM, Unix-fu (complex shell commands)ADD COMMENTSHow do you compare files using remote CPU cycles?Feb-21-2011 By nonova

# ssh target_address cat remotefile | diff – localfile

How do you secure /etc/services?Mar-14-2011 By nonova

Service definitions are provided in the /etc/services file. For readability, it is recommended that you use the service names rather than the port numbers.

Secure the /etc/services file to prevent unauthorized editing. If this file is editable, crackers can use it to enable ports on your machine you have otherwise closed. To secure this file, type the following commands as root:

[root@myServer ~]# chown root.root /etc/services[root@myServer ~]# chmod 0644 /etc/services[root@myServer ~]# chattr +i /etc/servicesThis prevents the file from being renamed, deleted or having links made to it.

Posted in: SecurityADD COMMENTSYou are root but you are still unable to delete a file. Why?Mar-14-2011 By nonova

The immutable attribute is set up!

rm -f /etc/inittabrm: cannot remove ‘/etc/inittab’: Operation not permited

lsattr /etc/inittab—-i——- /etc/inittab

chattr -i /etc/inittab

Posted in: Filesystems & SAN, SecurityADD COMMENTSWhat files should you usually change attributes for?Mar-14-2011 By nonova

When configuring systems which will be directly exposed to the Internet or other hostile environments and which must host shell accounts or services such as HTTP and FTP, I usually

Page 4: Linux Windows Networking Interview Questions Asked 11111

4

add the append-only and immutable flags once I have installed and configured all necessary software and user accounts:

chattr -R +i /bin /boot /etc /lib /sbinchattr -R +i /usr/bin /usr/include /usr/lib /usr/sbinchattr +a /var/log/messages /var/log/securechattr -R +i /usr

Posted in: Filesystems & SAN, SecurityADD COMMENTSWhat Are the CLI user tools?Mar-14-2011 By nonova

gpasswd – method of administering the /etc/group filepwck, grpck – tools used for the verification of the password, group, and associated shadow filespwconv, pwuconv – tools used for the conversion of passwords to shadow passwords and back to standard passwords.

Posted in: SecurityADD COMMENTSHow do you add a completely unprivileged user for ftp?Mar-14-2011 By nonova

useradd –d /var/www/html/ -n –M –s /dev/null ftpsecure

Posted in: SecurityADD COMMENTSWhat is the Post-installation Security that you apply straight after first boot?Mar-14-2011 By nonova

IP tablesExt2/3/4 Filesystem AttributesSElinuxKdumpNTP – Date and Time

Posted in: SecurityADD COMMENTSWhat are the first commands you type when you root login to a new built box right after first boot?Mar-14-2011 By nonova

uptimeuname -acat /etc/redhat-releaseecho “PermitRootLogin no” >> /etc/ssh/sshd_config/etc/init.d/sshd reloaduseradd passwd cat /etc/procinfofree –mdf -hnetstat -natupiptables -Lgetenforceyum list available

Page 5: Linux Windows Networking Interview Questions Asked 11111

5

Posted in: SecurityADD COMMENTSWhat is the difference between “SU” and “SU –“?Mar-3-2011 By nonova

su only changes to root permissions, su – (with the “-“) changes the environment (variables) to root.

Posted in: SecurityADD COMMENTSHow do you change the selinux context of a file to its default context?Mar-2-2011 By nonova

restorecon

Posted in: SecurityADD COMMENTSHow do you check to see if SELinux is in ‘enforcing’ mode?Mar-2-2011 By nonova

getenforce

Does RPM maintain logs of all installs and removalsJul-14-2011 By nonova

No, but you can view the last changes to rpm database by running:

rpm -qa –last

Posted in: RPMADD COMMENTSWhat is the rpm –-showrc?Apr-5-2011 By nonova

RPM provides a configuration file for specifying frequently used options. The default global configuration file is usually /usr/lib/rpm/rpmrc, the local system configuration file is /etc/rpmrc, and users can set up their own $HOME/.rpmrc files. You can use the –showrc option to show the values RPM will use by default for all the options that may be set in an rpmrc file.

Posted in: RPMADD COMMENTSWhere can you find the specs file in an installed binary rpm?Apr-5-2011 By nonova

If you download the source rpm

Posted in: RPMADD COMMENTSWhat are Trigger scriptlets in Rpmbuild?Apr-5-2011 By nonova

Trigger scriptlets are extensions of the normal install and uninstall scripts. They provide for interaction between packages. A trigger scriptlet provided with one package will be triggered to run by the installation or removal of some other package. For example, a newly installed RPM package may cause an existing application to run or restart once installation is complete. In many cases, a newly installed package requires services to be restarted.

Page 6: Linux Windows Networking Interview Questions Asked 11111

6

Posted in: RPMADD COMMENTSWhat are Scripts in Rpmbuild?Apr-5-2011 By nonova

Scripts are used to control the build process. Some of the scripts RPM uses include %prep to begin the build process, %build primarily to run make and perhaps do some configuration, %install to do a make install and %clean to clean up afterward. Four additional scripts may be created to run when a package is actually installed on a system. These scripts are %pre for scripts run before package installation, %post for scripts run after package installa- tion, %preun for scripts run before a package is uninstalled, and %postun for scripts run after a package is uninstalled.

Posted in: RPMADD COMMENTSWath are Macros in Rpmbuild?Apr-5-2011 By nonova

Macros are sequences of commands stored together and executed by invoking the macro name. The RPM build process provides two standard macros: %setup to unpack the original sources and %patch to apply patches. Other macros appear later in this chapter in the command descriptions and are described there.

Posted in: RPMADD COMMENTSIs there a limitation on the rpm size in RHEL5?Mar-14-2011 By nonova

Yes, RHEL5 rpm cannot archive files greater than 2GB with current cpio component:

RPM build errors: Package too large (> 2147483647 bytes)

Posted in: RPMADD COMMENTSHow do you Create a patch file for rpmbuildMar-14-2011 By nonova

diff -uNr package-1.0/ package-1.0.orig/ > ../SOURCES/package-1.0-my.patch

Posted in: RPMADD COMMENTSDoes Rpm –U skip the pre/post scripts?Mar-2-2011 By nonova

No it does exactly the same thing as –e and than -i

Posted in: RPMADD COMMENTSWhich RPMs require reboot?Mar-2-2011 By nonova

* kernel: Obviously a reboot is required to boot into the new kernel* glibc: You would want to reboot after updating this package in order to ensure that all changes have been applied* hal/udev: RH typically recommend a reboot after these since they control how devices are set up and enabled on the system. If there are changes to either of these, a reboot will ensure that everything gets set up according to the new contents of the packages.

Page 7: Linux Windows Networking Interview Questions Asked 11111

7

How do you list all the loaded Apache modules?Mar-13-2011 By nonova

You can use the following command to list all the loaded modules in apache (both DSO and Static)

apachectl -t -D DUMP_MODULES

In apache 2.2.x, you can also use httpd -M to list all the loaded modules ( both static and DSO )

Posted in: NetworkingADD COMMENTSHow much throughput you get from 10GbE?Mar-3-2011 By nonova

A 100mbps lan connection will have a max of 12.5 Meg/sec transfer rate. But depending on you router you may have less. A gig lan max is 125Meg/sec, but depending on you HD you will get less. Most 7200 rpm drive are around 50-60 meg/sec. If you have 5400rpm drive its around 25-30.

Posted in: NetworkingADD COMMENTSHow do you configure a firewall to allow NFS?Mar-2-2011 By nonova

o configure a firewall to allow NFS:

1. Allow TCP and UDP port 2049 for NFS.

2. Allow TCP and UDP port 111 (portmap/sunrpc).

Allow ports specified in /etc/sysconfig/nfs

3. Allow the TCP and UDP port specified with MOUNTD_PORT=”x”

4. Allow the TCP and UDP port specified with STATD_PORT=”x”

5. Allow the TCP port specified with LOCKD_TCPPORT=”x”

6. Allow the UDP port specified with LOCKD_UDPPORT=”x”

Posted in: NetworkingADD COMMENTSWhat is /etc/sysconfig/nfs good for?Mar-2-2011 By nonova

NFS requires the portmap, which dynamically assigns ports for RPC services. This causes problems for configuring firewall rules. To overcome this problem, use the /etc/sysconfig/nfs file to control which ports the required RPC services run on.

Posted in: NetworkingADD COMMENTSWhich command would persistently enable routing in the kernel?Mar-2-2011 By nonova

Add the following line to the /etc/sysctl.conf file: net.ipv4.ip_forward = 1

Posted in: Networking

Page 8: Linux Windows Networking Interview Questions Asked 11111

8

ADD COMMENTSHow do define a routing table persistent across boots?Mar-2-2011 By nonova

using the GATEWAY parameter in /etc/sysconfig/network for the default gateway and than in /etc/sysconfig/network-scripts/ifcfg-eth for each other route you want to add.

Posted in: NetworkingADD COMMENTSTo assign a persistent machine hostname to a machine, which file do you add or modify?Mar-2-2011 By nonova

/etc/sysconfig/network

Posted in: NetworkingADD COMMENTSWhat is The SSL Handshake?Feb-18-2011 By nonova

1) Client issues secure session request

2) Server sends x.509 certificate containing server’s public key

3) Client authenticates certificate against list of known CAs (if CA is unknown, like at the very first instance of a connection, browser can give user option to accept certificate at user’s risk)

4) Client generates random symmetric key and encrypts it using server’s public key

5) Client and server now both know the symmetric key and use it for encryption of end-user data

Posted in: NetworkingADD COMMENTSWhat is the TCP hand shake?Feb-18-2011 By nonova

To establish a connection, TCP uses a 3-way handshake.

The “three-way handshake” happens thus. The originator sends an initial packet called a “SYN” to establish communication and “synchronize” sequence numbers in counting bytes of data which will be exchanged. The destination then sends a “SYN/ACK” which again “synchronizes” his byte count with the originator and acknowledges the initial packet. The originator then returns an “ACK” which acknowledges the packet the destination just sent him. The connection is now “OPEN” and ongoing communication between the originator and the destination are permitted until one of them issues a “FIN” packet, or a “RST” packet, or the connection times out.

1) Client sends SYN packet to the server2) Server responds with SYN + ACK packet3) Client sends back ACK + data that it requested at the first place

Posted in: NetworkingADD COMMENTSWhat does httpd status do?Feb-18-2011 By nonova

works only if mod_status is enabled and shows a page of active connections

Page 9: Linux Windows Networking Interview Questions Asked 11111

9

How do you read the parameters of a loaded kernel module?Apr-6-2011 By nonova

The command “modinfo -p ${modulename}” reads a list of all parameters from the .ko file. Loadable modules, after being loaded into the running kernel, also reveal their parameters in /sys/module/${modulename}/parameters/. Some of these can be changed at runtime by echoing the value into the sysfs file.

Posted in: KernelADD COMMENTSHow can you trap/ignore a signal in bash?Apr-5-2011 By nonova

When a SIGINT is sent via CTRL+C or CTRL+BREAK, the handler is called that will handle the signal. However you can trap it with ‘trap’ command.

You can view all signals being trapped with stty -a

Posted in: KernelADD COMMENTSIs Blocking a signal similar to Ignoring a signal ?Apr-5-2011 By nonova

No, blocking a signal is different from ignoring a signal. When a process blocks a signal, the operating system does not deliver the signal until the process unblocks the signal. A process blocks a signal by modifying its signal mask with sigprocmask. Signals may be blocked to allow critical sections of code to run without interruption. But when a process ignores a signal, the signal is delivered and the process handles it by throwing it away if setting their actions to SIG_IGN.

Posted in: KernelADD COMMENTSWhat is ram disk?Apr-5-2011 By nonova

If your root filesystem is on a device whose driver is a module (as is frequently true of SCSI disks), you can use the initrd facility, which provides a two-stage boot process, to first set up a temporary root filesystem in a RAM disk containing the modules you need to add (e.g., the SCSI driver) and then load the modules and mount the real root file- system. The RAM disk containing the temporary filesystem is the special device file /dev/initrd.

Posted in: KernelADD COMMENTSWhat is slabinfo?Apr-5-2011 By nonova

Frequently used objects in the Linux kernel (buffer heads, inodes, dentries, etc.) have their own cache. The file /proc/slabinfo gives statistics.

Posted in: KernelADD COMMENTSHow SystemTap doesn’t work?Mar-14-2011 By nonova

good laugh from dtrace developers

http://dtrace.org/blogs/ahl/2007/08/02/dtrace-knockoffs/

Page 10: Linux Windows Networking Interview Questions Asked 11111

10

Posted in: KernelADD COMMENTSHow SystemTap works?Mar-14-2011 By nonova

It is a wrapper around gcc and kprobes.

kprobes is an unsafe, policy-free kernel instrumentation facility. You can redirect execution from any instruction pointer in the kernel to any other one. In practice, it is hard to use raw kprobes to do much other than panic your kernel; the interdependencies, layering, ordering restrictions, etc. in the kernel are too subtle to use it for the things you’d fantasize about (I/O interposition, say). It makes no effort to prevent instrumenting the parts of the kernel that it itself relies on, and last I checked, makes no effort to prevent “instrumenting” an offset that is not an instruction boundary, breaking your running kernel.

SystemTap translates your script into source for a C kernel module, compiles and loads the module, and uses kprobes to intercept the points you’ve asked for. Unlike raw kprobes, the facilities available to a systemtap script were selected to be somewhat safe, and they will be familiar to someone familiar with DTrace. No strong guarantees of safety or forward progress are made, though; if you try to fuzz-test systemtap, your system will panic or hang.

In my limited experience, systemtap captures a surprisingly high percentage of the use cases of its inspiration, Solaris’s more safe and powerful DTrace. I have accidentally panicked kernels in production with non-guru stap scripts, so use with some care; but on the whole, an imperfect something has been much better than nothing.

Posted in: KernelADD COMMENTSWhat do you need to run SystemTap?Mar-14-2011 By nonova

If you have no kernel debug image package installed, systemtap won’t work as expetced. It should require or at least recommend installing a linux-debug dependency for the running kernel.

Another issue I experienced is that systemtap is not looking at the right kernel debug file, event if you have it installed. I had to manually create a symbolic link from /boot/vmlinux-2.6.20-15-generic pointing to /boot/vmlinux-dbg-2.6.20-15-generic.

If, for some reason, you can’t obtain the debug-information for your kernel, you can still use systemtap for certain tasks – tracing function calls and returns, in particular.

Posted in: KernelADD COMMENTSHow do you track SIGPIPE?Mar-14-2011 By nonova

You should be able to track the origin of any signal with SystemTap and the sigmon.stp script: http://sourceware.org

/systemtap/examples/process/sigmon.stp

Basically, you need to install systemtap, kernel-debuginfo and kernel-devel matching the kernel version you are running and run sigmon.stp like this:

# stap -x PID_OF_RECEIVINGPROCESS sigmon.stp SIGPIPE

Page 11: Linux Windows Networking Interview Questions Asked 11111

11

Posted in: KernelADD COMMENTSHOW DO YOU SEND A PROCESS SEGMENTATION FAULT SIGNAL?Mar-3-2011 By nonova

You may need this to generate core file, the signal is number 11.

What 10GbE card would you recommend on RHEL5.5?Mar-14-2011 By nonova

10GbE is still quite new and quirky. The card of choice really depends on the intended way of use.

Do we need FCoE?Do we need RDMA?Do we need low latency, but don’t care as much about bandwidth?Do we need high bandwidth and lowest possible latency?

Personally, I wouldn’t recommend nc522sfp, they had been failing to meet their on specs and nc550sfp has come to replace them.

Intel X520-da2 with RHEL5.5 built-in ixgbe driver has been reported to show decent results by users and seems to be a good choice.

Posted in: HardwareADD COMMENTSHow to tell CPU temp If your machine uses ACPI?Feb-18-2011 By nonova

cat /proc/acpi/thermal_zone/THM0/temperature

Posted in: Hardware, KernelADD COMMENTSWhat is physical and core id?Feb-18-2011 By nonova

CPU attributes in /proc/cpuinfo

let you figure out which CPU core is on which chip.

How do you prevent Anaconda from seeing SAN volumes?Jul-14-2011 By nonova

The problem with Anaconda is that the first disk it sees it assumes should be the disk internal to the box.

Or if you are in rescue mode it won’t let you skip all those bazillions of scsi block devices it finds and you end up punching return for the rest of the day.

There’s an undocumented boot option “nostorage driverload=sd_mod:cciss” that avoids all drivers marked as ‘storage’ and starts without them. In addition ‘driverload’ lets you manually specify the drivers you do want to load. So leave HBAs alone but force the built-in RAID controller.

Posted in: Filesystems & SANADD COMMENTSWHAT in gods name is IOtop?Mar-14-2011 By nonova

Page 12: Linux Windows Networking Interview Questions Asked 11111

12

Iotop is a Python program with a top like UI used to show of behalf of which process is the I/O going on. It requires Python ≥ 2.5 (or Python ≥ 2.4 with the ctypes module) and a Linux kernel ≥ 2.6.20 with the TASK_DELAY_ACCT, CONFIG_TASKSTATS, TASK_IO_ACCOUNTING and CONFIG_VM_EVENT_COUNTERS options on.

Posted in: Filesystems & SANADD COMMENTSHow does the I/O scheduler work on Linux?Mar-14-2011 By nonova

best desc I found so far

http://www.linuxjournal.com/article/6931?page=0,0

Posted in: Filesystems & SANADD COMMENTSHow do measure I/O with vmstat?Mar-14-2011 By nonova

the bi and bo columns of the vmstat 1 command.

Posted in: Filesystems & SANADD COMMENTSYou are root but you are still unable to delete a file. Why?Mar-14-2011 By nonova

The immutable attribute is set up!

rm -f /etc/inittabrm: cannot remove ‘/etc/inittab’: Operation not permited

lsattr /etc/inittab—-i——- /etc/inittab

chattr -i /etc/inittab

Posted in: Filesystems & SAN, SecurityADD COMMENTSWhat files should you usually change attributes for?Mar-14-2011 By nonova

When configuring systems which will be directly exposed to the Internet or other hostile environments and which must host shell accounts or services such as HTTP and FTP, I usually add the append-only and immutable flags once I have installed and configured all necessary software and user accounts:

chattr -R +i /bin /boot /etc /lib /sbinchattr -R +i /usr/bin /usr/include /usr/lib /usr/sbinchattr +a /var/log/messages /var/log/securechattr -R +i /usr

Posted in: Filesystems & SAN, SecurityADD COMMENTSWhat are the ext2/ext3 extended attributes?Mar-14-2011 By nonova

Page 13: Linux Windows Networking Interview Questions Asked 11111

13

Ext2 attributes are checked and honored by various system calls such as sys_open() and sys_truncate() without regard to uid or any other influence. It allows you to easily and effectively curtail the absolute power traditionally afforded to processes with uid 0. Because the a and i attributes are enforced without regard to permissions or privilege level, they can serve as an effective under-layment of defense against the exploitation of any privileged processes which may contain undisclosed or unpatched vulnerabilities.

Posted in: Filesystems & SANADD COMMENTSCan you have /boot partition on an LVM?Mar-14-2011 By nonova

The /boot/ partition cannot reside on an LVM volume because the GRUB boot loader cannot read it.

Posted in: Filesystems & SANADD COMMENTSHow do you Check raid status?Mar-14-2011 By nonova

mdadm –detail /dev/md0cat /proc/mdstat

Posted in: Filesystems & SANADD COMMENTSHow do you Stop array?Mar-14-2011 By nonova

mdadm –stop /dev/md0

What is an MX record?Feb-6-2011 By nonova

MX record allows you to numerically rank the email servers you would prefer to receive email for this namespace, giving preference to some email systems over others. The MX resource record with the lowest is preferred over the others, but you can set multiple email servers with the same value to distribute email traffic between them.

IN MX 10 mail.domain.com.IN MX 20 mail2.domain.com.

Posted in: DNSADD COMMENTSWhat are ZONE files?Feb-6-2011 By nonova

Zone files contain information about a particular namespace. Zone files are stored in /var/named working directory. Each zone file is named according to the file option data in the zone statement, usually in a way that relates to the domain in question and identifies the file as containing zone data, such as example.com.zone.

Each zone file may contain directives and resource records. Directives tell the nameserver to do a certain thing or apply a special setting to the zone. Resource records define the parameters of the zone, assigning an identity within the zone’s namespace to particular systems. Directives are optional, but resource records are required to provide nameservice to that zone. All directives and resource records should go on their own lines.

Page 14: Linux Windows Networking Interview Questions Asked 11111

14

$ vi /var/named/zones/llc.com.db

llc.com. IN SOA dns1.llc.com. root.dns1.llc.com. (001 ; serial1H ; refresh15M ; retry1W ; expiry1H ; ttl)

@ IN NS dns1

dns1 IN A 192.168.2.5@ IN A 192.168.2.5

www IN CNAME dns1

redhat.llc.com. IN NS dns1.redhat.llc.com.dns1.redhat.llc.com. IN A 192.168.2.10

$ vi /var/named/zones/2.168.192.db

llc.com. IN SOA dns1.llc.com. root.dns1.llc.com. (001 ; serial1H ; refresh15M ; retry1W ; expiry1H ; ttl)

@ IN NS dns15 IN PTR dns1.llc.com.

Posted in: DNSADD COMMENTSWhat is FQDN and a secondary nameserver?Feb-6-2011 By nonova

FQDN of a host can be broken down into sections organized in a tree hierarchy. Except for the hostname, every section divided by “.” is a called a zone.

Zones are defined on authoritative nameservers in zone files. Zone files are stored on primary nameservers(also called master nameservers), which are truly authoritative and where changes are made to the files.

Secondary nameservers (also called slave nameservers) receive their zone files from the primary nameservers. Any nameserver can be a primary and secondary nameserver for different zones at the same time, and they may also be considered authoritative for multiple zones. It all depends on the nameserver’s particular configuration.

Every second level domain should have one primary and one secondary nameserver running on different physical machines for redundancy.

There are four nameserver configuration types:

Page 15: Linux Windows Networking Interview Questions Asked 11111

15

master — Stores original and authoritative zone records for a certain zone, answering questions from other nameservers searching for answers concerning that namespace.

slave — Also answers queries from other nameservers concerning namespaces for which it is considered an authority. However, slave nameservers get their namespace information from master nameservers via azone transfer, where the slave sends the master a NOTIFY request for a particular zone and the master responds with the information, if the slave is authorized to receive the transfer.

caching-only — Offers name to IP resolution services but is not authoritative for any zones. Answers for all resolutions are usually cached in a database stored in memory for a fixed period of time, usually specified by the retrieved zone record, for quicker resolution for other DNS clients after the first resolution.

forwarding — Forwards requests to a specific list of nameservers to be resolved. If none of the specified nameservers can perform the resolution, the process stops and the resolution fails.

Posted in: DNSADD COMMENTSHow DNS resolution works?Feb-6-2011 By nonova

A client application requests an IP address from the nameserver usually by connecting to UDP port 53. The nameserver will attempt to resolve the FQDN based on its resolver library, which may contain authoritative information about the host requested or cached data about that name from an earlier query.

If the nameserver does not already have the answer in its resolver library, it will turn to root nameservers, to determine which nameservers are authoritative for the FQDN in question. Then, with that information, it will query the authoritative nameservers for that name to determine the IP address.

When was RHEL5 first released? How about RHEL5.5 and RHEL5.6?Mar-14-2011 By nonova

RHEL5 was released in 20075.5 went out in March 2010and 5.6 in Jen 2011-03-04

Posted in: DistributionsADD COMMENTSWhen was RHEL4.9 released?Mar-14-2011 By nonova

Red Hat Enterprise Linux 4 platform, first released in 2005, now transitions into its third lifecycle phase – Production 3. During the Production 3 phase, systems continue to receive security and bug fixes, but the introduction of new features and hardware support, which is provided in earlier phases, ceases.

Posted in: DistributionsADD COMMENTSIs SSSD available in RHEL5?Mar-14-2011 By nonova

The SSSD package has been back ported into RHEL 5.6 and is fully supported.

Page 16: Linux Windows Networking Interview Questions Asked 11111

16

Posted in: Distributions, UncategorizedADD COMMENTSWhat are the RHEL6 main FEATURES?Mar-3-2011 By nonova

2.6.32 kernelCPU and mem hot pluggableExt4Physical mem from 1TB to 2TB on x86_64Better virtualization performanceBetter memory allocationComprehensive IPv6 supportGCC 4.4OpenJDK 6Tomcat 6PHP 5.3.2Perl 5.10.1PostgreSQL 8.4.4MySQL 5.1.47SQLite 3.6.20

Posted in: DistributionsADD COMMENTSWhen is the RHEL5 EOL?Mar-3-2011 By nonova

RHEL5 was released in 2007. This is a quick sum up of RHEL5 Life Cycle as confirmed by Red Hat

The life cycle concerns major versions: RHEL4, RHEL5, RHEL6, etc. released every 3-4 years on average. Security patches, bug fixes or feature enhancements are delivered via individual updates known as “Errata Advisories” released on an as-needed basis.

Once the amount of Errata reaches certain point a minor release (effectively a service pack) goes out e.g. RHEL5.6

Service Packs are cumulative thus including the contents of previously released updates.

Errata is incremental which means that with the release of say a bug-fix for RHEL5.5 the exact same bug-fix is made available for 5.1, 5.2, 5.3 and 5.4.

The life cycle for every major release is 7 years split into three phases:

4 years of Production 11 year of Production 22 years of Production 3

Production 1 of RHEL 5 will end in Q4 of 2011 calendar year. Descriptions of Production Phase 1 and 2 are very similar, and the major difference for phase 2 is that “New software functionality is not available during this phase”. So if Red Hat come out with a new layered product or major feature, it would likely not be back ported to this release and would only be available in the newer version (RHEL6).

Right now there is no definitive date set for 5.7, so unfortunately the best I can say is to expect it between July and October. It *appears* that Production Phase 1 will end with 5.8

Page 17: Linux Windows Networking Interview Questions Asked 11111

17

Phase 2 is concluded by final, bugfix-only minor release, which I assume is going to be probably 5.9;Through production phase 3, the same level of attention is given to urgent issues however there will be no hardware enablement, new features, or new installation media or minor updates.

RHEL5 is supported until 2014 after which you can buy optional 3 year legacy extension.

Posted in: DistributionsADD COMMENTSWhat is the difference between RHEL and Fedora?Feb-21-2011 By nonova

RHEL is a product. Fedora is a project.

In 2002 Red Hat created Red Hat Enterprise Linux. Stable, supported, certified.

The Fedora Project was introduced in late 2003. Built with the help of the open source community, the Fedora Project is for developers and high-tech enthusiasts using Linux in non-critical computing environments.

Release interval for for RHEL is aprrox 18 months, Fedora 6 months. Fedora is tested by the open source community – RHEL claim to have extensive beta teat and external partners.

Both distributions can be downloaded for free (CentOS as a community branded version of RHEL with no support), however support such as bugfixes and new features are free with Fedora. For RHEL you have to buy subscriptions for your servers.

With RHEL subscription you also get phone support and TAM who will be able to help investigate support cases you log with Red Hat.

Posted in: DistributionsADD COMMENTSWho is Mark Shuttleworth?Feb-18-2011 By nonova

- The founder of the Ubuntu Project.- An African entrepreneur with a love of technology, innovation, change and space flight.

Studied finance and information technology at the University of Cape Town. In April 2002 flew in space, as a cosmonaut member of the crew of Soyuz mission TM34 to the International Space Station.

Posted in: DistributionsADD COMMENTSWhat is diff in SLES10 and RHEL5 kernels?Feb-11-2011 By nonova

rhel5 is on 2.6.18, sles10 is 2.6.16,

but even if they were the same numbers they would haveliterally dozens and dozens of differences in the build options and additional vendorspecific patches.

Posted in: DistributionsADD COMMENTSWhat is the difference between Debian and Ubuntu?

Page 18: Linux Windows Networking Interview Questions Asked 11111

18

Jan-22-2011 By nonova

Essentially, Ubuntu is a frozen version of Debian Unstable. It’s being maintained by a separate Ubuntu team.

It is much more user friendly than Debian but it also has its limitations (apparently, there is a lack of compatibility with Debian packages).

For home system, if you want a more complete out-of-the-box gui setup (either gnome or kde), more regular releases, and more current software versions, then ubuntu is a far better choice.

For Enterprise systems, obviously, Debian is the way to go.

It is more or less true that latest Ubuntu = Debian testing + fancy wallpapers. Most of the packages Ubuntu team takes directly from Debian, with very rare exceptions. Ubuntu refuses to fix bugs if you submit a bugreport, the best they do — is forwarding it to debian and waiting until debian fixes it (sometimes the fix is trivial, but they don’t really have resources to maintain a truely separate distro).

Debian has a very slow release cycle, and slower support for hardware, but stable packages. Ubuntu releases every 6 months, and uses bleeding edge software out-of-the-box.

But than again Ubuntu is 95% dependent on Debian and takes almost everything from sid/testing branch. Yes, “Debian stable” is slow to release, but sid/testing has newer packages than latest Ubuntu and testing is no less stable than Ubuntu.

What does “mysqladmin processlist” normally do?Feb-18-2011 By nonova

Shows active mysql connections and queries

Posted in: DatabasesADD COMMENTSHow do you create/drop a mysql database?Feb-18-2011 By nonova

Drop/delete the selected database:

# mysqladmin drop databasenamehere

Creates a mysql database:

# mysqladmin create databasenamehere

Posted in: DatabasesADD COMMENTSHow do you make a backup copy of entire mysql database?Feb-18-2011 By nonova

mysqldump -u username -p password databasename > databasefile.sql

Posted in: DatabasesADD COMMENTSWhat is Oracle SGA and how do you tell it’s size?Feb-11-2011 By nonova

Page 19: Linux Windows Networking Interview Questions Asked 11111

19

The SGA (System Global Area) is an area of memory shared by Oracle processes allocated whenan Oracle Instance starts up. The size of the SGA has a significant impact to Oracle’s performancesince it contains database buffer cache and more.

Shared memory is exactly that – a memory region that can shared between different processes. Oracle uses shared memory for implementing the SGA, which needs to be visible to all database sessions.

SQL> SHOW SGATotal System Global Area 143421172 bytesFixed Size 282356 bytesVariable Size 117440512 bytesDatabase Buffers 25165824 bytesRedo Buffers 532480 bytes

Posted in: DatabasesADD COMMENTSWhat is ODBC driver?Jan-9-2011 By nonova

UnixODBC is Open Database Connectivity (ODBC) – a standard software API specification for using database management systems (DBMS). The ODBC API is a library of ODBC functions that let ODBC-enabled applications connect to any database for which an ODBC driver is available, execute SQL statements, and retrieve results.

The goal of ODBC is to make it possible to access any data from any application, regardless of which database management system (DBMS) is handling the data.

Linux admin interview questionsBy admin | March 4, 2005

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?

Page 20: Linux Windows Networking Interview Questions Asked 11111

20

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?30.I had a phone interview with google for SRE position. These are the questions

they asked:31.- Difference between a Router/Hub/Switch? Explain the process when a packet

leaves a host and travels to another host, on same network/different networks. What happens if the host doesnt exist, what does the switch/router/hub do? Where do consecutive requests go? (cache)

32.- Explain how traceroute works (explain incrementing the TTL field)33.- Explain the exec / fork process. How do you get the return value of a child

that died (i.e. structure returned from waitpid() and wait())34.- Explain what the load average is (a: the number of processes averaged over 1,

5 and 15 minutes that are marked as: R, S, D); where does ‘uptime’ get this information from?

35.Quick: name the last time you used a sticky bit, manually changed run levels or needed to know the OSI layers for anything other than a pop quiz?

36.Also, I’m starting to think that when HR comes to one of their techs and says “hey we need some pre-screening questions?” they just google this site from stupid crap to ask. :)

37.Anyway, after bombing the interview I decided that I better bone up on any academic stuff.

38.They asked the difference between UDP/TCP question and some others not here yet:

39.q: Is DNS tcp or UDP?a: UDP by default, but can use both.

40.q: How do you know what run level you are in?a: Type: runlevel

41.q: How do you switch run levels?a: telinit RUNLEVELi.e.: telinit 1

42.DNS (Domian name server )43.DNS resolves hostname to IP address (forward lookup),

resolves IP address to hostname (reverse lookup), it allows machines to logically grouped by name domain, provides email routing.

44.DNS port: 53dameon: named

45.1) In sh use the read command:read varecho $var2) Assuming the filenames are in filenames.txt:sed -ie ’s/\\/\//g’ filenames.txt

Page 21: Linux Windows Networking Interview Questions Asked 11111

21

3) s/f.*a[0-9]\+n/UNIX/5) Assuming you can’t use tac:while read line; doi=$(( i + 1))lines[i]=$linedone

46.numlines=${#numlines}for i in `seq $numlines -1 1`; doecho ${lines[i]}done

47.13) If it has no parent process (ie the parent has already gone away), then it will be adopted by init which will perform a wait to obtain the processes return value. If the parent just doesn’t care, then the process becomes a zombie, which is only bad in that it takes space in your process table.

48.15) fsck

Basic sed tricksBy admin | January 12, 2009

1. What is sed? - sed is stream editor, a Unix tool for working with streams of text data. See the awful truth about sed.

2. How do you substitute strings with sed? - Use ’s/old/new’ command, so sed ’s/hello/goodbye/’ would substitute the occurrence of the word hello to goodbye.

3. How do you inject text with sed? - & in the substitution string defines the pattern found in the search string. As an example, here’s us trying to find a word ‘hello’ and replacing it with ‘hello and how are you’:     echo ‘hello there’ | sed ’s/^hello/& and how are you/’

4. Can I find several patterns and refer to them in the replacement string? - Yes, use (pattern) and then refer to your patterns as \1, \2, \3 and so on.

5. If the string is ‘old old old’ and I run ’s/old/new’, I get ‘new old old’ as the result. I need ‘new new new‘. - You forgot the global modifier, which would replace every occurrence of the pattern with the substitution. ’s/old/new/g‘ will work.

6. But I want ‘old old new’ from the previous example. - Just use the numeric modifier saying you want the third occurrence to be replaced. ’s/old/new/3‘ will work.

7. I wrote a rather complex sed script. How do I save and run it? - Assuming that your file is named myscript1.sed, you can invoke sed -f myscript1.sed.

8. How do I delete trailing whitespaces from each line? - sed ’s/[ \t]*$//’ Here we’re replacing any occurrence of a space or a tab with nothing. Check sed one-liners for more examples.

9. How do you print just a few first lines of the file? - sed 1q will give you just the first line, sed 10q the first 10 lines.

10.How do you replace a pattern only if it’s found, so that it’s executed faster? - Nest the replacement statement: sed ‘/old/ s/old/new/g’ file.txt

Linux network administrator questionsBy admin | July 29, 2008

A pretty funny story - someone was offered a test of basic Linux questions for a junior network administrator position, and figured out that the best way to impress the future employer with good answers is to post the list on UbuntuForums. Good idea, right? That’s where all the Linux experts hang out. Unfortunately, that’s where the employer hung out as well:

Page 22: Linux Windows Networking Interview Questions Asked 11111

22

It didn’t seem to me that I was asking too much for people to use mailing lists, forums, IRC whatever to compile the answers themselves. I actually expected to see some questions show up on forums but I didn’t expect someone to paste the entire thing and expect the forum users to do all the work that would qualify you for an interview. I think at this point you could save us all some time and not turn the answers back in, I already have the information I need on your answers.

Anyway, the list has been made public, so enjoy:

1. Give an example of set of shell commands that will give you the number of files in a directory

2. How do you tell what process has a TCP port open in Linux3. On a Red Hat Linux Variant how do you control whether a service starts when

the system boots4. How do you tell the amount of free disk space left on a volume5. Give an example of a set of shell commands to tell how many times Ã

¢â‚¬Å“bob†� has logged on to the system this month6. Give an example of a recursively copying a directory from one location to

another.7. How do you modify the IP and Net mask of a system running a Red Hat Variant

of Linux8. Give an example of a set of shell commands that will give you the number of Ã

¢â‚¬Å“httpd†� processes running on a Linux box.9. On CentOS or Fedora based system using the package management

application, how do you tell what package provided the file “libnss_ldap.so†�

10.What is the difference between VTP client, server, and transparent11.What is the maximum length of CAT612.How does one set up a layer two link to share VLANs13.How does one implement redundant links at Layer 214.What is the difference between a hub, switch, and a router? What are the

security advantages of switch vs. hub?15.Show an example of using telnet to learn the headers of an http server.16.In what OSI layer does PPP exist17.What’s the difference between TCP and UDP18.Given a DNS server that has just started (with an empty cache)

and host contacting this DNS server (using it’s OS setting) to learn an address for google.com, list the steps the DNS server will take to learn it with IP addresses (each step will have multiple possible IP addresses – you need choose only one per step).

19.Why are layer 2 loops bad, and what protocol was designed to prevent them20.Given a radius server at 10.0.0.2 and a shared key of ‘abc123′ show

the IOS commands necessary to authenticate switch users against the radius server, while still allowing the use of local username / password pairs

21.3. On a Red Hat Linux Variant how do you control whether a service starts when the system boots

22./etc/init.d/23.4. How do you tell the amount of free disk space left on a volume24.df

or df -h for human readable format25.6. Give an example of a recursively copying a directory from one location to

another.26.cp -R /home/asdf/source /home/asdf/target

Page 23: Linux Windows Networking Interview Questions Asked 11111

23

27.8. Give an example of a set of shell commands that will give you the number of “httpd†� processes running on a Linux box.

28.ps awx | grep httpd | wc -l29.11. What is the maximum length of CAT630.100 meters (328 feet)

1.Give an example of set of shell commands that will give you the number of files in a directory ?Ans: ls | wc -w or ls -l | wc -l, and subtract 2 for ./ and ../

Linux command line Q&ABy admin | July 15, 2008

1. You need to see the last fifteen lines of the files dog, cat and horse. What command should you use? tail -15 dog cat horse The tail utility displays the end of a file. The -15 tells tail to display the last fifteen lines of each specified file.

2. Who owns the data dictionary? The SYS user owns the data dictionary. The SYS and SYSTEM users are created when the database is created.

3. You routinely compress old log files. You now need to examine a log from two months ago. In order to view its contents without first having to decompress it, use the _________ utility. zcat The zcat utility allows you to examine the contents of a compressed file much the same way that cat displays a file.

4. You suspect that you have two commands with the same name as the command is not producing the expected results. What command can you use to determine the location of the command being run? which The which command searches your path until it finds a command that matches the command you are looking for and displays its full path.

5. You locate a command in the /bin directory but do not know what it does. What command can you use to determine its purpose. whatis The whatis command displays a summary line from the man page for the specified command.

6. You wish to create a link to the /data directory in bob’s home directory so you issue the command ln /data /home/bob/datalink but the command fails. What option should you use in this command line to be successful. Use the -F option In order to create a link to a directory you must use the -F option.

7. When you issue the command ls -l, the first character of the resulting display represents the file’s ___________. type The first character of the permission block designates the type of file that is being displayed.

8. What utility can you use to show a dynamic listing of running processes? __________ top The top utility shows a listing of all running processes that is dynamically updated.

Page 24: Linux Windows Networking Interview Questions Asked 11111

24

9. Where is standard output usually directed? to the screen or display By default, your shell directs standard output to your screen or display.

10.You wish to restore the file memo.ben which was backed up in the tarfile MyBackup.tar. What command should you type? tar xf MyBackup.tar memo.ben This command uses the x switch to extract a file. Here the file memo.ben will be restored from the tarfile MyBackup.tar.

11.You need to view the contents of the tarfile called MyBackup.tar. What command would you use? tar tf MyBackup.tar The t switch tells tar to display the contents and the f modifier specifies which file to examine.

12.You want to create a compressed backup of the users’ home directories. What utility should you use? tar You can use the z modifier with tar to compress your archive at the same time as creating it.

13.What daemon is responsible for tracking events on your system? syslogd The syslogd daemon is responsible for tracking system information and saving it to specified log files.

14.You have a file called phonenos that is almost 4,000 lines long. What text filter can you use to split it into four pieces each 1,000 lines long? split The split text filter will divide files into equally sized pieces. The default length of each piece is 1,000 lines.

15.You would like to temporarily change your command line editor to be vi. What command should you type to change it? set -o vi The set command is used to assign environment variables. In this case, you are instructing your shell to assign vi as your command line editor. However, once you log off and log back in you will return to the previously defined command line editor.

16.What account is created when you install Linux? root Whenever you install Linux, only one user account is created. This is the superuser account also known as root.

17.What command should you use to check the number of files and disk space used and each user’s defined quotas? repquota The repquota command is used to get a report on the status of the quotas you have set including the amount of allocated space and amount of used space.

How to kill a process without using the process id? kill -9 `pidof `Remember to add single back quote

Unix admin questionsBy admin | June 29, 2008

1. How do you list the files in an UNIX directory while also showing hidden files?2. How do you execute a UNIX command in the background?3. What UNIX command will control the default file permissions when files are

created?4. Explain the read, write, and execute permissions on a UNIX directory.

Page 25: Linux Windows Networking Interview Questions Asked 11111

25

5. What is the difference between a soft link and a hard link?6. Give the command to display space usage on the UNIX file system.7. Explain iostat, vmstat and netstat.8. How would you change all occurrences of a value using VI?9. Give two UNIX kernel parameters that effect an Oracle install10.Briefly, how do you install Oracle software on UNIX.11.1 How do you list the files in an UNIX directory while also showing hidden

files?ans: ls -a

12.2. How do you execute a UNIX command in the background?ans: &

13.3 What UNIX command will control the default file permissions when files are created?ans: umask

14.5. What is the difference between a soft link and a hard link?ans: hard link means two inodes link to same file. soft link creates a seperate file

15.6 Give the command to display space usage on the UNIX file system?ans: df

6 Give the command to display space usage on the UNIX file system?ans: du7: iostat returns disk and other data i/o statistics vmstat returns memory paging statistics, virtual and real, netsta returns network statistics. GENERALLY the first line or the command alone will return statistical averages since boottime; the commands can also be run with flags to report instantaneous snapshots every x seconds for y results (ie vmstat 5 5 gives a snapshot every 5 seconds 5 times in a row8: vi to substitute every occurance in a file: %s/OLD/NEW/g9.shared memory and semaphores: shmmmax, shmmmin, etc and seminfo_semmsl (both affect the memory useage and sharing at the kernel level and usually a reboot is necessary for them to take affect safely (kernel parameters can be updated live on many Unix OS’s but is not recommended unless you are at the expert level and have performed the task before successfully on a sandbox)10: Oracle can be installed from CD or better yet from CD’s copied in their entirety to a hard disk simply with the “runInstall” script. a) make sure the filesystems you will be installing to have enough space AND no previous Oracle installation upon them and b) MUST be run as the Oracle user NOT root. (ie: you need to have an oracle user account created with the proper rwx rights to the installation target filesystem) c) several key variables such as hostname, some kernel parameters, and a few other pre-installation tasks need to be performed dependent upon the OS Oracle will be run upon.5. CORRECT answer: (a link NEVER creates another copy of a file, only an inode pointer to a file or a file name)Hard links create inode pointers to a files’ actual location and can only be created on the same filesystemSoft links create an inode pointer to a file NAME and can be created to point to a file on ANOTHER filesystem.Ans to Qn 8itz like find and replace in MS WordEsc:1,$s/old_word/new_word/g

8th questions ans:->

s/existing word/new word/gi

Hiring an IT guy - questions to askBy admin | June 26, 2008

Page 26: Linux Windows Networking Interview Questions Asked 11111

26

This is an aggregated list of questions discussed for hiring an IT guy for your organization atSpiceWorks community forum. Check out their discussion, and description of what question are good and which ones are not that good.

1. What port does telnet use?2. What is SMTP?3. How would you troubleshoot a printer?4. How does traceroute work?5. Walk me through everything that happens in the network from the moment you

punch in www.google.com in the address bar to when the browser displays the page?

6. Can you work this weekend?7. What kind of people are your current users? Do you like them?8. What role do you think computer support analysts should play in the company?9. Assuming you have to work for a living and all jobs pay the same, how would

you describe the job you want?10.When conflict arises on your team, how do you handle it?11.How do you stay current?12.What operating system do you prefer and why?13.What part of the project life cycle have you worked on?14.Describe the project or situation that best demonstrates your coding (or

analytical) skills.15.What is the differece between local, global and universal groups?16.What is the major difference between FAT and NTFS?17.Name the FMSO roles and their functions.18.You’ve just been asked to create 20 new Users and update 2 GPOs, ASAP! You

go to the Administrative Tools, and discover they are all gone. What do you do? What do you suspect happened?

19.What is a Global Catalog?20.Explain the function of DNS.21.Explain a “Two-Way Transitive” trust.22.In speaking about trusts, what does “Non-transitive” mean?23.Describe the lease process of DHCP.24.Explain NTP.25.What is the 568B wiring scheme?26.What us your highest achievement while working in the IT field?27.What are your short term goals to achieve?28.You have a user call for support for the 5th time on the same issue. How would

you handle the call and what would you do differently?29.List as many ways you can think of to move a file from a Windows machine to a

Linux machine.30.Demonstrate recursiveness by implementing a factorial function.

Short for Simple Mail Transfer Protocol, a protocol for sending e-mail messages between servers. Most e-mail systems that send mail over the Internet use SMTP to send messages from one server to another; the messages can then be retrieved with an e-mail client using either POP or IMAP. In addition, SMTP is generally used to send messages from a mail client to a mail server. This is why you need to specify both the POP or IMAP server and the SMTP server when you configure your e-mail application.

The Network Time Protocol (NTP) is a protocol for distributing the universal time (UTC) by means of synchronizing the clocks of computer systems over packet-switched, variable-latency data networks. NTP uses UDP port 123 as its transport layer. It is designed particularly to resist the effects of variable latency by using a jitter buffer.

Page 27: Linux Windows Networking Interview Questions Asked 11111

27

When you execute a trace route command (ie trace routehttp://www.yahoo.com), your machine sends out 3 UDP packets with a TTL (Time-to-Live) of 1. When those packets reach the next hop router, it will decrease the TTL to 0 and thus reject the packet. It will send an ICMP Time-to-Live Exceeded (Type 11), TTL equal 0 during transit (Code 0) back to your machine - with a source address of itself, therefore you now know the address of the first router in the path.Next your machine will send 3 UDP packets with a TTL of 2, thus the first router that you already know passes the packets on to the next router after reducing the TTL by 1 to 1. The next router decreases the TTL to 0, thus rejecting the packet and sending the same ICMP Time-to-Live Exceeded with its address as the source back to your machine. Thus you now know the first 2 routers in the path.This keeps going until you reach the destination. Since you are sending UDP packets with the destination address of the host you are concerned with, once it gets to the destination the UDP packet is wanting to connect to the port that you have sent as the destination port, since it is an uncommon port, it will most like be rejected with an ICMP Destination Unreachable (Type 3), Port Unreachable (Code 3). This ICMP message is sent back to your machine, which will understand this as being the last hop, therefore trace route will exit, giving you the hops between you and the destination.The UDP packet is sent on a high port, destined to another high port. On a Linux box, these ports were not the same, although usually in the 33000. The source port stayed the same throughout the session, however the destination port was increase by one for each packet sent out.One note, traceroute actually sends 1 UDP packet of TTL, waits for the return ICMP message, sends the second UDP packet, waits, sends the third, waits, etc, etc, etc.If during the session, you receive * * *, this could mean that that router in the path does not return ICMP messages, it returns messages with a TTL too small to reach your machine or a router with buggy software. After a * * * within the path, trace route will still increment the TTL by 1, thus still continuing on in the path determination.

NTFS1)allows access local to w2k,w2k3,XP,win NT4 with SP4 & later may get access for somefile.2)Maximum size of partition is 2 Terabytes & more.3)Maximum File size is upto 16TB.4)File & folder Encryption is possible only in NTFS.FAT 321)Fat 32 Allows access to win 95,98,win millenium,win2k,xp on local partition.2)Maximum size of partition is upto 2 TB.3)Maximum File size is upto 4 GB.4)File & folder Encryption is not possible.

The global catalog is a distributed data repository that contains a searchable, partial representation of every object in every domain in a multidomain Active Directory forest. The global catalog is stored on domain controllers that have been designated as global catalog servers and is distributed through multimaster replication. Searches that are directed to the global catalog are faster because they do not involve referrals to different domain controllers.

A two-way trust can be thought of as a combination of two, opposite-facing one-way trusts, so that, the trusting and trusted domains both trust each other (trust and

Page 28: Linux Windows Networking Interview Questions Asked 11111

28

access flow in both directions). This means that authentication requests can be passed between the two domains in both directions. Some two-way relationships can be either nontransitive or transitive depending on the type of trust being created. All domain trusts in an Active Directory forest are two-way, transitive trusts. When a new child domain is created, a two-way, transitive trust is automatically created between the new child domain and the parent domain.

In a transitive trust relationship, the trust relationship extended to one domain is automatically extended to all other domains that trust that domain.And In a nontransitive trust relationship, the trust is bound by the two domains in the trust relationship; it does not flow to any other domains in the forest.

Here are a few simple techniques that will solve many printer problems.Reboot your computer. This generally solves most printing problems.If it’s not printing, or you’re getting a message about the Fax printer, change your default printer: Start - Settings - Printers/Faxes. Right-click the printer you want, and then select (left-click) Set as Default.Check and make sure all connections going to and coming from the printer are firmly in place.Check that the printer is on-line:Start - Settings - Printers, right-click the printer.If there isn’t a checkmark by “Set as Default”, left-click that option to select it.Print a test page. If that prints and the application you are using doesn’t, you probably will need to contact the application’s vendor for support.Turn off your printer for 10 seconds and turn it back on. Make a note of any error messages or flashing lights when the printer is turned back on.If your printer is connected directly to another computer, try rebooting that computer. If your printer is connected to a JetDirect box, try unplugging the JetDirect box for 10 seconds.You may wish to uninstall and then re-install your printer.

Sysadmin sample interview questionsBy admin | June 12, 2008

1. Why was it that you left the last job that you were at?2. What do you think your top 3 strengths are?3. What is most important to you in a job?4. Major difference between FAT and NTFS on a local machine?5. How many passwords by default are remembered in an active directory?6. What is a C name record (in DNS)?7. What is a LM host file used for?8. Can you name the FSMO roles in active directory?9. What tolls would you use to gage the effect of group policy before using any

tools?10.Explain Active Directory sites and services and linked cost routing?11.When would you use circular logging and exchange?12.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?13.Can you explain how you configurated SMS.14.Rate yourself in 3 different areas (1-5, 5 is expert)

Page 29: Linux Windows Networking Interview Questions Asked 11111

29

Canonical name for a DNS alias, code 5. Note that if a domain name has a CNAME record associated with it, then it can not have any other record types. In addition, CNAME records should not point to domain names which themselves have associated CNAME records, so CNAME only provides one layer of indirection.

A CNAME record maps an alias or nickname to the real or Canonical name which may lie outside the current zone. Canonical means expected or real name

Linux application programming questionsBy admin | November 2, 2007

1. Explain the difference between a static library and a dynamic library? - Static library is linked into the executable, while a dynamic library (or shared object) is loaded while the executable has started.

2. How do you create a static library? - If you have a collection of object (.o) files, you can do it by running ar command. Generally a static library has a .a extension, and you can link it into an executable by providing -l libraryname to gcc.

3. Where should the developed libraries be installed on the system? - GNU recommends /usr/local/bin for binaries and /usr/local/lib for libraries.

4. What’s LD_LIBRARY_PATH? - It’s an environment variable that lists all the directories which should be searches for libraries before the standard directories are searched.

5. How do you create a shared library? - Create the object file with -fPIC for position-independent code, then run gcc with -shared option.

6. How do you install a shared library? - Run ldconfig in the standard directory that it’s installed in.

7. What does ldd do? - It shows a list of installed shared libraries.8. How do you dynamically load a library in your app? - Use dlopen()9. What does nm command do? - It reports the list of symbols in a given

library.

How to dance around the salary-expectation question

By Marshall Loeb, MarketWatchLast Update: 12:01 AM ET Mar 14, 2007NEW YORK (MarketWatch) -- Whether you're looking for a job as an accountant or a zoologist, there is one question you're sure to be asked sometime during (and even early in) the interview process: What are your salary expectations?

How you deal with that query is crucial to ensuring that you don't get shortchanged if you're hired or even left out of the considerations altogether.

Don Sutaria, president and founder of CareerQuest, a staffing and training firm, advises job seekers to avoid offering a solid figure. "Don't answer the question. Say, 'I'll expect the fair market value. Make me an offer and we can discuss it.' Or, 'Maybe you

Page 30: Linux Windows Networking Interview Questions Asked 11111

30

can tell me what your range is?'"

Sutaria adds that the best approach is to arm yourself with information. "It's very easy to find now, based on the job title and industry, what your range is."

Indeed, there are several Web sites you can consult to find salary ranges for various professions in regions all over the country. A few reliable ones include Salary.com, Vault.com, WageWeb.com, SalarySource.com and JobStar.org. Professional associations also sometimes conduct salary surveys and publish their results.

Employers will often ask the salary-expectation question as a way to screen out candidates. On an application, it's fair to write something like "negotiable" or offer a very broad range. If your resume and cover letter are impressive, potential employers are unlikely to rule you out based on a vague response.

Remember that if you do name an amount early in the process, it's going to be difficult to renegotiate later. If and when you're asked the question in an interview, ask the interviewer about the position's salary level for someone with your qualifications.

Roy Blitzer, author of "Hire Me, Inc.: Package Yourself to Get Your Dream Job," writes that if you're pressed for a figure, you can offer a range that you've determined based on research of the position's fair market value.

Marshall Loeb, former editor of Fortune, Money, and the Columbia Journalism Review, writes for MarketWatch.

10 mistakes managers make during job interviewsBy Guest Contributor

April 27, 2007, 7:00am PDT

By BNET staff

This article originally appeared in BNET'sNow Hiring: Brilliant People special feature. It's also available as a PDFdownload.Hiring is oneof the hardest parts of managing a team. A lot is riding on the initialmeeting, and if you're nervous or ill-prepared -- or both -- it can make you dostrange things. The following mistakes are all too common, but they're easy toavoid with some advance preparation.

#1: You talk too much

When giving companybackground, watch out for the tendency to prattle on about your own job,personal feelings about the company, or life story. At the end of theconversation, you'll be aflutter with self-satisfaction, and you'll see thecandidate in a rosy light -- but you still won't know anything about his or herability to do the job.

#2: You gossip or swap war stories

Curb your desire toask for dirt on the candidate's current employer or trash talk other people inthe industry. Not only does it cast a bad light on you and your company, butit's a waste of time.

#3: You're afraid to ask tough questions

Interviews areawkward for everyone, and it's easy to over-empathize with a nervous candidate.It's also common to throw softball questions at someone whom you like or

Page 31: Linux Windows Networking Interview Questions Asked 11111

31

whomakes you feel comfortable. You're better off asking everyone the same set ofchallenging questions -- you might be surprised what they reveal. Often aNervous Nellie will spring to life when given the chance to solve a problem orelaborate on a past success.

#4: You fall prey to the halo effect (or the horns effect)

If a candidatearrives dressed to kill, gives a firm handshake, and answers the first questionperfectly, you might be tempted to check the imaginary "Hired!" boxin your mind. But make sure you pay attention to all the answers and don't beswayed by a first impression. Ditto for the reverse: The mumblerwith the tattoos might have super powers that go undetected at first glance.

#5: You ask leading questions

Watch out forquestions that telegraph to the applicant the answer you're looking for. Youwon't get honest responses from questions like, "You are familiar withExcel macros, aren't you?"

#6: You invade their privacy

First of all, it'sillegal to delve too deeply into personal or lifestyle details. Second, itdoesn't help you find the best person for the job. Nix all questions about homelife ("Do you have children?" "Do you think you'd quit if yougot married?"), gender bias or sexual preference ("Do you get alongwell with other men?"), ethnic background ("That's an unusual name,what nationality are you?"), age ("What year did you graduate fromhigh school?"), and financials ("Do you own your home?")

#7: You stress the candidate out

Some interviewersuse high-pressure techniques designed to trap or fluster the applicant. Whileyou do want to know how a candidate performs in a pinch, it's almost impossibleto re-create the same type of stressors an employee will encounter in theworkplace. Moreover, if you do hire the person, he or she may not trust youbecause you launched the relationship on a rocky foundation.

#8: You cut it short

A series ofinterviews can eat up your whole day, so it's tempting to keep them brief. Buta quick meeting just doesn't give you enough time to gauge a candidate'sresponses and behavior. Judging candidates is nuanced work, and it relies ontracking lots of subtle inputs. An interview that runs 45 minutes to an hourincreases your chances of getting a meaningful sample.

#9: You gravitate toward the center

If everyone youtalk to feels like a "maybe," that probably means you aren't gettingenough useful information -- or you're not assessing candidates honestlyenough. Most "maybes" are really "no, thank yous."(Face it: The candidate didn't knock your socks off.) Likewise, if you thinkthe person might be good for some role at some point in the future, he orshe is really a "no."

#10: You rate candidates against each other

Mediocre candidatesmay look like superstars when they follow a dud, but that doesn't mean they'rethe most qualified for the job. The person who comes in tomorrow may

Page 32: Linux Windows Networking Interview Questions Asked 11111

32

smoke all ofthem, but you won't be able to tell if you rated mediocre candidates too highlyin your notes. Evaluate each applicant on your established criteria -- don'tgrade on a curve.

Basic shell scripting questionsBy admin | July 22, 2007

1. How do you find out what’s your shell? - echo $SHELL2. What’s the command to find out today’s date? - date3. What’s the command to find out users on the system? - who4. How do you find out the current directory you’re in? - pwd5. How do you remove a file? - rm6. How do you remove a <="" b="">- rm -rf7. How do you find out your own username? - whoami8. How do you send a mail message to somebody? -

[email protected] -s ‘Your subject’ -c ‘[email protected]

9. How do you count words, lines and characters in a file? - wc10. How do you search for a string inside a given file? - grep string

filename11. How do you search for a string inside a directory? - grep string *12. How do you search for a string in a directory with the

subdirectories recursed? - grep -r string *13. What are PIDs? - They are process IDs given to processes. A PID

can vary from 0 to 65535.14. How do you list currently running process? - ps15. How do you stop a process? - kill pid16. How do you find out about all running processes? - ps -ag17. How do you stop all the processes, except the shell window? - kill

018. How do you fire a process in the background? - ./process-name &19. How do you refer to the arguments passed to a shell script? - $1,

$2 and so on. $0 is your script name.20. What’s the conditional statement in shell scripting? - if

{condition} then … fi21. How do you do number comparison in shell scripts? - -eq, -ne, -lt,

-le, -gt, -ge22. How do you test for file properties in shell scripts? - -s filename

tells you if the file is not empty, -f filename tells you whether the argument is a file, and not a directory, -d filename tests if the argument is a directory, and not a file, -w filename tests for writeability, -r filename tests for readability, -x filename tests for executability

23. How do you do Boolean logic operators in shell scripting? - ! tests for logical not, -a tests for logical and, and -o tests for logical or.

24. How do you find out the number of arguments passed to the shell script? - $#

25. What’s a way to do multilevel if-else’s in shell scripting? - if {condition} then {statement} elif {condition} {statement} fi

26. How do you write a for loop in shell? - for {variable name} in {list} do {statement} done

27. How do you write a while loop in shell? - while {condition} do {statement} done

Page 33: Linux Windows Networking Interview Questions Asked 11111

33

28. How does a case statement look in shell scripts? - case {variable} in {possible-value-1}) {statement};; {possible-value-2}) {statement};; esac

29. How do you read keyboard input in shell scripts? - read {variable-name}

30. How do you define a function in a shell script? - function-name() { #some code here return }

31. How does getopts command work? - The parameters to your script can be passed as -n 15 -x 20. Inside the script, you can iterate through the getopts array as while getopts n:x option, and the variable $option contains the value of the entered option.

12)How do you search for a string in a directory with the subdirectories recursed?

1. if not linux use the below commandfind / |xargs grep “string”

1. How do u find the process ID for all services??pgrepeg:pgrep mysql

1. 1) There are many shell scripting languages based on the shell being used.2) Syntax for the scripting is based on the shell.3) The syntax above would work for Bourne shell but many would not work for the “C” shell “csh”.2. find ./ -exec grep “string” {} \;3. We can take an example in solaris.If parent process dies while running child process below said things may happen:-After complition of child’s process task it will search the parent process if there is no parent process it may go defunct status and it’s status will be zombie mode.It will take swap space & memory space and also take load average. Rspective parent process can’t not execute the particular child process in next instance. In this situation we have to kill that respective child process by manually.

MySQL management interview questionsBy admin | June 29, 2007

1. How do you show the currently running queries? - SHOW FULL PROCESSLIST;

2. How do you kill a MySQL query? - See the ID of it from the question above, then KILL id. You can separate multiple IDs by space.

3. I need to find out how many client connections were aborted by MySQL server. - It’s displayed in SHOW STATUS query, alternatively accessible via mysqladmin extended-status.

4. What does SET SQL_AUTO_IS_NULL =1 do? - you can find the last inserted row for a table that contains an AUTO_INCREMENT column by issuing WHERE auto_increment_column IS NULL

Interview questions for a sysadminBy admin | November 21, 2006

Siddharth sent in questions he got for sysadmin interview:

Page 34: Linux Windows Networking Interview Questions Asked 11111

34

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?

Q-2 VLANVLAN stand for Virtual Local Area Netwok. I VLAN We break the Whole Netwok into small Segment Which helps us Controlling Broadcost Domain and Providing Authentication for Different segment by appying ACL’s. Also it helps by providing ease of Management the Network. Problems can be identified more easily

Vlan :Vlan defines logical grouping of computers in a lan.set of ports can be assigned to every logical group.Vlan is used to reduce the broadcast packets.Defines to process of one subset of a switch interface as one broad cast domain.Broadcasts are not forwarded between vlan’s.and each port can be created as Individual vlan.About Port Information:system connected to port is called access portsswitch to switch port is called trunk port.

Here are the steps to configure the NFS server in this scenario:1. Edit the /etc/exports file to allow NFS mounts of the /home directory with read/write access./home *(rw,sync)2. Let NFS read the /etc/exports file for the new entry, and make /home available to the network with the exportfs command.[root@bigboy tmp]# exportfs -a[root@bigboy tmp]#3. Make sure the required nfs, nfslock, and portmap daemons are both running and configured to start after the next reboot.[root@bigboy tmp]# chkconfig nfslock on[root@bigboy tmp]# chkconfig nfs on[root@bigboy tmp]# chkconfig portmap on[root@bigboy tmp]# service portmap startStarting portmapper: [ OK ][root@bigboy tmp]# service nfslock startStarting NFS statd: [ OK ][root@bigboy tmp]# service nfs startStarting NFS services: [ OK ]Starting NFS quotas: [ OK ]Starting NFS daemon: [ OK ]Starting NFS mountd: [ OK ][root@bigboy tmp]#After configuring the NIS server, we have to configure its clients, This will be covered next.Configuring The NFS ClientYou also need to configure the NFS clients to mount their /home directories on the NFS server.

Page 35: Linux Windows Networking Interview Questions Asked 11111

35

These steps archive the /home directory. In a production environment in which the /home directory would be actively used, you’d have to force the users to log off, backup the data, restore it to the NFS server, and then follow the steps below. As this is a lab environment, these prerequisites aren’t necessary.1. Make sure the required netfs, nfslock, and portmap daemons are running and configured to start after the next reboot.[root@smallfry tmp]# chkconfig nfslock on[root@smallfry tmp]# chkconfig netfs on[root@smallfry tmp]# chkconfig portmap on[root@smallfry tmp]# service portmap startStarting portmapper: [ OK ][root@smallfry tmp]# service netfs startMounting other filesystems: [ OK ][root@smallfry tmp]# service nfslock startStarting NFS statd: [ OK ][root@smallfry tmp]#2. Keep a copy of the old /home directory, and create a new directory /home on which you’ll mount the NFS server’s directory.[root@smallfry tmp]# mv /home /home.save[root@smallfry tmp]# mkdir /home[root@smallfry tmp]# ll /……drwxr-xr-x 1 root root 11 Nov 16 20:22 homedrwxr-xr-x 2 root root 4096 Jan 24 2003 home.save……[root@smallfry tmp]#3. Make sure you can mount bigboy’s /home directory on the new /home directory you just created. Unmount it once everything looks correct.[root@smallfry tmp]# mount 192.168.1.100:/home /home/[root@smallfry tmp]# ls /homeftpinstall nisuser quotauser smallfry www[root@smallfry tmp]# umount /home[root@smallfry tmp]#4. Start configuring autofs automounting. Edit your /etc/auto.master file to refer to file /etc/auto.home for mounting information whenever the /home directory is accessed. After five minutes, autofs unmounts the directory.#/etc/auto.master/home /etc/auto.home –timeout 6005. Edit file /etc/auto.home to do the NFS mount whenever the /home directory is accessed. If the line is too long to view on your screen, you can add a \ character at the end to continue on the next line.#/etc/auto.home* -fstype=nfs,soft,intr,rsize=8192,wsize=8192,nosuid,tcp \192.168.1.100:/home:&6. Start autofs and make sure it starts after the next reboot with the chkconfig command.[root@smallfry tmp]# chkconfig autofs on[root@smallfry tmp]# service autofs restartStopping automount:[ OK ]Starting automount:[ OK ][root@smallfry tmp]#

Page 36: Linux Windows Networking Interview Questions Asked 11111

36

After doing this, you won’t be able to see the contents of the /home directory on bigboy as user root. This is because by default NFS activates the root squash feature, which disables this user from having privileged access to directories on remote NFS servers. You’ll be able to test this later after NIS is configured.Note: This automounter feature doesn’t appear to function correctly in my preliminary testing of Fedora Core 3. See Chapter 29, “Remote Disk Access with NFS”, for details.All newly added Linux users will now be assigned a home directory under the new remote /home directory. This scheme will make the users feel their home directories are local, when in reality they are automatically mounted and accessed over your network.

linux interview qns1.How to disable usb ports in linux system.2.How to give ftpuser permissions to one newly created user.3.alredy mail server is there in my network,my mail user tell to my mails r not going to outside n outside mails r not comming.. how to troubleshoot it ..where u have to check????4.wt is difference btwn NIS and NIS plus.5.can u increse runlevls in linux? how many runlevels r there in linux kernel.If u increse runlevels how to increse??6.U can install two different linux versions in single system.. with out Vmware?7.wt is diff btwn scp and tcpdump8.wt is current package version of FTP??/

Simple FreeBSD questionsBy admin | August 26, 2006

Test the basic knowledge of FreeBSD.

1. What’s in the file /etc/ttys? - Configuration for virtual consoles for the startup. By default FreeBSD has 8 virtual consoles.

2. You’re told that the permissions of a file are 645. Quick, how do you calculate what it means? - The permissions value are always 4 for read, 2 for write, 1 for execute. The three numbers are always for owner, group, and everybody on the system. Therefore 645 means: owner - read and write, group - read only, everybody - read and execute. You’ll rarely see such a permission set, but for interview question it might just work.

3. Explain what each column means in the top command:4. 48630 techinterviews 2 0 29816K 9148K select 3:18

0.00% 0.00% navigator-linu

5. 175 root 2 0 924K 252K select 1:41 0.00% 0.00% syslogd

6. 7059 techinterviews 2 0 7260K 4644K poll 1:38 0.00% 0.00% mutt

The first column is the process id, followed by the username, followed by priority…

Page 37: Linux Windows Networking Interview Questions Asked 11111

37

7. Explain the difference between SIGTERM and SIGKILL. SIGTERM asks the application to terminate in a polite way, it warns about the pending closure and asks the app to finish whatever it is doing. SIGKILL will kill the process no matter what. This is telling the application that it will be shut down no matter what.

8. Explain the difference between SIGHUP, SIGUSR1 and SIGUSR2. Those are application specific and therefore are not defined on the OS level.

9. How do you change your shell to bash?% chsh -s /usr/local/bin/bash

Apache interview questions and answersBy admin | August 25, 2006

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? <VirtualHost www.techinterviews.com>    ServerAdmin [email protected]    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</VirtualHost>

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.

Topics for a Unix sysadmin interviewBy admin | May 23, 2006

Page 38: Linux Windows Networking Interview Questions Asked 11111

38

1. Job Scheduling; mainly crontab, at, batch command2. Backup stetegy; incremental, full system back up; diff between tar & ufsdump3. diff between hard link & softlink4. How to list only the directories inside a directory (Ans. ls -l|grep "^d")5. RAID levels; pros & cons of diffrent levels; what is RAID 1+06. How to recover a system whose root password has lost?7. What is a daemon?8. How to put a job in background & bring it to foreground?9. What is default permissions for others in a file?10.Questions on shell initialization scripts?11.Questions on restricted shell12.What is diff betwn grep & find?13.What is egrep?14.Questions on shell programming15.What is a pipe?16.Questions on Solaris patch management like pkgadd etc17.Questions on file system creation; actually what happens when we create a file

system?18.Questions on RBAC? what is a role accound & what is a profile?19.From command line how will you add a user account? the full command will all

arguments.20.Fs it advisable to put a swap partion in RAID1 (mirroring?) pros & cons?

To recover a system when the root password is lost— During reboot of the system, press ‘e’, with the help of arrow keys, highlight the second option which tells Kernel, and the append the line with ‘S’ at the end of the sentence, which would go into Single User Mode, then after entering, it wud ask you for root password, there-in you can create a new password for the root—— or —– u can type init S which would take you to the Single user Mode and then continue typing the new password for the root user…

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){atlist of jobs/scripts}3. A symbolic (soft) linked file and the targeted file can be located on the same or different file system while for a hard link they must be located on the same file system.8. to move it to background, bgto bring it to foreground, fg12. grep - searching for a pattern in a file (or some files).find - searching for a file and executing some commands on it.13. egrep - to search for multiple - patterns or expressions(stored in a file).15. pipe - redirection operator, the output of a command will be provided as an input to another.

forgotten root password for redhat ws ?At the login screen, choose single session at right bottom of login screen. Wait, it will take to command prompt then type ‘passwd’. Change your password then type ‘exit’.

Page 39: Linux Windows Networking Interview Questions Asked 11111

39

to put a job in background we have to press ctrl+Z not bg..bg and fg is to resume the process in background and fore ground respectively

1)batchexecutes commands when system load levels permit; in other words, when the load average drops below 0.8, or the value specified in the invocation of atrun.

2)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.

Oracle on Linux/Unix questionsBy admin | April 7, 2006

1. How many memory layers are in the shared pool?2. How do you find out from the RMAN catalog if a particular archive log has

been backed-up?3. How can you tell how much space is left on a given file system and how much

space each of the file system’s subdirectories take-up?4. Define the SGA and how you would configure SGA for a mid-sized OLTP

environment? What is involved in tuning the SGA?5. What is the cache hit ratio, what impact does it have on performance of an

Oracle database and what is involved in tuning it?6. Other than making use of the statspack utility, what would you check when you

are monitoring or running a health check on an Oracle 8i or 9i database?7. How do you tell what your machine name is and what is its IP address?8. How would you go about verifying the network name that the local_listener is

currently using?9. You have 4 instances running on the same UNIX box. How can you determine

which shared memory and semaphores are associated with which instance?10.What view(s) do you use to associate a user’s SQLPLUS session with his o/s

process?11.What is the recommended interval at which to run statspack snapshots, and

why?12.What spfile/init.ora file parameter exists to force the CBO to make the

execution path of a given statement use an index, even if the index scan may appear to be calculated as more costly?

13.Assuming today is Monday, how would you use the DBMS_JOB package to schedule the execution of a given procedure owned by SCOTT to start Wednesday at 9AM and to run subsequently every other day at 2AM.

14.How would you edit your CRONTAB to schedule the running of /test/test.sh to run every other day at 2PM?

15.What do the 9i dbms_standard.sql_txt() and dbms_standard.sql_text() procedures do?

16.In which dictionary table or view would you look to determine at which time a snapshot or MVIEW last successfully refreshed?

17.How would you best determine why your MVIEW couldn’t FAST REFRESH?18.How does propagation differ between Advanced Replication and Snapshot

Replication (read-only)?19.Which dictionary view(s) would you first look at to understand or get a high-

level idea of a given Advanced Replication environment?20.How would you begin to troubleshoot an ORA-3113 error?21.Which dictionary tables and/or views would you look at to diagnose a locking

issue?

Page 40: Linux Windows Networking Interview Questions Asked 11111

40

22.An automatic job running via DBMS_JOB has failed. Knowing only that “it’s failed”, how do you approach troubleshooting this issue?

23.How would you extract DDL of a table without using a GUI tool?24.You’re getting high “busy buffer waits” - how can you find what’s causing it?25.What query tells you how much space a tablespace named “test” is taking up,

and how much space is remaining?26.Database is hung. Old and new user connections alike hang on impact. What do

you do? Your SYS SQLPLUS session IS able to connect.27.Database crashes. Corruption is found scattered among the file system neither

of your doing nor of Oracle’s. What database recovery options are available? Database is in archive log mode.

28.Illustrate how to determine the amount of physical CPUs a Unix Box possesses (LINUX and/or Solaris).

29.How do you increase the OS limitation for open files (LINUX and/or Solaris)?30.Provide an example of a shell script which logs into SQLPLUS as SYS,

determines the current date, changes the date format to include minutes & seconds, issues a drop table command, displays the date again, and finally exits.

31.Explain how you would restore a database using RMAN to Point in Time?32.How does Oracle guarantee data integrity of data changes?33.Which environment variables are absolutely critical in order to run the OUI?34.What SQL query from v$session can you run to show how many sessions are

logged in as a particular user account?35.Why does Oracle not permit the use of PCTUSED with indexes?36.What would you use to improve performance on an insert statement that places

millions of rows into that table?37.What would you do with an “in-doubt” distributed transaction?38.What are the commands you’d issue to show the explain plan for “select * from

dual”?39.In what script is “snap$” created? In what script is the “scott/tiger” schema

created?40.If you’re unsure in which script a sys or system-owned object is created, but

you know it’s in a script from a specific directory, what UNIX command from that directory structure can you run to find your answer?

41.How would you configure your networking files to connect to a database by the name of DSS which resides in domain icallinc.com?

42.You create a private database link and upon connection, fails with: ORA-2085: connects to . What is the problem? How would you go about resolving this error?

43.I have my backup RMAN script called “backup_rman.sh”. I am on the target database. My catalog username/password is rman/rman. My catalog db is called rman. How would you run this shell script from the O/S such that it would run as a background process?

44.Explain the concept of the DUAL table.45.What are the ways tablespaces can be managed and how do they differ?46.From the database level, how can you tell under which time zone a database is

operating?47.What’s the benefit of “dbms_stats” over “analyze”?48.Typically, where is the conventional directory structure chosen for Oracle

binaries to reside?49.You have found corruption in a tablespace that contains static tables that are

part of a database that is in NOARCHIVE log mode. How would you restore the tablespace without losing new data in the other tablespaces?

Page 41: Linux Windows Networking Interview Questions Asked 11111

41

50.How do you recover a datafile that has not been physically been backed up since its creation and has been deleted. Provide syntax example.

What are the ways tablespaces can be managed and how do they differ?1.Dictionary managed and locally managed.Dictionary managed.——————-Here To allocate next extent it gets free blocks info from data dictionary every time, it’s a i/o contention issue.Locally managed.—————In Locally managed tablespace free blocks information is available as bitmap in data file headers. No need to go dictionary.SEGMENT SPACE MANAGEMENT AUTO option is still useful with LMT.

Database is hung. Old and new user connections alike hang on impact. What do you do? Your SYS SQLPLUS session IS able to connect.I think it looks like Archive log destination is full.1.If you have seperate backup script for archive log please use that.2.Or move some archive log fils to diffrent location to get free space.3.Try to connect the DB now.

How do you tell what your machine name is and what is its IP address?1.uname -n2.ifconfig -a

How would you extract DDL of a table without using a GUI tool?Use DBMS_METADATA package and use GET_DDL procedure.

Which dictionary tables and/or views would you look at to diagnose a locking issue?1.v$locked_object2.v$lock

3.How can you tell how much space is left on a given file system and how much space each of the file system’s subdirectories take-up?df -hdu -h

2. How do you find out from the RMAN catalog if a particular archive log has been backed-up?issue LIST BACKUP BY FILE; and verify under the ‘List of Archived Log Backups’ for that particular file.

What is the cache hit ratio, what impact does it have on performance of an Oracle database and what is involved in tuning it?Performance directly propotional to CacheHitRatio. Tune the DB buffer cache (allocating keep & recycle,adjusting the size of the different caches,pinning the

Page 42: Linux Windows Networking Interview Questions Asked 11111

42

sql,setting the buffer_pool storage parameter) & library cache (adjusting the shared_pool_size)

How would you go about verifying the network name that the local_listener is currently using?LSNRCTL> show current_listenerCurrent Listener is LISTENERLSNRCTL> show log_statusConnecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname.domain.net)(PORT=1521)))LISTENER parameter “log_status” set to ONThe command completed successfullyLSNRCTL>

Check the semaphore and kernal paramsdd13alyn /u01/oracle > cd /proc/sys/kernaldd13alyn /proc/sys/kernel > cat sem4096 16000 4096 150dd13alyn /proc/sys/kernel > cat shmmax3221225472dd13alyn /proc/sys/kernel > cat shmmni4096dd13alyn /proc/sys/kernel 

How do you tell what your machine name is and what is its IP address?hostnamehost -T hostname

How does Oracle guarantee data integrity of data changes?Using Constraints & Database Triggers

How would you edit your CRONTAB to schedule the running of /test/test.sh to run every other day at 2PM?00 14 */2 * * /test/test.sh > out.log 2>&1this logs the process executed in test.sh to out.log even if the process errors out.

In which dictionary table or view would you look to determine at which time a snapshot or MVIEW last successfully refreshed?ALL_MVIEW_REFRESH_TIMES

Explain the concept of the DUAL table?Dual is a table which is created by oracle along with the data dictionary. It consists of exactly one column whose name is dummy and one record. The value of that record is X. LikeSQL> desc dualName Null? Type———————– ——– —————-DUMMY VARCHAR2(1)

Page 43: Linux Windows Networking Interview Questions Asked 11111

43

SQL> select * from dual;D-X

Assuming today is Monday, how would you use the DBMS_JOB package to schedule the execution of a given procedure owned by SCOTT to start Wednesday at 9AM and to run subsequently every other day at 2AM.declarejno number;begindbms_job.submit(JNo, ’scott.procedure_name;’, TRUNC(SYSDATE+2)+9/24, ‘TRUNC(SYSDATE+1)+14/24′);dbms_output.put_line(jno);end;/

OS interview questionsBy admin | September 22, 2005

1. What is MUTEX ?2. What isthe difference between a ‘thread’ and a ‘process’?3. What is INODE?4. Explain the working of Virtual Memory.5. How does Windows NT supports Multitasking?6. Explain the Unix Kernel.7. What is Concurrency? Expain with example Deadlock and Starvation.8. What are your solution strategies for “Dining Philosophers Problem” ?9. Explain Memory Partitioning, Paging, Segmentation.10.Explain Scheduling.11.Operating System Security.12.What is Semaphore?13.Explain the following file systems : NTFS, Macintosh(HPFS), FAT .14.What are the different process states?15.What is Marshalling?16.Define and explain COM?17.What is Marshalling?18.Difference - Loading and Linking ?19.Q1. What is mutex?20.Ans: - Mutex is a program object that allows multiple program threads to share

the same resource, such as file access, but not simultaneously. When a program is started a mutex is created woth a unique name. After this stage, any thread that needs the resource must lock the mutex from other threads while it is using the resource. the mutex is set to unlock when the data is no longer needed or the routine is finished.

Q1. What is mutex?Ans: - Mutex is a program object that allows multiple program threads to share the same resource, such as file access, but not simultaneously. When a program is started a mutex is created woth a unique name. After this stage, any thread that needs the

Page 44: Linux Windows Networking Interview Questions Asked 11111

44

resource must lock the mutex from other threads while it is using the resource. the mutex is set to unlock when the data is no longer needed or the routine is finished.Q12: What is Semaphore?Ans: Locking Mechanism used inside resource mangers and resourse dispensers.

15Q: What is Marshalling?Ans: The process of packaging and sending interface method parameters across thread or process boundaries.

Q16:Define and Explain COM?Ans: COM is a specification(Standards). COM has two aspectsa: COM specifications provide a definition for what object isb: COM provides services or blue prints for creation of object and comminication between client and server.COM is loaded when the first object of the component is created.

# 14.A process may be in anyone of the following states1.NEW2.READY3.WAIT4.RUNNING5.TERMINATE

Answer to Question:What isthe difference between ‘convenient’ and ‘efficient’?Answer:Convenient programming is the way of programming using the available resources like Library APIs, Macros etc without caring for efficiency.Let me explain this with an example. Suppose we need to convert a character into an upper case, only if the character is an alphabet in lower case.A convinient way of achieving this is as followsif( isalpha(ch) ){ch = toupper(ch);}However, the overhead with this is as follows1. Involves the use of ctype.h library and2. Takes high MIPS (million instructions per second) since it involves function calls.An efficient way to this is as followsif( ‘a’

Answer to Question 3Data structures that contain information about the files that are created when unix file systems are created.Each file has an i-node & is identified by an inode number(i-number) in the file system where it resides.inode provides important information on files such as group ownership,acess mode(read,write,execute permissions).

1.What is the main differents b/w vx-works and liunux os?Ans) Vx-works is real time operation system

Page 45: Linux Windows Networking Interview Questions Asked 11111

45

LINUX is general OS , also can be confugured for RTOS4.What is gobel variable in c?Ans) Any variable declared out side the function is global variable. Static global variables scope is limited to file.

VxWorks is embedded OS while Linux OS is gereric OS, main difference is as :1. If change the sceduling of one process from A to B then the others task have no effect in linux but in VxWorks all task’s scheduling change to B, i.e. in VxWorks all the task have same scheduling but in linux it can different.In Vxworks you can access any memory location(should be exist), but in linux you can access only the segment which have allocated for that process.

marshelling.The process of gathering data and transforming it into a standard format before it is transmitted over a network so that the data can transcend network boundaries. In order for an object to be moved around a network, it must be converted into a data stream that corresponds with the packet structure of the network transfer protocol. This conversion is known as data marshalling. Data pieces are collected in a message buffer before they are marshaled. When the data is transmitted, the receiving computer converts the marshaled data back into an object.

I have came through an Example explaining Mutex and SemaphoreMutex:1. Serial accessone toilet is available with a Key for it.one guy will have the key and will use the toilet, so making others to wait for access.once done, he gives the key to the other2. Mutex is semaphore of value 1Semaphores:1. N resources accesssay for example 4 toilets are there; each has a common key for the toliets available.at the start semaphore value set to 4(4 toilets are free), once any user gets in ; semaphore decrements the value;once done he will increment saying it ; it’s FREE…

What is INODE?ans:It contains information about UNIX file system.ie when the file can be created and also gives the owership of the file,and permission level.inode number (i-number) is reside over the files,it can be found using the command ls-l

Waht is the difference b/w shared memory & message queues ?I know few differences.Can anyone tell me few more?1.System call overhead in case of message queue.2.Shared memory is fastest IPC mechanism, since it doesn’t involve any system call as it is done in user space.3.once data read from message queue, the data is gone in case os message queue whereas in shared memory, tha data will be there.

Explain Scheduling.Every operating system use a mechanism to execute processes. it maintains a run queue which actually sort process and keep them on the execution order and they wait for their turn.

Page 46: Linux Windows Networking Interview Questions Asked 11111

46

Actually, in normal cases, our operating systems use Priority And Round Robin Mechanism.

Explain Memory Partitioning, Paging, Segmentation.Memory partitioning is the way to distribute the Kernel and User Space Area in Memory.Paging is actually a minimum memory, that can be swap in and swap out from Memory.In modern Server operating systems, we can use Multiple page size support. That actually helps to tune OS performance, depending on type of applications.Segmentation is actually a way to keep similar objects in one place. For example: you can have your stack stuffs in one place (Stack Segment), Binary code in another place(text segment), data in another place (Data and BSS segment).Linux doesn’t have segment architecture. AIX has a Segment architecture.

Sysadmin interview questionsBy admin | July 26, 2005

1. What is a level 0 backup?2. What is an incremental backup?3. What steps are required to perform a bare-metal recovery?4. Name key files or directories on a UNIX system that should always be backed

up.5. Name key files or directories on a Windows system that should always be

backed up.6. What is RAID 0?7. What is RAID 0+1? Why is it better than 0?8. What is RAID-5?9. Why would you NOT want to encapsulate a root directory with Veritas?10.What is concatenation?11.What is striping?12.What is a spindle?

AnsQ1: level 0 backup is normal or full backup. A normal backup disregardsthe 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

11Q What is striping?

Page 47: Linux Windows Networking Interview Questions Asked 11111

47

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.Question 6: 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..

Q4: /etc, /boot, /homeQ5: “%SystemDrive%\Documents and Settings”

Q6: Level 0 — Striped Disk Array without Fault Tolerance: Provides data striping (spreading out blocks of each file across multiple disk drives) but no redundancy. This improves performance but does not deliver fault tolerance. If one drive fails then all data in the array is lost.

raid 0: its a striping process that means datas dividingraid 1: its a mirroring process so that raid 1 s better than raid 0raid5:this s also striping and parity processin this raid 5 used 4 partations.4 th one s sparein case 2 nd paratation s failed spare (i mean 4 th ) s activate to 2 nd partationRAID 0:Striping. Data is spread across multiple disks. No redundancy.RAID 1:Mirrioring. Data written to a mirror is duplicated to a second disk or volume.RAID 0+1:Striping + Mirroring: Data is striped across 2 or more disks, then duplicated to identical disk setups. This provides speed, as well as redundancy.RAID 1+0:Mirroring + Striping: _MIRRORS_ are striped across multiple disks. Faster than 0+1, but not as redundant.RAID 5:RAID with parity. Data is striped across multiple disks. A disk or disks in a RAID-5 set is reserved for parity information. This way data can be reconstructed using the pairity information.Why would you NOT want to do root-disk encapsulation with Veritas?This is not nessacarily the case anymore with versions of VxFS greater than 4.5. root disk encapsulation requires kernel-level drivers in most cases. Because of this, encapsulating the root partition can make it unreadable in a bare-metal recovery situation.What is Concatination?Concatination is a process whereby multple disk drives are combined into a larger volume. e.g. 2 drives, 1 30 GB drive, and a 10 GB drive are combined to present a 40GB drive to the OS.

Page 48: Linux Windows Networking Interview Questions Asked 11111

48

What is Striping?Striping is a process whereby data is split across multiple disks. This is typically done with identical drives. Data being written is split into small blocks (8-32K typically) and written across as many drives that are in the striped volume. The block-size is typically called an ‘interlace’ or ‘interleave’ factor. This makes writing and reading data much faster than writing to a single disk.What is a spindle?Spindles are the center-points of disk drives.. the rotating shaft. The reason this question could be relevant is that when discussing RAID, it’s not uncommon to hear terms like “Spliting data across as many spindles as possible to achieve performance”… i think this term has started to fall out of use however.

# What is a level 0 backup?Level 0 backups are also known as “full” backups. ALL data on a system is copied.# What is an incremental backup?An Incremental backup is copying data that has only changed since the last FULL backup.# What steps are required to perform a bare-metal recovery?Most bare-metal recovery solutions require that a minimal OS be installed back onto the system. There is software out there that can assist with this. However it’s usually easier to just boot a box from a CD or network server, install a base OS, and recover from the last known good backup.# Name key files or directories on a UNIX system that should always be backed up.SOLARIS systems:/etc - System configuration information./var/adm - additional log directory for Solaris./var/log - preserve log data for forensics if needed.LINUX Systems:/etc - system configuration information./boot - Linux kernel information/var/log - Log data for forensics if needed.# Name key files or directories on a Windows system that should always be backed upc:\ :)

1. What is a level 0 backup? 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.2. What is an incremental backup? 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.3. What steps are required to perform a bare-metal recovery? Reinstall the OS.start -> run -> type “ntbackup†� -> ok -> next -> select restore -> next -> select backup files -> next -> finish4. Name key files or directories on a UNIX system that should always be backed up.

Page 49: Linux Windows Networking Interview Questions Asked 11111

49

5. Name key files or directories on a Windows system that should always be backed up.6. What is RAID 0? Striped Disk Array without Fault Tolerance: Provides data striping (spreading out blocks of each file across multiple disk drives) but no redundancy. This improves performance but does not deliver fault tolerance. If one drive fails then all data in the array is lost.7.What is RAID 0+1? Why is it better than 0?· RAID 0: Striping. Data is spread across multiple disks. No redundancy.· RAID 1: Mirroring. Data written to a mirror is duplicated to a second disk or volume.· RAID 0+1: Striping + Mirroring: Data is striped across 2 or more disks, and then duplicated to identical disk setups. This provides speed, as well as redundancy.· RAID 1+0: Mirroring + Striping: _MIRRORS_ are striped across multiple disks. Faster than 0+1, but not as redundant.· RAID 5: RAID with parity. Data is striped across multiple disks. A disk or disks in a RAID-5 set is reserved for parity information. This way data can be reconstructed using the parity information.8. Why would you NOT want to encapsulate a root directory with Veritas? Encapsulating the root partition can make it unreadable in a bare-metal recovery situation.9. What is concatenation? Concatenation is the operation of joining two character strings end to end.10. 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.11. What is a spindle? Spindles are the center-points of disk drives.. the rotating shaft. The reason this question could be relevant is that when discussing RAID, it’s not uncommon to hear terms like “Splitting data across as many spindles as possible to achieve performance†�12. What is RAID? REDUNDANT ARRAY OF INDEPENDENT DISKS.RAID 0-EACH FILE HAS A BACKUP.

Regarding level 0 backups and incremental backups.I keep seeing people refer to the “archive bit” in files… On Unix, with Netbackup specifically, the archive bit means absolutely nothing. An incremental backup will pick up all files _modified_ since the last backup - be it incremental or full. Hence it is using the mtime of the file. If you were to “touch /etc/passwd” this file would now be included in the next incremental backup.

Network developer interview questionsBy admin | July 26, 2005

1. What ports does FTP traffic travel over?2. What ports does mail traffic utilize?

Page 50: Linux Windows Networking Interview Questions Asked 11111

50

3. What ports do HTTP and HTTPS use?4. Why is NTP required in an NFS network?5. Name some common mal software on the server side6. What is CPAN? How do you access it?7. What is PEAR?8. What advantages does mod_perl have over a perl CGI?9. What is required to do SSL in Apache 1.x?10.What is Tcl?11.What is a servlet engine/container?12.What is BIND?13.Name the steps to setup a slave zone in BIND14.Name the steps to setup a primary zone in BIND15.What commands would you use under Solaris or Linux to modify/view an LDAP

tree?# What is CPAN? How do you access it? comprehensive perl archive network - free perl modules. cpan.org search.cpan.org# What advantages does mod_perl have over a perl CGI? speed, stability and integration.# What is required to do SSL in Apache 1.x? openssl, mod_ssl, apache. Unless of course you grab a precompiled binary! :)# What is a servlet engine/container? some where to run java servlets, such as tomcat.# What is BIND? DNS server.# What commands would you use under Solaris or Linux to modify/view an LDAP tree? ldapsearch, ldapadd/ldapmodify/ldapdelete, ldbmcat (openldap1), slapcat (openldap2)

Q3default portsHTTP : 80HTTPS: 443

1. What ports does FTP traffic travel over? 212. What ports does mail traffic utilize? SMTP 25, POP3 1103. What ports do HTTP and HTTPS use?HTTP 80, HTTPS 4434. Why is NTP required in an NFS network?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 sideDeepThroat, BladeRunner, Hackers Paradise6. What is CPAN? How do you access it?Perl programmer’s paradise!7. What is PEAR?PHP programmer’s paradise!8. What advantages does mod_perl have over a perl CGI?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 interpreterfor each request, using too much memory.mod_perl includes the Perl interpreter

Page 51: Linux Windows Networking Interview Questions Asked 11111

51

within Apache.9. What is required to do SSL in Apache 1.x?10. What is Tcl? a scripting language “born out of frustration”used for rapid prototyping, GUIs, testing and CGI scripting11. What is a servlet engine/container?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).12. What is BIND?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.

MySQL and general database interview questionsBy admin | July 26, 2005

1. What is MySQL?2. What is Postgres?3. What are the basic steps in setting up an Oracle system?4. What is a stored procedure, and which databases support it?5. What is RMAN?6. What is the TDS protocol?7. What is required to connect to an oracle system remotely?8. In MySQL, how do I create a database?9. In MySQL, how do I grant access to a user to a specific database with read only

permissions?10.In MySQL, what table type is required for foreign keys to work?

MySql is a Relational database management system, provided from open source community. Currently fast growing and hight used RDBMS. MySql Developed by MySql AB.

Recovery Manager (or RMAN) is an Oracle provided utility for backing-up, restoring and recovering Oracle Databases. RMAN ships with the database server and doesn’t require a separate installation. The RMAN executable is located in your ORACLE_HOME/bin directory.

RE #10:http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.htmlForeign keys definitions are subject to the following conditions:Both tables must be InnoDB tables and they must not be TEMPORARY tables.In the referencing table, there must be an index where the foreign key columns are listed as the first columns in the same order. Such an index is created on the referencing table automatically if it does not exist.In the referenced table, there must be an index where the referenced columns are listed as the first columns in the same order.Index prefixes on foreign key columns are not supported. One consequence of this is that BLOB and TEXT columns cannot be included in a foreign key, because indexes on those columns must always include a prefix length.

Page 52: Linux Windows Networking Interview Questions Asked 11111

52

If the CONSTRAINT symbol clause is given, the symbol value must be unique in the database. If the clause is not given, InnoDB creates the name automatically.RE #4See: http://dev.mysql.com/doc/refman/5.0/en/stored-procedures.htmlStored routines (procedures and functions) are supported in MySQL 5.0. A stored procedure is a set of SQL statements that can be stored in the server. Once this has been done, clients don’t need to keep reissuing the individual statements but can refer to the stored procedure instead.Some situations where stored routines can be particularly useful:When multiple client applications are written in different languages or work on different platforms, but need to perform the same database operations.When security is paramount. Banks, for example, use stored procedures and functions for all common operations. This provides a consistent and secure environment, and routines can ensure that each operation is properly logged. In such a setup, applications and users would have no access to the database tables directly, but can only execute specific stored routines.Stored routines can provide improved performance because less information needs to be sent between the server and the client. The tradeoff is that this does increase the load on the database server because more of the work is done on the server side and less is done on the client (application) side. Consider this if many client machines (such as Web servers) are serviced by only one or a few database servers.Stored routines also allow you to have libraries of functions in the database server. This is a feature shared by modern application languages that allow such design internally (for example, by using classes). Using these client application language features is beneficial for the programmer even outside the scope of database use.MySQL follows the SQL:2003 syntax for stored routines, which is also used by IBM’s DB2.

General UNIX interview questionsBy admin | July 26, 2005

1. What are the main differences between Apache 1.x and 2.x?2. What does the “route” command do?3. What are the read/write/execute bits on a directory mean?4. What does iostat do?5. what does vmstat do?6. What does netstat do?7. What is the most graceful way to bring a system into single user mode?8. How do you determine disk usage?9. What is AWK?10.What is SED?11.What is the difference between binaries in /bin, and /usr/bin?12.What is a dynamically linked file?13.What is a statically linked file?14.QNo:10. What is SED?15.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.

16.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.

Page 53: Linux Windows Networking Interview Questions Asked 11111

53

17.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.

18.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}’

Access rights (read/write/execute) on a directory means:->read indicates that it is possible to list files in the directory.->write indicates that it is possible to delete or move files in the directory.->execute indicates that it is possible to read files in the directory provided we must have read permission on individual files of that directory.

Browse the following URL to get information about ‘route’ commandhttp://linux.about.com/od/commands/l/blcmdl8_route.htm

Q NO:4) To know about iostat command,browse the following url:http://www.scit.wlv.ac.uk/cgi-bin/mansec?1M+iostat

11. 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 wel as system administrator)12. 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.13. 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.

Comment #10 is in error with all answers11. What is the difference between binaries in /bin, and /usr/bin?Under Solaris, there is no difference. /bin is a symbolic link pointing to /usr/bin. Under Linux (RHAS3) /bin is seemingly for standard unix programs like vi, cp, mv, rm which you’d need in a single user environment where as /usr/bin contains programs you’d want for a multiuser environment. Keep in mind that sometimes /usr is a different disk partition and when you start up in single user mode you only have / mounted.The /sbin directories are *supposed to* contain statically linked programs. This mas morphed into the idea of bin for user programs, sbin for admin programs.12. What is a dynamically linked file?This is confusing because of the use of the word ‘file’. A dynamically linked program is one that, when executed, loads shared libraries from /lib or /usr/lib in order to execute. The idea is that most programs use many of the same functions, so include a copy of a common function in *every* program on the file system. Instead, the function is placed in a shared library and when the program starts executing, the library is loaded which provides the program access to the function.13. What is a statically linked file?As above, confusing due to the use of the word ‘file’. A statically linked program is

Page 54: Linux Windows Networking Interview Questions Asked 11111

54

one that contains all the information (libraries) it needs to run. It does not need to load additional libaries in order to execute.

for comment no: 12Mutex:Short for mutual exclusion object. In computer programming, a mutex is a program object that allows multiple program threads to share the same resource, such as file access, but not simultaneously. When a program is started, a mutex is created with a unique name. After this stage, any thread that needs the resource must lock the mutex from other threads while it is using the resource. The mutex is set to unlock when the data is no longer needed or the routine is finished.INode:a unique number associated with each filename. This number is used to look up an entry in the inode table which gives information on the type, size, and location of the file and the userid of the owner of the file.

Access rights (read/write/execute) on a directory means:execute permission allows a user to enter the directory and perform read/write/execute files according to the permissions of the file. But you cannot ‘ls’ the directory until you have a read permission.It means you should know the filename.eg:[amar@darkstar ~]$ ls -l | grep Bookd–x—— 6 amar amar 4096 Sep 5 11:27 BookScripting # directory only hasexecute permission[amar@darkstar ~]$ ls -l BookScripting/ # no read permissionls: BookScripting/: Permission denied # so ‘ls -l’ denied[amar@darkstar ~]$ ls -l BookScripting/test.sh-r-x—— 1 amar amar 37 Sep 5 11:27 BookScripting/test.sh[amar@darkstar ~]$ BookScripting/test.shyou can execute[amar@darkstar ~]$

Typical usage of route:/sbin/route -n:DISPLAY KERNEL ROUTING TABLES.

Linux / Unix Command: route

 Command Library

NAME

route - show / manipulate the IP routing table

SYNOPSIS

route [-CFvnee]

Page 55: Linux Windows Networking Interview Questions Asked 11111

55

route

[-v] [-A family] add [-net|-host] target [netmask Nm] [gw Gw] [metric N] [mss M] [window W] [irtt I] [reject] [mod] [dyn] [reinstate] [[dev] If]

route

[-v] [-A family] del [-net|-host] target [gw Gw] [netmask Nm] [metric N] [[dev] If]

route

[-V] [--version] [-h] [--help]

DESCRIPTION

Route manipulates the kernel's IP routing tables. Its primary use is to set up static routes to specific hosts or networks via an interface after it has been configured with theifconfig(8) program.

When the add or del options are used, route modifies the routing tables. Without these options, route displays the current contents of the routing tables.

OPTIONS

-A family

use the specified address family (eg `inet'; use `route --help' for a full list).

-F

operate on the kernel's FIB (Forwarding Information Base) routing table. This is the default.

-C

operate on the kernel's routing cache.

-v

select verbose operation.

-n

show numerical addresses instead of trying to determine symbolic host names. This is useful if you are trying to determine why the route to your nameserver has vanished.

-e

use netstat(8)-format for displaying the routing table. -ee will generate a very long line with all parameters from the routing table.

del

delete a route.

add

add a new route.

Page 56: Linux Windows Networking Interview Questions Asked 11111

56

target

the destination network or host. You can provide IP addresses in dotted decimal or host/network names.

-net

the target is a network.

-host

the target is a host.

netmask NM

when adding a network route, the netmask to be used.

gw GW

route packets via a gateway. NOTE: The specified gateway must be reachable first. This usually means that you have to set up a static route to the gateway beforehand. If you specify the address of one of your local interfaces, it will be used to decide about the interface to which the packets should be routed to. This is a BSDism compatibility hack.

metric M

set the metric field in the routing table (used by routing daemons) to M.

mss M

set the TCP Maximum Segment Size (MSS) for connections over this route to M bytes. The default is the device MTU minus headers, or a lower MTU when path mtu discovery occured. This setting can be used to force smaller TCP packets on the other end when path mtu discovery does not work (usually because of misconfigured firewalls that block ICMP Fragmentation Needed)

window W

set the TCP window size for connections over this route to W bytes. This is typically only used on AX.25 networks and with drivers unable to handle back to back frames.

irtt I

set the initial round trip time (irtt) for TCP connections over this route to I milliseconds (1-12000). This is typically only used on AX.25 networks. If omitted the RFC 1122 default of 300ms is used.

reject

install a blocking route, which will force a route lookup to fail. This is for example used to mask out networks before using the default route. This is NOT for firewalling.

mod, dyn, reinstate

install a dynamic or modified route. These flags are for diagnostic purposes, and are generally only set by routing daemons.

dev If

Page 57: Linux Windows Networking Interview Questions Asked 11111

57

force the route to be associated with the specified device, as the kernel will otherwise try to determine the device on its own (by checking already existing routes and device specifications, and where the route is added to). In most normal networks you won't need this.

If dev If is the last option on the command line, the word dev may be omitted, as it's the default. Otherwise the order of the route modifiers (metric - netmask - gw - dev) doesn't matter.

EXAMPLES

route add -net 127.0.0.0

adds the normal loopback entry, using netmask 255.0.0.0 (class A net, determined from the destination address) and associated with the "lo" device (assuming this device was prviously set up correctly with ifconfig(8)).

route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0

adds a route to the network 192.56.76.x via "eth0". The Class C netmask modifier is not really necessary here because 192.* is a Class C IP address. The word "dev" can be omitted here.

route add default gw mango-gwadds a default route (which will be used if no other route matches). All packets using this route will be gatewayed through "mango-gw". The device which will actually be used for that route depends on how we can reach "mango-gw" - the static route to "mango-gw" will have to be set up before.

route add ipx4 sl0Adds the route to the "ipx4" host via the SLIP interface (assuming that "ipx4" is the SLIP host).

route add -net 192.57.66.0 netmask 255.255.255.0 gw ipx4

This command adds the net "192.57.66.x" to be gatewayed through the former route to the SLIP interface.

route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0

This is an obscure one documented so people know how to do it. This sets all of the class D (multicast) IP routes to go via "eth0". This is the correct normal configuration line with a multicasting kernel.

route add -net 10.0.0.0 netmask 255.0.0.0 reject

This installs a rejecting route for the private network "10.x.x.x."

OUTPUT

The output of the kernel routing table is organized in the following columns

Page 58: Linux Windows Networking Interview Questions Asked 11111

58

DestinationThe destination network or destination host.

GatewayThe gateway address or '*' if none set.

GenmaskThe netmask for the destination net; '255.255.255.255' for a host destination and '0.0.0.0' for the default route.

FlagsPossible flags includeU (route is up)H (target is a host)G (use gateway)R (reinstate route for dynamic routing)D (dynamically installed by daemon or redirect)M (modified from routing daemon or redirect)A (installed by addrconf)C (cache entry)! (reject route)

MetricThe 'distance' to the target (usually counted in hops). It is not used by recent kernels, but may be needed by routing daemons.

RefNumber of references to this route. (Not used in the Linux kernel.)

UseCount of lookups for the route. Depending on the use of -F and -C this will be either route cache misses (-F) or hits (-C).

IfaceInterface to which packets for this route will be sent.

MSSDefault maximum segement size for TCP connections over this route.

WindowDefault window size for TCP connections over this route.

irttInitial RTT (Round Trip Time). The kernel uses this to guess about the best TCP protocol parameters without waiting on (possibly slow) answers.

Page 59: Linux Windows Networking Interview Questions Asked 11111

59

HH (cached only)

The number of ARP entries and cached routes that refer to the hardware header cache for the cached route. This will be -1 if a hardware address is not needed for the interface of the cached route (e.g. lo).

Arp (cached only)

Whether or not the hardware address for the cached route is up to date.

Linux / Unix Command: ifconfig

 Command Library

Ads

HydraDICOMWorld first DICOM proxy Download demo at:hydradicom.com

Embedded Industrial PCsDownload comparison guide and request a quote and sample todaywww.lannerinc.com

Fast Malloc for MulticoreUse Hoard: Fast, Scalable Malloc Speed up your code-Win/Linux/OS Xwww.Hoard.org

NAME

ifconfig - configure a network interface

EXAMPLES

SYNOPSIS

ifconfig [interface] ifconfig interface [aftype] options | address ...

DESCRIPTION

Ifconfig is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. After that, it is usually only needed when debugging or when system tuning is needed.

If no arguments are given, ifconfig displays the status of the currently active interfaces. If a single interface argument is given, it displays the status of the given interface only; if a single -a argument is given, it displays the status of all interfaces, even those that are down. Otherwise, it configures an interface.

Address Families

If the first argument after the interface name is recognized as the name of a supported address family, that address family is used for decoding and displaying all protocol addresses. Currently supported address 

Page 60: Linux Windows Networking Interview Questions Asked 11111

60

families include inet (TCP/IP, default), inet6(IPv6), ax25 (AMPR Packet Radio), ddp (Appletalk Phase 2), ipx (Novell IPX) and netrom(AMPR Packet radio).

OPTIONS

interface

The name of the interface. This is usually a driver name followed by a unit number, for example eth0 for the first Ethernet interface.

up

This flag causes the interface to be activated. It is implicitly specified if an address is assigned to the interface.

down

This flag causes the driver for this interface to be shut down.

[-]arp

Enable or disable the use of the ARP protocol on this interface.

[-]promisc

Enable or disable the promiscuous mode of the interface. If selected, all packets on the network will be received by the interface.

[-]allmulti

Enable or disable all-multicast mode. If selected, all multicast packets on the network will be received by the interface.

metric N

This parameter sets the interface metric.

mtu N

This parameter sets the Maximum Transfer Unit (MTU) of an interface.

dstaddr addr

Set the remote IP address for a point-to-point link (such as PPP). This keyword is now obsolete; use the pointopoint keyword instead.

netmask addr

Set the IP network mask for this interface. This value defaults to the usual class A, B or C network mask (as derived from the interface IP address), but it can be set to any value.

add addr/prefixlen

Add an IPv6 address to an interface.

del addr/prefixlen

Page 61: Linux Windows Networking Interview Questions Asked 11111

61

Remove an IPv6 address from an interface.

tunnel aa.bb.cc.dd

Create a new SIT (IPv6-in-IPv4) device, tunnelling to the given destination.

irq addr

Set the interrupt line used by this device. Not all devices can dynamically change their IRQ setting.

io_addr addr

Set the start address in I/O space for this device.

mem_start addr

Set the start address for shared memory used by this device. Only a few devices need this.

media type

Set the physical port or medium type to be used by the device. Not all devices can change this setting, and those that can vary in what values they support. Typical values for type are 10base2 (thin Ethernet), 10baseT (twisted-pair 10Mbps Ethernet), AUI (external transceiver) and so on. The special medium type of auto can be used to tell the driver to auto-sense the media. Again, not all drivers can do this.

[-]broadcast [addr]

If the address argument is given, set the protocol broadcast address for this interface. Otherwise, set (or clear) the IFF_BROADCAST flag for the interface.

[-]pointopoint [addr]

This keyword enables the point-to-point mode of an interface, meaning that it is a direct link between two machines with nobody else listening on it. If the address argument is also given, set the protocol address of the other side of the link, just like the obsolete dstaddr keyword does. Otherwise, set or clear theIFF_POINTOPOINT flag for the interface.

hw class address

Set the hardware address of this interface, if the device driver supports this operation. The keyword must be followed by the name of the hardware class and the printable ASCII equivalent of the hardware address. Hardware classes currently supported include ether (Ethernet), ax25 (AMPR AX.25), ARCnet and netrom (AMPR NET/ROM).

multicast

Set the multicast flag on the interface. This should not normally be needed as the drivers set the flag correctly themselves.

address

The IP address to be assigned to this interface.

txqueuelen length

Page 62: Linux Windows Networking Interview Questions Asked 11111

62

Set the length of the transmit queue of the device. It is useful to set this to small values for slower devices with a high latency (modem links, ISDN) to prevent fast bulk transfers from disturbing interactive traffic like telnet too much.

Linux / Unix Command: netstat

 Command Library

NAME

netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships

EXAMPLES

SYNOPSIS

netstat [address_family_options] [--tcp|-t] [--udp|-u] [--raw|-w] [--listening|-l] [--all|-a] [--numeric|-n] [--numeric-hosts][--numeric-ports][--numeric-ports] [--symbolic|-N] [--extend|-e[--extend|-e]] [--timers|-o] [--program|-p] [--verbose|-v] [--continuous|-c][delay] netstat {--route|-r} [address_family_options] [--extend|-e[--extend|-e]] [--verbose|-v] [--numeric|-n] [--numeric-hosts][--numeric-ports][--numeric-ports] [--continuous|-c] [delay] netstat {--interfaces|-i} [iface] [--all|-a] [--extend|-e[--extend|-e]] [--verbose|-v] [--program|-p] [--numeric|-n] [--numeric-hosts][--numeric-ports][--numeric-ports] [--continuous|-c] [delay] netstat {--groups|-g} [--numeric|-n] [--numeric-hosts][--numeric-ports][--numeric-ports] [--continuous|-c] [delay] netstat {--masquerade|-M} [--extend|-e] [--numeric|-n] [--numeric-hosts][--numeric-ports][--numeric-ports] [--continuous|-c] [delay] netstat {--statistics|-s} [--tcp|-t] [--udp|-u] [--raw|-w] [delay] netstat {--version|-V} netstat {--help|-h} address_family_options:

[--protocol={inet,unix,ipx,ax25,netrom,ddp}[,...]] [--unix|-x] [--inet|--ip] [--ax25] [--ipx] [--netrom] [--ddp]

DESCRIPTION

Netstat prints information about the Linux networking subsystem. The type of information printed is controlled by the first argument, as follows:

(none)

By default, netstat displays a list of open sockets. If you don't specify any address families, then the active sockets of all configured address families will be printed.

--route , -r

Display the kernel routing tables.

--groups , -g

Display multicast group membership information for IPv4 and IPv6.

--interface=iface , -i

Display a table of all network interfaces, or the specified iface).

--masquerade , -M

Page 63: Linux Windows Networking Interview Questions Asked 11111

63

Display a list of masqueraded connections.

--statistics , -s

Display summary statistics for each protocol.

OPTIONS

--verbose , -v

Ads

Bare Metal RestoreFast system recovery and backup Recover to dissimilar hardwarewww.cristie.com

Burn-In Sockets AvailableFind Sockets For BGA, DIP, CPC etc. Huge Range Available. Purchase Now!www.AriesElec.com

HydraDICOMWorld first DICOM proxy Download demo at:hydradicom.com

Tell the user what is going on by being verbose. Especially print some useful information about unconfigured address families.

--numeric , -n

Show numerical addresses instead of trying to determine symbolic host, port or user names.

--numeric-hosts

shows numerical host addresses but does not affect the resolution of port or user names.

--numeric-ports

shows numerical port numbers but does not affect the resolution of host or user names.

--numeric-users

shows numerical user IDs but does not affect the resolution of host or port names.

--protocol=family , -A

Specifies the address families (perhaps better described as low level protocols) for which connections are to be shown. family is a comma (',') separated list of address family keywords like inet, unix, ipx, ax25, netrom, and ddp. This has the same effect as using the --inet, --unix (-x), --ipx, --ax25, --netrom, and --ddp options. The address family inetincludes raw, udp and tcp protocol sockets.

-c, --continuous

This will cause netstat to print the selected information every second continuously.

-e, --extend

Display additional information. Use this option twice for maximum detail.

-o, --timers

Include information related to networking timers.

Page 64: Linux Windows Networking Interview Questions Asked 11111

64

-p, --program

Show the PID and name of the program to which each socket belongs.

-l, --listening

Show only listening sockets. (These are omitted by default.)

-a, --all

Show both listening and non-listening sockets. With the --interfaces option, show interfaces that are not marked

-F

Print routing information from the FIB. (This is the default.)

-C

Print routing information from the route cache.

delay

Netstat will cycle printing through statistics every delay seconds. UP.

OUTPUT

Active Internet connections (TCP, UDP, raw)

Proto

The protocol (tcp, udp, raw) used by the socket.

Recv-Q

The count of bytes not copied by the user program connected to this socket.

Send-Q

The count of bytes not acknowledged by the remote host.

Local Address

Address and port number of the local end of the socket. Unless the --numeric (-n) option is specified, the socket address is resolved to its canonical host name (FQDN), and the port number is translated into the corresponding service name.

Foreign Address

Address and port number of the remote end of the socket. Analogous to "Local Address."

State

The state of the socket. Since there are no states in raw mode and usually no states used in UDP, this column may be left blank. Normally this can be one of several values:

ESTABLISHED

Page 65: Linux Windows Networking Interview Questions Asked 11111

65

The socket has an established connection.

SYN_SENT

The socket is actively attempting to establish a connection.

SYN_RECV

A connection request has been received from the network.

FIN_WAIT1

The socket is closed, and the connection is shutting down.

FIN_WAIT2

Connection is closed, and the socket is waiting for a shutdown from the remote end.

TIME_WAIT

The socket is waiting after close to handle packets still in the network.

CLOSED

The socket is not being used.

CLOSE_WAIT

The remote end has shut down, waiting for the socket to close.

LAST_ACK

The remote end has shut down, and the socket is closed. Waiting for acknowledgement.

LISTEN

The socket is listening for incoming connections. Such sockets are not included in the output unless you specify the --listening (-l) or --all (-a) option.

CLOSING

Both sockets are shut down but we still don't have all our data sent.

UNKNOWN

The state of the socket is unknown.

User

The username or the user id (UID) of the owner of the socket.

PID/Program name

Slash-separated pair of the process id (PID) and process name of the process that owns the socket. --program causes this column to be included. You will also need superuserprivileges to see this information on sockets you don't own. This identification information is not yet available for IPX sockets.

Page 66: Linux Windows Networking Interview Questions Asked 11111

66

Timer

(this needs to be written)

Active UNIX domain Sockets

Proto

The protocol (usually unix) used by the socket.

RefCnt

The reference count (i.e. attached processes via this socket).

Flags

The flags displayed is SO_ACCEPTON (displayed as ACC), SO_WAITDATA (W) or SO_NOSPACE (N). SO_ACCECPTON is used on unconnected sockets if their corresponding processes are waiting for a connect request. The other flags are not of normal interest.

Type

There are several types of socket access:

SOCK_DGRAM

The socket is used in Datagram (connectionless) mode.

SOCK_STREAM

This is a stream (connection) socket.

SOCK_RAW

The socket is used as a raw socket.

SOCK_RDM

This one serves reliably-delivered messages.

SOCK_SEQPACKET

This is a sequential packet socket.

SOCK_PACKET

Raw interface access socket.

UNKNOWN

Who ever knows what the future will bring us - just fill in here :-)

State

This field will contain one of the following Keywords:

FREE

Page 67: Linux Windows Networking Interview Questions Asked 11111

67

The socket is not allocated

LISTENING

The socket is listening for a connection request. Such sockets are only included in the output if you specify the --listening (-l) or --all (-a) option.

CONNECTING

The socket is about to establish a connection.

CONNECTED

The socket is connected.

DISCONNECTING

The socket is disconnecting.

(empty)

The socket is not connected to another one.

UNKNOWN

This state should never happen.

PID/Program name

Process ID (PID) and process name of the process that has the socket open. More info available in Active Internet connections section written above.

Path

This is the path name as which the corresponding processes attached to the socket.

Active IPX sockets

(this needs to be done by somebody who knows it)

Active NET/ROM sockets

(this needs to be done by somebody who knows it)

Active AX.25 sockets

(this needs to be done by somebody who knows it)

5.7.2. Ethernet Interfaces

Configuring an Ethernet interface is pretty much the same as the loopback interface; it just requires a few more parameters when you are using subnetting.

Page 68: Linux Windows Networking Interview Questions Asked 11111

68

At the Virtual Brewery, we have subnetted the IP network, which was originally a class B network, into class C subnetworks. To make the interface recognize this, the ifconfigincantation would look like this:

   

# ifconfig eth0 vstout netmask 255.255.255.0

This command assigns the eth0 interface the IP address of vstout (172.16.1.2 ). If we omitted the netmask, ifconfig would deduce the netmask from the IP network class, which would result in an incorrect netmask of 255.255.0.0 . Now a quick check shows:

   

# ifconfig eth0eth0 Link encap 10Mps Ethernet HWaddr 00:00:C0:90:B3:42inet addr 172.16.1.2 Bcast 172.16.1.255 Mask 255.255.255.0UP BROADCAST RUNNING MTU 1500 Metric 1RX packets 0 errors 0 dropped 0 overrun 0TX packets 0 errors 0 dropped 0 overrun 0

You can see that ifconfig automatically sets the broadcast address (the Bcast field) to the usual value, which is the host's network number with all the host bits set. Also, the maximum transmission unit (the maximum size of IP datagrams the kernel will generate for this interface) has been set to the maximum size of Ethernet packets: 1,500 bytes. The defaults are usually what you will use, but all these values can be overidden if required, with special options that will be described under Section 5.8 ".

Just as for the loopback interface, you now have to install a routing entry that informs the kernel about the network that can be reached through eth0 . For the Virtual Brewery, you might invoke route as:

   

# route add -net 172.16.1.0

At first this looks a little like magic, because it's not really clear how route detects which interface to route through. However, the trick is rather simple: the kernel checks all interfaces that have been configured so far and compares the destination address (172.16.1.0 in this case) to the network part of the interface address (that is, the bitwise AND of the interface address and the netmask). The only interface that matches is eth0 .

Now, what's that –net option for? This is used because route can handle both routes to networks and routes to single hosts (as you saw before with localhost ). When given an address in dotted quad notation, route attempts to guess whether it is a network or a hostname by looking at the host part bits. If the address's host part is zero, route assumes it denotes a network; otherwise, route takes it as a host address. Therefore, route would think that 172.16.1.0 is a host address rather than a

Page 69: Linux Windows Networking Interview Questions Asked 11111

69

network number, because it cannot know that we use subnetting. We have to tell route explicitly that it denotes a network, so we give it the –net flag.

Of course, the route command is a little tedious to type, and it's prone to spelling mistakes. A more convenient approach is to use the network names we defined in /etc/networks . This approach makes the command much more readable; even the –net flag can be omitted because route knows that 172.16.1.0 denotes a network:

   

# route add brew-net

Now that you've finished the basic configuration steps, we want to make sure that your Ethernet interface is indeed running happily. Choose a host from your Ethernet, for instance vlager , and type:

   

# ping vlagerPING vlager: 64 byte packets64 bytes from 172.16.1.1: icmp_seq=0. time=11. ms64 bytes from 172.16.1.1: icmp_seq=1. time=7. ms64 bytes from 172.16.1.1: icmp_seq=2. time=12. ms64 bytes from 172.16.1.1: icmp_seq=3. time=3. ms^C----vstout.vbrew.com PING Statistics----4 packets transmitted, 4 packets

If you don't see similar output, something is broken. If you encounter unusual packet loss rates, this hints at a hardware problem, like bad or missing terminators. If you don't receive any replies at all, you should check the interface configuration with netstatdescribed later in Section 5.9 ". The packet statistics displayed by ifconfig should tell you whether any packets have been sent out on the interface at all. If you have access to the remote host too, you should go over to that machine and check the interface statistics. This way you can determine exactly where the packets got dropped. In addition, you should display the routing information with route to see if both hosts have the correct routing entry. route prints out the complete kernel routing table when invoked without any arguments (–n just makes it print addresses as dotted quad instead of using the hostname):

   

# route -nKernel routing tableDestination Gateway Genmask Flags Metric Ref Use Iface127.0.0.1 * 255.255.255.255 UH 1 0 112 lo172.16.1.0 * 255.255.255.0 U 1 0 10 eth0

Page 70: Linux Windows Networking Interview Questions Asked 11111

70

The detailed meaning of these fields is explained later in Section 5.9 ." The Flags column contains a list of flags set for each interface. U is always set for active interfaces, and H says the destination address denotes a host. If the H flag is set for a route that you meant to be a network route, you have to reissue the route command with the –net option. To check whether a route you have entered is used at all, check to see if the Use field in the second to last column increases between two invocations of ping .

Network administrator interview questionsBy admin | July 26, 2005

1. What is the difference between layer 2 and layer 3 in the OSI model?2. What is the difference between a hub, switch, and router?3. What is a VLAN?4. What is the difference between TCP and UDP?5. How do you distinguish a DNS problem from a network problem?6. What is a runt, Giant, and collision?7. What is a broadcast storm?8. What is the purpose of VRRP?9. What is a VPN?10.What information about a peer would I need to establish a VPN?11.What is a full-class C in CIDR notation?12.What is a default route?13.What is a metric?14.What is a MAC address?15.What is ARP/RARP?16.Describe a TCP connection sequence17.What is MTU?18.What other TCP setting can you modify besides MTU to shorten packets?19.What is the difference between TCP and UDP20.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.

21.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.

22.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

What is a MAC address?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).

What is MTUThe 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

Page 71: Linux Windows Networking Interview Questions Asked 11111

71

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.

Ques 2: Diffrence Betw. Switch , Hub, Router..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.

Ques 12: Default Route…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..

Ques 15: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)

What is the difference between layer 2 and layer 3 in the OSI model?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.

6)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.

Page 72: Linux Windows Networking Interview Questions Asked 11111

72

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.

3.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.

What is a VPN?A VPN stands for Virtual Private Network. In english it is a direct tunnel into a remote network. It allows users to work with certain applications, printers, network drives and shares as if they where sitting in the office.

How do you distinguish a DNS problem from a network problem?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.

7 Broadcast StormA 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.What is a metric?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:•Path length•Reliability•Delay•Bandwidth•Load•Communication cost

Page 73: Linux Windows Networking Interview Questions Asked 11111

73

What is Socket?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.

Describe a TCP connection sequence?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

how to configure DNS in windows O/S with the command or stepes….?Netsh commands for Interface IP. You can use commands in the Netsh Interface IP context to configure the TCP/IP protocol (including addresses, default gateways, DNS servers, and WINS servers) and to display configuration and statistical information.USE HELP COMMAND FOR MORE INFORMATION (netsh/?)

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.

what is ospf?

Page 74: Linux Windows Networking Interview Questions Asked 11111

74

– Open Sortest Path First(ospf) is an interior gatway routing protocol(IGP). developed by Internet Engineering Task Force(IETF) in 1988.OSPF is universal routing protocol. can be used by anybody. Its a link state protocol. many advantages over distance vector protocols like fast convergance,etc.Question 11What is a full-class C in CIDR notationCIDR specifies an IP address range using a combination of an IP address and its associated network mask. CIDR notation uses the following format -xxx.xxx.xxx.xxx/nFull Class C in CIDR notation can be represented byExample 10.16.0.0/16This is a 256 class C = FIRST CLASS BNow they here are a few more10.16.0.0/17 is a 128 class C10.16.0.0/16 is a 64 class C and so on.

Page 75: Linux Windows Networking Interview Questions Asked 11111

75

screening questions for Windows adminBy admin | January 27, 2008

1. What is Active Directory?2. What is LDAP?3. Can you connect Active Directory to other 3rd-party Directory Services? Name

a few options.4. Where is the AD database held? What other folders are related to AD?5. What is the SYSVOL folder?6. Name the AD NCs and replication issues for each NC7. What are application partitions? When do I use them8. How do you create a new application partition9. How do you view replication properties for AD partitions and DCs?10.What is the Global Catalog?11.How do you view all the GCs in the forest?12.Why not make all DCs in a large forest as GCs?13.Trying to look at the Schema, how can I do that?14.What are the Support Tools? Why do I need them?15.What is LDP? What is REPLMON? What is ADSIEDIT? What is NETDOM? What

is REPADMIN?16.What are sites? What are they used for?17.What’s the difference between a site link’s schedule and interval?18.What is the KCC?19.What is the ISTG? Who has that role by default?20.What are the requirements for installing AD on a new server?21.What can you do to promote a server to DC if you’re in a remote location with

slow WAN link?22.How can you forcibly remove AD from a server, and what do you do later? Ã

¢â‚¬Â¢ Can I get user passwords from the AD database?23.What tool would I use to try to grab security related packets from the wire?24.Name some OU design considerations.25.What is tombstone lifetime attribute?26.What do you do to install a new Windows 2003 DC in a Windows 2000 AD?27.What do you do to install a new Windows 2003 R2 DC in a Windows 2003 AD?28.How would you find all users that have not logged on since last month?29.What are the DS* commands?30.What’s the difference between LDIFDE and CSVDE? Usage considerations?31.What are the FSMO roles? Who has them by default? What happens when each

one fails?32.What FSMO placement considerations do you know of?33.I want to look at the RID allocation table for a DC. What do I do?34.What’s the difference between transferring a FSMO role and seizing one?

Which one should you NOT seize? Why?35.How do you configure a “stand-by operation master†� for any of

the roles?36.How do you backup AD?37.How do you restore AD?38.How do you change the DS Restore admin password?39.Why can’t you restore a DC that was backed up 4 months ago?40.What are GPOs?41.What is the order in which GPOs are applied?42.Name a few benefits of using GPMC.43.What are the GPC and the GPT? Where can I find them?44.What are GPO links? What special things can I do to them?

Page 76: Linux Windows Networking Interview Questions Asked 11111

76

45.What can I do to prevent inheritance from above?46.How can I override blocking of inheritance?47.How can you determine what GPO was and was not applied for a user? Name a

few ways to do that.48.A user claims he did not receive a GPO, yet his user and computer accounts are

in the right OU, and everyone else there gets the GPO. What will you look for?49.Name a few differences in Vista GPOs50.Name some GPO settings in the computer and user parts.51.What are administrative templates?52.What’s the difference between software publishing and assigning?53.Can I deploy non-MSI software with GPO?54.You want to standardize the desktop environments (wallpaper, My Documents,

Start menu, printers etc.) on the computers in one department. How would you do that?

55.Que.: What is Active Directory?56.Ans. Active Directory is a Meta Data. Active Directory is a data base which

store a data base like your user information, computer information and also other network object info. It has capabilities to manage and administor the complite Network which connect with AD.

Que.: What is the Global Catalog?Ans.: Global Catalog is a server which maintains the information about multiple domain with trust relationship agreement..

Que: What is Active Directory?Ans: Active Directory directory service is an extensible and scalable directory service that enables you to manage network resources efficiently.

Q01: What is Active Directory?Ans:Active Directory is directory service that stores information about objects on a network and makes this information available to users and network administrators.Active Directory gives network users access to permitted resources anywhere on the network using a single logon process.It provides network administrators with an intuitive, hierarchical view of the network and a single point of administration3for all network objects.

Q2: What is LDAP?Ans2: LDAP(light weight directory accerss protocol) is an internet protocol which Email and other services is used to look up information from the server.

Q 18: What is KCC ?Ans 18: KCC ( knowledge consistency checker ) is used to generate replication topology for inter site replication and for intrasite replication.with in a site replication traffic is done via remote procedure calls over ip, while between site it is done through either RPC or SMTP.

Q 10: What is Global Catalog Server ?Ans 10 : Global Catalog Server is basically a container where you put the same type of member ,computer etc and applied the policies and security on the catalog server in place of individual user or computer.

Page 77: Linux Windows Networking Interview Questions Asked 11111

77

Q 10 : what is Global catalog server GC?Ans : i m sorry i was given wrong ans of this question above but now im giving the exact ans of this question, and th ans which iwas given previously is the ans of Organisatinal Unit not of GC….. and the ans isThe global catalog is a distributed data repository that contains a searchable, partial representation of every object in every domain in a multidomain Active Directory forest. The global catalog is stored on domain controllers that have been designated as global catalog servers and is distributed through multimaster replication. Searches that are directed to the global catalog are faster because they do not involve referrals to different domain controllers.

Q 4: Where is the AD database held? What other folders are related to AD?A 4: The AD data base is store in NTDS.DIT.file

 5 :  What is the SYSVOL folder?A 5; The sysVOL folder stores the server’s copy of the domain’s public files. The contents such as group policy, users etc of the sysvol folder are replicated to all domain controllers in the domain.

Q 19: What is the ISTG? Who has that role by default?A 19: Windows 2000 Domain controllers each create Active Directory Replication connection objects representing inbound replication from intra-site replication partners. For inter-site replication, one domain controller per site has the responsibility of evaluating the inter-site replication topology and creating Active Directory Replication Connection objects for appropriate bridgehead servers within its site. The domain controller in each site that owns this role is referred to as the Inter-Site Topology Generator (ISTG).

Q :15 What is LDP? What is REPLMON? What is ADSIEDIT? What is NETDOM? What is REPADMIN?A 15 : LDP : Label Distribution Protocol (LDP) is often used to establish MPLS LSPs when traffic engineering is not required. It establishes LSPs that follow the existing IP routing, and is particularly well suited for establishing a full mesh of LSPs between all of the routers on the network.Replmon : Replmon displays information about Active Directory Replication.ADSIEDIT :ADSIEdit is a Microsoft Management Console (MMC) snap-in that acts as a low-level editor for Active Directory. It is a Graphical User Interface (GUI) tool. Network administrators can use it for common administrative tasks such as adding, deleting, and moving objects with a directory service. The attributes for each object can be edited or deleted by using this tool. ADSIEdit uses the ADSI application programming interfaces (APIs) to access Active Directory. The following are the required files for using this tool: ADSIEDIT.DLLADSIEDIT.MSCNETDOM : NETDOM is a command-line tool that allows management of Windows domains and trust relationships. It is used for batch management of trusts, joining computers to domains, verifying trusts, and secure channels.REPADMIN :This command-line tool assists administrators in diagnosing replication problems between Windows domain controllers.Administrators can use Repadmin to view the replication topology (sometimes referred to as RepsFrom and RepsTo) as seen from the perspective of each domain controller. In addition, Repadmin can be used to

Page 78: Linux Windows Networking Interview Questions Asked 11111

78

manually create the replication topology (although in normal practice this should not be necessary), to force replication events between domain controllers, and to view both the replication metadata and up-to-dateness vectors.

Q 36: how to take backup of AD ?A 36 : for taking backup of active directory you have to do this :first go to START -> PROGRAM ->ACCESORIES -> SYSTEM TOOLS -> BACKUPwhen the backup screen is flash then take the backup of SYSTEM STATE it will take the backup of all the necessary information about the syatem including AD backup , DNS ETC.

w to restore the AD  ?a 37 : For ths do the same as above in the question 36 but in place of backup you select the restore option and restore the system state .

Q 19: What is the ISTG? Who has that role by default?A 19: Inter-Site Topology Generator(istg)  is responsible for managing the inbound replication connection objects for all bridgehead servers in the site in which it is located. This domain controller is known as the Inter-Site Topology Generator (ISTG). The domain controller holding this role may not necessarily also be a bridgehead server.

Q 29 :What are the DS* commands A 29 : You really are spoilt for choice when it comes to scripting tools for creating Active Directory objects.  In addition to CSVDE, LDIFDE and VBScript, we now have the following DS commands: the da family built in utility DSmod - modify Active Directory attributesDSrm - to delete Active Directory objectsDSmove - to relocate objectsDSadd - create new accounts DSquery - to find objects that match your query attributes DSget - list the properties of an object

Q 30 :What’s the difference between LDIFDE and CSVDE? Usage considerations?A 30 : CSVDE is a command that can be used to import and export objects to and from the AD into a CSV-formatted file. A CSV (Comma Separated Value) file is a file easily readable in Excel. I will not go to length into this powerful command, but I will show you some basic samples of how to import a large number of users into your AD. Of course, as with the DSADD command, CSVDE can do more than just import users. Consult your help file for more info.Like CSVDE, LDIFDE is a command that can be used to import and export objects to and from the AD into a LDIF-formatted file. A LDIF (LDAP Data Interchange Format) file is a file easily readable in any text editor, however it is not readable in programs like Excel. The major difference between CSVDE and LDIFDE (besides the file format) is the fact that LDIFDE can be used to edit and delete existing AD objects (not just users), while CSVDE can only import and export objects.

Q 25 : What is tombstone lifetime attribute?A 25 : The number of days before a deleted object is removed from the directory services. This assists in removing objects from replicated servers and preventing restores from reintroducing a deleted object. This value is in the Directory Service object in the configuration NIC.

Page 79: Linux Windows Networking Interview Questions Asked 11111

79

You want to standardize the desktop environments (wallpaper, My Documents, Start menu, printers etc.) on the computers in one department. How would you do that? How it is possibal

(20)What are the requirements for installing AD on a new server?Ans:1)The Domain structure2)The Domain Name3)storage location of the database and log file4)Location of the shared system volume folder5)DNS config Methode6)DNS configuration

7. What are application partitions? When do I use them.Ans: AN application diretcory partition is a directory partition that is replicated only to specific domain controller.Only domain controller running windows Server 2003 can host a replica of application directory partition.Using an application directory partition provides redundany,availabiltiy or fault tolerance by replicating data to specific domain controller pr any set of domain controllers anywhere in the forest

Q:You want to standardize the desktop environments (wallpaper, My Documents, Start menu, printers etc.) on the computers in one department. How would you do that? How it is possibal.Ans:Login on client as Domain Admin user change whatever you need add printers etc go to system-User profiles copy this user profile to any location by select Everyone in permitted to use after copy change ntuser.dat to ntuser.man and assgin this path under user profile

Q. 8. How do you create a new application partitionANS:Use the DnsCmd command to create an application directory partition. To do this, use the following syntax:DnsCmd ServerName /CreateDirectoryPartition FQDN of partition

How do you view all the GCs in the forest?AnsC:\>repadmin /showrepsdomain_controllerwhere domain_controller is the DC you want to query to determine whether it’s a GC. The output will include the text DSA Options: IS_GC if the DC is a GC. . . .

Trying to look at the Schema, how can I do thatAns:type “adsiedit.msc” in run or command prompt

Q. Can you connect Active Directory to other 3rd-party Directory Services? Name a few options.Ans. Yes, you can use dirXML or LDAP to connect to other directoriesIn Novell you can use E-directory

Q 38 :How do you change the DS Restore admin password ?

Page 80: Linux Windows Networking Interview Questions Asked 11111

80

Ans 38: A. In Windows 2000 Server, you used to have to boot the computer whose password you wanted to change in Directory Restore mode, then use either the Microsoft Management Console (MMC) Local User and Groups snap-in or the commandnet user administrator *to change the Administrator password. Win2K Server Service Pack 2 (SP2) introduced the Setpwd utility, which lets you reset the Directory Service Restore Mode password without having to reboot the computer. (Microsoft refreshed Setpwd in SP4 to improve the utility’s scripting options.)In Windows Server 2003, you use the Ntdsutil utility to modify the Directory Service Restore Mode Administrator password. To do so, follow these steps:1. Start Ntdsutil (click Start, Run; enter cmd.exe; then enter ntdsutil.exe).2. Start the Directory Service Restore Mode Administrator password-reset utility by entering the argument “set dsrm password” at the ntdsutil prompt:ntdsutil: set dsrm password3. Run the Reset Password command, passing the name of the server on which to change the password, or use the null argument to specify the local machine. For example, to reset the password on server thanos, enter the following argument at the Reset DSRM Administrator Password prompt:Reset DSRM Administrator Password: reset password on server thanosTo reset the password on the local machine, specify null as the server name:Reset DSRM Administrator Password: reset password on server null4. You’ll be prompted twice to enter the new password. You’ll see the following messages:5. Please type password for DS Restore Mode Administrator Account:6. Please confirm new password:Password has been set successfully.7. Exit the password-reset utility by typing “quit” at the following prompts:8. Reset DSRM Administrator Password: quitntdsutil: quit

Q.40: What are Group Policy objects (GPOs)?A.40: Group Policy objects, other than the local Group Policy object, are virtual objects. The policy setting information of a GPO is actually stored in two locations: the Group Policy container and the Group Policy template. The Group Policy container is an Active Directory container that stores GPO properties, including information on version, GPO status, and a list of components that have settings in the GPO. The Group Policy template is a folder structure within the file system that stores Administrative Template-based policies, security settings, script files, and information regarding applications that are available for Group Policy Software Installation. The Group Policy template is located in the system volume folder (Sysvol) in the \Policies subfolder for its domain.

Q 41 :What is the order in which GPOs are applied ?A 41: Group Policy settings are processed in the following order:1.Local Group Policy object �Each computer has exactly one Group Policy object that is stored locally. This processes for both computer and user Group Policy processing.2.Site �Any GPOs that have been linked to the site that the computer belongs to are processed next. Processing is in the order that is specified by the administrator, on the Linked Group Policy Objects tab for the site in Group Policy Management

Page 81: Linux Windows Networking Interview Questions Asked 11111

81

Console (GPMC). The GPO with the lowest link order is processed last, and therefore has the highest precedence.3.Domain �Processing of multiple domain-linked GPOs is in the order specified by the administrator, on the Linked Group Policy Objects tab for the domain in GPMC. The GPO with the lowest link order is processed last, and therefore has the highest precedence.4.Organizational units �GPOs that are linked to the organizational unit that is highest in the Active Directory hierarchy are processed first, then GPOs that are linked to its child organizational unit, and so on. Finally, the GPOs that are linked to the organizational unit that contains the user or computer are processed.At the level of each organizational unit in the Active Directory hierarchy, one, many, or no GPOs can be linked. If several GPOs are linked to an organizational unit, their processing is in the order that is specified by the administrator, on the Linked Group Policy Objects tab for the organizational unit in GPMC. The GPO with the lowest link order is processed last, and therefore has the highest precedence.This order means that the local GPO is processed first, and GPOs that are linked to the organizational unit of which the computer or user is a direct member are processed last, which overwrites settings in the earlier GPOs if there are conflicts. (If there are no conflicts, then the earlier and later settings are merely aggregated.)

This article will tell you how to add your first Windows 2003 DC to an existing Windows 2000 domain. This article is particularly useful if you have Windows 2000 servers that will be replaced by new hardware running Windows Server 2003.The first step is to install Windows 2003 on your new DC. This is a straighforward process, so we aren’t going to discuss that here.Because significant changes have been made to the Active Directory schema in Windows 2003, we need to make our Windows 2000 Active Directory compatible with the new version. If you already have Windows 2003 DCs running with Windows 2000 DCs, then you can skip down to the part about DNS.Before you attempt this step, you should make sure that you have service pack 4 installed on your Windows 2000 DC. Next, make sure that you are logged in as a user that is a member of the Schema Admin and Enterprise Admin groups. Next, insert the Windows 2003 Server installation CD into the Windows 2000 Server. Bring up a command line and change directories to the I386 directory on the installation CD. At the command prompt, type:Code :adprep /forestprepAfter running this command, make sure that the updates have been replicated to all existing Windows 2000 DCs in the forest.Next, we need to run the following command:Code :adprep /domainprepThe above command must be run on the Infrastructure Master of the domain by someone who is a member of the Domain Admins group.Once this is complete, we move back to the Windows 2003 Server. Click ’start’ then ‘run” - type in dcpromo and click OK. During the ensuing wizard, make sure that you select that you are adding this DC to an existing domain.After this process is complete, the server will reboot. When it comes back online, check and make sure that the AD database has been replicated to your new server.Next, you will want to check and make sure that DNS was installed on your new server. If not, go to the control panel, click on ‘Add or Remove Programs’, and click

Page 82: Linux Windows Networking Interview Questions Asked 11111

82

the ‘Add/Remove Windows Components’ button. In the Windows Components screen, click on ‘Networking Services’ and click the details button. In the new window check ‘Domain Name System (DNS)’ and then click the OK button. Click ‘Next’ in the Windows Components screen. This will install DNS and the server will reboot. After reboot, pull up the DNS Management window and make sure that your DNS settings have replicated from the Windows 2000 Server. You will need to re-enter any forwarders or other properties you had set up, but the DNS records should replicate on their own.The next 2 items, global catalog and FSMO roles, are important if you plan on decomissioning your Windows 2000 server(s). If this is the case, you need to transfer the global catalog from the old server to the new one.First, let’s create a global catalog on our new server. Here are the steps:1. On the domain controller where you want the new global catalog, start the Active Directory Sites and Services snap-in. To start the snap-in, click ‘Start’, point to ‘Programs’, point to ‘Administrative Tools’, and then click ‘Active Directory Sites and Services’.2. In the console tree, double-click ‘Sites’, and then double-click ’sitename’.3. Double-click ‘Servers’, click your domain controller, right-click ‘NTDS Settings’, and then click ‘Properties’.4. On the General tab, click to select the Global catalog check box to assign the role of global catalog to this server.5. Restart the domain controller.Make sure you allow sufficient time for the account and the schema information to replicate to the new global catalog server before you remove the global catalog from the original DC or take the DC offline.After this is complete, you will want to transfer or seize the FSMO roles for your new server. For instructions, read Using Ntdsutil.exe to transfer or seize FSMO roles to a domain controller.After this step is complete, we can now run DCPROMO on the Windows 2000 Servers in order to demote them. Once this is complete, copy over any files you need to your new server and you should have successfully replaced your Windows 2000 server(s) with a new Windows 2003 server(s

What are the requirements for installing AD on a new server?Win2K3 CDDNSStatic IP

You want to standardize the desktop environments (wallpaper, My Documents, Start menu, printers etc.) on the computers in one department. How would you do that?go to Start->programs->Administrative tools->Active Directory Users and ComputersRight Click on Domain->click on preopertiesOn New windows Click on Group PolicySelect Default Policy->click on Editon group Policy consolego to User Configuration->Administrative Template->Start menu and TaskbarSelect each property you want to modify and do the same

36.How do you backup AD?To backup AD we can use NTBACKUP… NTBACKUP backsup ntds.dit which is the database for AD

Page 83: Linux Windows Networking Interview Questions Asked 11111

83

Windows admin interview questions (includes Vista)By admin | November 29, 2007

1. What is Active Directory?2. What is LDAP?3. Can you connect Active Directory to other 3rd-party Directory Services? Name

a few options.4. Where is the AD database held? What other folders are related to AD?5. What is the SYSVOL folder?6. Name the AD NCs and replication issues for each NC7. What are application partitions? When do I use them8. How do you create a new application partition9. How do you view replication properties for AD partitions and DCs?10.What is the Global Catalog?11.How do you view all the GCs in the forest?12.Why not make all DCs in a large forest as GCs?13.Trying to look at the Schema, how can I do that?14.What are the Support Tools? Why do I need them?15.What is LDP? What is REPLMON? What is ADSIEDIT? What is NETDOM? What

is REPADMIN?16.What are sites? What are they used for?17.What’s the difference between a site link’s schedule and interval?18.What is the KCC?19.What is the ISTG? Who has that role by default?20.What are the requirements for installing AD on a new server?21.What can you do to promote a server to DC if you’re in a remote location with

slow WAN link?22.How can you forcibly remove AD from a server, and what do you do later? Ã

¢â‚¬Â¢ Can I get user passwords from the AD database?23.What tool would I use to try to grab security related packets from the wire?24.Name some OU design considerations.25.What is tombstone lifetime attribute?26.What do you do to install a new Windows 2003 DC in a Windows 2000 AD?27.What do you do to install a new Windows 2003 R2 DC in a Windows 2003 AD?28.How would you find all users that have not logged on since last month?29.What are the DS* commands?30.What’s the difference between LDIFDE and CSVDE? Usage considerations?31.What are the FSMO roles? Who has them by default? What happens when each

one fails?32.What FSMO placement considerations do you know of?33.I want to look at the RID allocation table for a DC. What do I do?34.What’s the difference between transferring a FSMO role and seizing one?

Which one should you NOT seize? Why?35.How do you configure a “stand-by operation master†� for any of

the roles?36.How do you backup AD?37.How do you restore AD?38.How do you change the DS Restore admin password?39.Why can’t you restore a DC that was backed up 4 months ago?40.What are GPOs?41.What is the order in which GPOs are applied?42.Name a few benefits of using GPMC.43.What are the GPC and the GPT? Where can I find them?44.What are GPO links? What special things can I do to them?

Page 84: Linux Windows Networking Interview Questions Asked 11111

84

45.What can I do to prevent inheritance from above?46.How can I override blocking of inheritance?47.How can you determine what GPO was and was not applied for a user? Name a

few ways to do that.48.A user claims he did not receive a GPO, yet his user and computer accounts are

in the right OU, and everyone else there gets the GPO. What will you look for?49.Name a few differences in Vista GPOs50.Name some GPO settings in the computer and user parts.51.What are administrative templates?52.What’s the difference between software publishing and assigning?53.Can I deploy non-MSI software with GPO?54.You want to standardize the desktop environments (wallpaper, My Documents,

Start menu, printers etc.) on the computers in one department. How would you do that?

Windows sysadmin interview questionsBy admin | June 15, 2006

1. What are the required components of Windows Server 2003 for installing Exchange 2003? - ASP.NET, SMTP, NNTP, W3SVC

2. What must be done to an AD forest before Exchange can be deployed? - Setup /forestprep

3. What Exchange process is responsible for communication with AD? - DSACCESS

4. What 3 types of domain controller does Exchange access? - Normal Domain Controller, Global Catalog, Configuration Domain Controller

5. What connector type would you use to connect to the Internet, and what are the two methods of sending mail over that connector? - SMTP Connector: Forward to smart host or use DNS to route to each address

6. How would you optimise Exchange 2003 memory usage on a Windows Server 2003 server with more than 1Gb of memory? - Add /3Gb switch to boot.ini

7. What would a rise in remote queue length generally indicate? - This means mail is not being sent to other servers. This can be explained by outages or performance issues with the network or remote servers.

8. What would a rise in the Local Delivery queue generally mean? - This indicates a performance issue or outage on the local server. Reasons could be slowness in consulting AD, slowness in handing messages off to local delivery or SMTP delivery. It could also be databases being dismounted or a lack of disk space.

9. What are the standard port numbers for SMTP, POP3, IMAP4, RPC, LDAP and Global Catalog? - SMTP – 25, POP3 – 110, IMAP4 – 143, RPC – 135, LDAP – 389, Global Catalog - 3268

10.Name the process names for the following: System Attendant? – MAD.EXE, Information Store – STORE.EXE, SMTP/POP/IMAP/OWA – INETINFO.EXE

11.What is the maximum amount of databases that can be hosted on Exchange 2003 Enterprise? - 20 databases. 4 SGs x 5 DBs.

12.What are the disadvantages of circular logging? - In the event of a corrupt database, data can only be restored to the last backup.

Tell them that you have 400 pc based network, and you configure a Active Directory domain on windows servers to centralize administration tasks.

Page 85: Linux Windows Networking Interview Questions Asked 11111

85

1) How windows server will configure?Its depends on the role of the server. If you installing Active Directory, you have to run DCPROMO on commond prompt, and followed instructions.Over all its depends on the role.Simply you can say– there is an option in windows “Manage Server” once you follow the instructions it will guide you to configure your server.2) How many types of servers?If they are concern with Hardware server, tell them the hardware configuration and vendor of the server.If they are asking about the types of windows server, tell them Standard, enterprise, or Small business server etc.

start > Run > Cmd >Typenet send Computername type ur msg

Question 2: What must be done to an AD forest before Exchange can be deployed? - Setup /forestprepquestion 2 is incorrect, in order for ms exchange 2k or 2003 to be sucessfully “deployed” both forestprep and domain prep must successfuly complete first, before the setup.exe of the actual exchange install, or the install and will error out if attempted.

What are main differences between WINS and DNS ???WINS:- It is used to resolve IP address into netbios Viceversa it is used prior version of win 2000DNS:-It is used to resolve IP address into host name.Viceversa it is used in 2000, XP, 2003 server

what are diff between outlook & outlook express ????Outlook ExpressOutlook Express is the e-mail client that is included with Microsoft Internet Explorer 4.x, Microsoft Internet Explorer 5.x, the Microsoft Windows 98 operating system, the Microsoft Windows Millennium Edition (Me) operating system, the Microsoft Windows 2000 operating systems, and Microsoft Office 98 for the Macintosh. Outlook Express is designed for home users who gain access to their e-mail messages by dialing in to an Internet service provider (ISP).OutlookOutlook is Microsoft’s premier messaging and collaboration client. It is a stand-alone application that is integrated into Microsoft Office and Exchange Server. Outlook also provides performance and integration with Internet Explorer 5.5. Complete integration of e-mail, calendaring, and contact management, makes Outlook the perfect client for many business users.

Advantages of WINS: WINS will be really helofull in a multidomain environment where in user’s would need to access many of the resources in different domains, rathere than adding different DNS suffixes of each domain on the local machine. WINS is the best option. But i could also say WINS is not as stable as DNS.

Page 86: Linux Windows Networking Interview Questions Asked 11111

86

Windows sysadmin interview questionsBy admin | March 29, 2006

1. What is Active Directory schema?2. What are the domain functional level in Windows Server 2003?3. What are the forest functional level in Windows Server 2003?4. What is global catalog server?5. How we can raise domain functional & forest functional level in Windows

Server 2003?6. Which is the deafult protocol used in directory services?7. What is IPv6?8. What is the default domain functional level in Windows Server 2003?9. What are the physical & logical components of ADS10.In which domain functional level, we can rename domain name?11.What is multimaster replication?12.What is a site?13.Which is the command used to remove active directory from a domain

controler?14.How we can create console, which contain schema?15.What is trust?16.What is the file that’s responsible for keep all Active Directory database?17.what is mean by schema ?18.Windows Server 2000/2003 Active Directory uses a database set of rules is

called Schema

Your hard drive is partitioned as follows: 8 gigs for OS drive C, 8 gigs for Hot Swappable drive D and rest is free as drive E. Your drive C crashes, how would you reboot your system without installing a new operating system?

ey one of the biggest question in system administrator’s interview is,what you do in your 8 hours of work a day???as you know system admins will configure everything initially. they will be free till something goes wrong,can somebody tell me how to cover/defend(in interview) this question(8 hour of work everyday along with managing things when something goes down).please do reply

The schema master domain controller controls all updates and modifications to the schema. Once the Schema update is complete, it is replicated from the schema master to all other DCs in the directory. To update the schema of a forest, you must have access to the schema master. There can be only one schema master in the whole forest

Your hard drive is partitioned as follows: 8 gigs for OS drive C, 8 gigs for Hot Swappable drive D and rest is free as drive E. Your drive C crashes, how would you reboot your system without installing a new operating system?Ans: In this type of configurations have to confiner Mirror whenever C drive is crash then we will reload the operating system.

Copy is used when you want to copy files without hampering regular backup. Example you copy whole website files.If you backup say full the archive bit will be

Page 87: Linux Windows Networking Interview Questions Asked 11111

87

cleared that means that file is backed up.(It will be checked once if you edit the file)Backup works on this bit only. Differential will not clear this archive bit. To check right click file , properties, click advanced file is ready for archiving

Que.: Which is the deafult protocol used in directory services?Ans.: Ldap, is the default protocol for Active Directory and Port no is 389.

Que..: What is global catalog server?A server hold the full information about the local domain and partial information about trusted domain called Global Catlog. In a Domain Network first DC hold this role by default.

* How to check all open ports on linux machine and block unsed ports?netstat -t#nmap -v localhost for tcp#nmap -sU localhost for udp

#netstat -tulpor#netstat -tulpn

to verfy the open ports-------------------------------* how u use the iptable firewall to restrict ssh,telnet,ftpFor SSHiptables -A INPUT -s -p tcp --dport <22> -jREJECT/DROP/DENY

For Telnet

Page 88: Linux Windows Networking Interview Questions Asked 11111

88

iptables -A INPUT -s -p tcp --dport <23> -jREJECT/DROP/DENY

For FTPiptables -A INPUT -s -p tcp --dport <21> -jREJECT/DROP/DENY

-------------------------------------

* what is the difference between unix and linux

graphics is the main differenceextra more command are in linuxuserfriendly then unix

the unix is the platform dependent the linux is platformindependent. we cann't install unix in all machine werecquired a special machine to install unix, but linux isnot like that it support all machines

filesystem are differentthere diff lies in kernellinux is under gpl and unix proprietary

Difference Between Linux and Unix1)Linux default shell is /bin/bash, where Unix default shellis /bin/sh (other shell also supported)2) Linux Store all their command history,but if the defaultshell is /bin/sh in Unix, then Unix not store Command history.3) Linux support Tab key, but unix not support Tab key-------------------------------------

Who owns the data dictionary?

The Oracle user SYS owns all base tables and user-accessible views of the data dictionary. Therefore, noOracle user should ever alter (update, delete, or insert)any rows or schema objects contained in the SYS schema,because such activity can compromise data integrity. Thesecurity administrator should keep strict control of thiscentral account.

-------------------------------------which file contains information about os wether it's 32bit or 64 bit?

ANS: /proc/cpuinfoor$uname -mor/usr/bin/file--------------------------------what contains information about file and directory creating time or modification time?

Page 89: Linux Windows Networking Interview Questions Asked 11111

89

An inode is a data structure on a Unix / Linux file system.An inode stores basic information about a regular file,directory, or other file system object. You can usefollowing two commands to display an inode:

[a] ls command : list directory contents

-----------------------------------What are RPM?s, what do they offer?

The full form of RPM is Redhat Package Manager.rpm is a powerful Package Manager, which can be usedto build,install, query, verify, update, and eraseindividual software packages. A package consists of anarchive of files and meta-data used to install and erase thearchive files.

[b] stat command : display file or file system status

eg : # stat /etc/passwdOutput:File: `/etc/group'Size: 566 Blocks: 16 IO Block: 4096regular fileDevice: fd00h/64768d Inode: 2443679 Links: 1Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: (0/ root)Access: 2009-08-12 08:23:31.245032672 +0530Modify: 2002-01-01 05:54:15.000000000 +0530Change: 2002-01-01 05:54:15.000000000 +0530--------------------------------------------------*how to confirm from client end about nfs server sharing?

with mount and showmount -e server IP

-------------------------------------------------How do i check which nfs version I am using ?

rpcinfo -p localhost | grep -i nfs

This cmd is used for nfs versionrpm -qa | grep nfsrpm -qi nfs nfs-utilsyum info nfs nfs-utils

------------------------------------------------Through ssh whole directory structure from / is shared regardless the user we have connected with ....... how do i prevent sharing ??

vi /etc/ssh/sshd_config"in last line enter the folowing entry"AllowUsers "username"

And

Page 90: Linux Windows Networking Interview Questions Asked 11111

90

vi /etc/hosts.deny"in last line enter the folowing entry"sshd: ALL EXCEPT "DOMAIN-NAME"

its benefitial to use setfacl command for secure yourstuff..-------------------------------------------------------* what restrict telnet for root itself but allow for other user

Root can login through telnet session, but by default it isdisabled. You can enable by appending /etc/securetty fileopen /etc/securetty using vi

#vi /etc/securetty

pts/0pts/1

don't remove anything from this /etc/securetty , justappend your entry

vi /etc/pam.d/login

auth required pam_securetty.so== 1st lineshould be placed as required.if we change the option assufficient instead of required telnet can login as "root".-----------------------------------------------------------How to send automated email to a set of people at fixed time ?

1)just create a alias of people and create a command file andcreate a crond entry2)configure sendmail & postfix to configure procmail..Or configure Q-mail / Squirrel mail & use contab----------------------------------------------------how do i check which package has installed some commandsuppose ls , mkdir or whatever ???

rpm -qa | grep "pakage name"

rpm -qa | grep yum install it will show already installedor not if not then it will installPirut same as yumrpm -qa /usr/bin/lsgives you from which rpm the "ls" command is installed.

-----------------------------------------------------

What is the difference between Telnet and SSH?

ssh is a secured shell, where telnet is not a securedone.when you ssh to trasnfer data between a system, the datawill be send in the encrypted form, where the hacker cannot

Page 91: Linux Windows Networking Interview Questions Asked 11111

91

encode or decode it. While you telnet,the data send betweenthe system is alphabetical format(ASCII), where every onecan understand. More over as per network security, telnetand ftp are prohibited. Always, trust SSL based data transfer.

Telnet ->Its just getting (Telenet) a connection to the server.Its not more secure. Anybody can use it.It can be easly hacked.It can be easily read by anybody inthat network

SSH -> secured shocket shellIts more secure than Telnet .This has an encrption and decrption of the data /usr/pwdNone can hack this. It is the good way to transfer the data

---------------------------------------------------What is the difference between home directory and working directory?

home directory is one over which user have complete controland it is its default working directory when its logs in.while the working directory is the users current directorywhich may or may not be his home directory.------------------------------------------How can you see all mounted drives?

with df -hT command andwith the mount command.#vi /etc/fstab contains perminant mounts---------------------------------------------

When you install RedHat what is the kernel mode ? What is kernel compilation / upgrade ?

Kernel mode, also referred to as system mode, is one of thetwo distinct modes of operation of the CPU in Linux. Theother is user mode, a non-privileged mode for user programs,that is, for everything other than the kernel.When the CPU is in kernel mode, it is assumed to beexecuting trusted software, and thus it can execute anyinstructions and reference any memory addresses. The kernelis trusted software, but all other programs are considereduntrusted software. Thus, all user mode software mustrequest use of the kernel by means of a system call in orderto perform privileged instructions, such as process creationor input/output.

Kernel compilation is installing a new kernel or addingcustom modules to the same kernel.Kernel upgradation is upgrading it to a different versionaltogether.------------------------------what is the difference between fork and thread ? and parent and child process in fork system call?fork() system call in UNIX causes creation of a new processthe new process (child process) which is an exact copy of

Page 92: Linux Windows Networking Interview Questions Asked 11111

92

the calling process(parent process).return value from fork() is used to distinguish the parent from the child; theparent receives the child's process id, but the childreceives zero.

A thread is a stream of instructions that can be scheduledas an independent unit.

A thread is a stream of instructions that can be scheduledas an independent unit. It is important to understand thedifference between a thread and a process. A processcontains two kinds of information: resources that areavailable to the entire process such as programinstructions, global data and working directory, andschedulable entities, which include program counters andstacks. A thread is an entity within a process thatconsists of the schedulable part of the process.

A fork() duplicates all the threads of a process. Theproblem with this is that fork() in a process where threadswork with external resources may corrupt those resources(e.g., writing duplicate records to a file) because neitherthread may know that the fork() has occurred.

When a new perl thread is created, all the data associatedwith the current thread is copied to the new thread, and issubsequently private to that new thread! This is similar infeel to what happens when a UNIX process forks, except thatin this case, the data is just copied to a different partof memory within the same process rather than a real forktaking place.

A fork() induces a parent-child relationship between twoprocesses. Thread creation induces a peer relationshipbetween all the threads of a process.--------------------------------------------------------You want to create a compressed backup of the users' home directories. What utility should you use?

Tar -czf kk.tar.gz /home/usernameIf we want to extractthe the command is tar -xzf kk.tar.gz--------------------------------------------------------What is the difference between an argument and an option/switch?

A linux/unix syntax format is as follows

command option arguement

example: ls -a /boothere ls command, -a is option,/boot is arguement

option specifies the command how to runarguement specifies the command on what to run---------------------------------------------------------

Page 93: Linux Windows Networking Interview Questions Asked 11111

93

How does the boot process[init levels] work on Linux? How is it different from Solaris?

When an x86 computer is booted, the processor looks at theend of the system memory for the BIOS (Basic Input/OutputSystem) and runs it. The BIOS program is written intopermanent read-only memory and is always available for use.The BIOS provides the lowest level interface to peripheraldevices and controls the first step of the boot process.

The BIOS tests the system, looks for and checks peripherals,and then looks for a drive to use to boot the system.Usually it checks the floppy drive (or CD-ROM drive on manynewer systems) for bootable media, if present, and then itlooks to the hard drive. The order of the drives used forbooting is usually controlled by a particular BIOS settingon the system. Once Linux is installed on the hard drive ofa system, the BIOS looks for a Master Boot Record (MBR)starting at the first sector on the first hard drive, loadsits contents into memory, then passes control to it.

This MBR contains instructions on how to load the GRUB (orLILO) boot-loader, using a pre-selected operating system.The MBR then loads the boot-loader, which takes over theprocess (if the boot-loader is installed in the MBR). In thedefault Red Hat Linux configuration, GRUB uses the settingsin the MBR to display boot options in a menu. Once GRUB hasreceived the correct instructions for the operating systemto start, either from its command line or configurationfile, it finds the necessary boot file and hands off controlof the machine to that operating system.

1. The system BIOS checks the system and launches the firststage boot loader on the MBR of the primary hard disk.

2. The Frist stage boot loader loads itself into memory andlaunches the second stage boot loader from the /boot/partition.

3. The second stage boot loader loads the kernel intomemory, which in turn loads any necessary modules andmounts the rootpartition read-only.

4. The kernel transfers control of the boot process to the /sbin/init program.

5. The /sbin/init program loads all services and user-spacetools, and mounts all partitionslisted in /etc/fstab.

6. The user is presented with a login screen for thefreshly booted Linux system.-------------------------------------------------------------What are the main differences between RHEL4 & RHEL5?

Page 94: Linux Windows Networking Interview Questions Asked 11111

94

XEN, YUM and improved SELinuxall the features updated with better optionsBetter GUI support then RHEL4YUM over RPM package managementIPTables and SELinux for more secure environmentext2 & ext3 file systemIn RHEL 4 SELinux Block only 13 services, But on RHEL 5SElinux Block 80 services-------------------------------------------------------What text filter can you use to display a binary file in octal numbers?

hexdump file1 > file2--------------------------------------------------------tell me some of the Linux HotKeys do you know?

alt+f1 for application menuctl+l to clear screenalt+f2 to open run application windowalt+f3 for findalt+f4 to close applicationalt+f9 to minimise windowCtrl-Alt-D Show desktopCrtl-Alt-Backspace Restart XWindows-------------------------------------------------

What file should you examine to determine the defined runlevels for your system?

/etc/inittab

id:X:initdefault

where X=runlevel (ex.0 to 6)0 =system poweroff1 = single user mode2 = multiuser mode without network and X window3 = multiuser mode with network without X window4 = unused5 = X11 (multiuser mode with network and X window6 = reboot--------------------------------------What is the name and path of the main system log?

/var/log/messages system log messages can be seen here/var/log/dmesg Kernel boot log messages can view

There are Three centralized loggin demons1)syslogd2)klogd3)auditd

klogd:- collect log file created by the Kernelsyslogd:- Collect log file created by the systemauditd:- Collect log file created by the SELinux

Page 95: Linux Windows Networking Interview Questions Asked 11111

95

After collecting the log system store logs on different location/var/log/dmesg:- Created at boot time, by kernel/var/log/messages:- standard system error message,/var/log/secure:- authentication related log/var/log/maillog:- Mail related log/var/log/audit/audit.log:-Selinux related log

We can redirect the log by configuring/etc/sysconfig/syslog/etc/syslog.conf

-------------------------------------------------what is the difference between semaphore, mutex & spinlock?

Kernel Locking TechniquesSemaphores in Linux are sleeping locks. Because they cause atask to sleep on contention, instead of spin, they are usedin situations where the lock-held time may be long.Conversely, since they have the overhead of putting a taskto sleep and subsequently waking it up, they should not beused where the lock-held time is short. Since they sleep,however, they can be used to synchronize user contextswhereas spinlocks cannot. In other words, it is safe toblock while holding a semaphore.

A "mutex" (or "mutual exclusion lock") is a signal that twoor more asynchronous processes can use to reserve a sharedresource for exclusive use. The first process that obtainsownership of the "mutex" also obtains ownership of theshared resource. Other processes must wait for for the firstprocess to release it's ownership of the "mutex" before theymay attempt to obtain it.

The most common locking primitive in the kernel is thespinlock. The spinlock is a very simple single-holder lock.If a process attempts to acquire a spinlock and it isunavailable, the process will keep trying (spinning) untilit can acquire the lock. This simplicity creates a small andfast lock.---------------------------------------------------What are seven fields in the /etc/passwd file.

1. Username: It is used when user logs in. It should be between 1 and 32 characters in length.2. Password: An x character indicates that encrypted password is stored in /etc/shadow file.3. User ID (UID): Each user must be assigned a user ID (UID). UID 0 (zero) is reserved for root and UIDs 1-99 are reserved for other predefined accounts. Further UID 100-999 are reserved by system for administrative and system accounts/groups.4. Group ID (GID): The primary group ID (stored in /etc/group file)5. User ID Info: The comment field. It allow you to add extra information about the users such as user's full name, phone number etc. This field use by finger command.6. Home directory: The absolute path to the directory the user will be in when they log in. If this directory does not exists then users directory becomes /7. Command/shell: The absolute path of a command or shell (/bin/bash). Typically, this is a shell. Please 

Page 96: Linux Windows Networking Interview Questions Asked 11111

96

note that it does not have to be a shell.

------------------------------------------------------

1. Q. How do you list files in a directory?A. ls - list directory contentsls -l (-l use a long listing format)

2. Q. How do you list all files in a directory, including the hidden files?A. ls -a (-a, do not hide entries starting with .)

3. Q. How do you find out all processes that are currently running?A. ps -f (-f does full-format listing.)

4. Q. How do you find out the processes that are currently running or a particular user?A. ps -au Myname (-u by effective user ID (supports names)) (a - all users)

5. Q. How do you kill a process?A. kill -9 8 (process_id 8) or kill -9 %7 (job number 7)kill -9 -1 (Kill all processes you can kill.)killall - kill processes by name most (useful - killall java)

6. Q. What would you use to view contents of the file?A. less filenamecat filenamepg filenamepr filenamemore filenamemost useful is command: tail file_name - you can see the end of the log file.

7. Q. What would you use to edit contents of the file?A. vi screen editor or jedit, nedit or ex line editor

8. Q. What would you use to view contents of a large error log file?A. tail -10 file_name ( last 10 rows)

9. Q. How do you log in to a remote Unix box?A. Using telnet server_name or ssh -l ( ssh - OpenSSH SSH client (remote login program))

10.Q. How do you get help on a UNIX terminal?A. man command_nameinfo command_name (more information)

11.Q. How do you list contents of a directory including all of itssubdirectories, providing full details and sorted by modification time?A. ls -lac-a all entries-c by time

12.Q. How do you create a symbolic link to a file (give some reasons of doing so)?A. ln /../file1 Link_nameLinks create pointers to the actual files, without duplicating the contents ofthe files. That is, a link is a way of providing another name to the same file.

Page 97: Linux Windows Networking Interview Questions Asked 11111

97

There are two types of links to a file:Hard link, Symbolic (or soft) link;

13.Q. What is a filesystem?A. Sum of all directories called file system.A file system is the primary means of file storage in UNIX.File systems are made of inodes and superblocks.

14.Q. How do you get its usage (a filesystem)?A. By storing and manipulate files.

15.Q. How do you check the sizes of all users home directories (one command)?A. du -sdf

The du command summarizes disk usage by directory. It recurses through all subdirectories and shows disk usage by each subdirectory with a final total at the end.

More interview questions click here

 # Mary has recently gotten married and wants to change her username from mstone to mknight. Which of the following commands should you run to accomplish this? Choose one: a. usermod -l mknight mstone b. usermod -l mstone mknight c. usermod -u mknight mstone d. usermod -u mstone mknight# After bob leaves the company you issue the command userdel bob. Although his entry in the /etc/passwd file has been deleted, his home directory is still there. What command could you have used to make sure that his home directory was also deleted? Choose one: a. userdel -m bob b. userdel -u bob c. userdel -l bob d. userdel -r bob

# All groups are defined in the /etc/group file. Each entry contains four fields in the following order. Choose one: a. groupname, password, GID, member list b. GID, groupname, password, member list c. groupname, GID, password, member list d. GID, member list, groupname, password# You need to create a new group called sales with Bob, Mary and Joe as members. Which of the following would accomplish this? Choose one: a. Add the following line to the /etc/group file: sales:44:bob,mary,joe b. Issue the command groupadd sales. c. Issue the command groupadd -a sales bob,mary,joe d. Add the following line to the /etc/group file: sales::44:bob,mary,joe# What command is used to remove the password assigned to a group?# You changed the GID of the sales group by editing the /etc/group file. All of the members can change to the group without any problem except for Joe. He cannot even login to the system. What is the problem? Choose one: a. Joe forgot the password for the group. b. You need to add Joe to the group again. c. Joe had the original GID specified as his default group in the /etc/passwd file. d. You need to delete Joe’s account and recreate it.# You need to delete the group dataproject. Which two of the following tasks should you do first before deleting the group? A. Check the /etc/passwd file to make sure no one has this group as his default group. B. Change the members of the dataproject group to another group besides users. C. Make sure that the members listed in the /etc/group file are given new login names. D. Verify that no file or directory has this group listed as its owner. Choose one: a. A and C b. A and D c. B and C d. B and D# When you look at the /etc/group file you see the group kmem listed. Since it does not own any files and no one is using it as a default group, can you delete this group?# When looking at the /etc/passwd file, you notice that all the password fields contain ‘x’. What does this 

Page 98: Linux Windows Networking Interview Questions Asked 11111

98

mean? Choose one: a. That the password is encrypted. b. That you are using shadow passwords. c. That all passwords are blank. d. That all passwords have expired.# In order to improve your system’s security you decide to implement shadow passwords. What command should you use?# What file contains the default environment variables when using the bash shell? Choose one: a. ~/.profile b. /bash c. /etc/profile d. ~/bash# You have created a subdirectory of your home directory containing your scripts. Since you use the bash shell, what file would you edit to put this directory on your path? Choose one: a. ~/.profile b. /etc/profile c. /etc/bash d. ~/.bash# Which of the following interprets your actions when typing at the command line for the operating system? Choose One a. Utility b. Application c. Shell d. Command# What can you type at a command line to determine which shell you are using?# You want to enter a series of commands from the command-line. What would be the quickest way to do this? Choose One a. Press enter after entering each command and its arguments b. Put them in a script and execute the script c. Separate each command with a semi-colon (;) and press enter after the last command d. Separate each command with a / and press enter after the last command# You are entering a long, complex command line and you reach the right side of your screen before you have finished typing. You want to finish typing the necessary commands but have the display wrap around to the left. Which of the following key combinations would achieve this? Choose One a. Esc, /, Enter b. /, Enter c. ctrl-d, enter d. esc, /, ctrl-d# After typing in a new command and pressing enter, you receive an error message indicating incorrect syntax. This error message originated from.. Choose one a. The shell b. The operating system c. The command d. The kernel# When typing at the command line, the default editor is the _____________ library.# You typed the following at the command line ls -al /home/ hadden. What key strokes would you enter to remove the space between the ‘/’ and ‘hadden’ without having to retype the entire line? Choose one a. Ctrl-B, Del b. Esc-b, Del c. Esc-Del, Del d. Ctrl-b, Del# You would like to temporarily change your command line editor to be vi. What command should you type to change it?# After experimenting with vi as your command line editor, you decide that you want to have vi your default editor every time you log in. What would be the appropriate way to do this? Choose one a. Change the /etc/inputrc file b. Change the /etc/profile file c. Change the ~/.inputrc file d. Change the ~/.profile file# You have to type your name and title frequently throughout the day and would like to decrease the number of key strokes you use to type this. Which one of your configuration files would you edit to bind this information to one of the function keys?# In your present working directory, you have the files maryletter memo1 MyTelephoneandAddressBook What is the fewest number of keys you can type to open the file MyTelephoneandAddressBook with vi? Choose one a. 6 b. 28 c. 25 d. 4# A variable that you can name and assign a value to is called a _____________ variable.# You have installed a new application but when you type in the command to start it you get the error message Command not found. What do you need to do to fix this problem? Choose one a. Add the directory containing the application to your path b. Specify the directory’s name whenever you run the application c. Verify that the execute permission has been applied to the command. d. Give everyone read, write and execute permission to the application’s directory.# You telnet into several of your servers simultaneously. During the day, you sometimes get confused as to which telnet session is connected to which server. Which of the following commands in your .profile file would make it obvious to which server you are attached? Choose one a. PS1=’\h: \w>’ b. PS1=’\s: \W>’ c. PS1=’\!: \t>’ d. PS1=’\a: \n>’# Which of the following environment variables determines your working directory at the completion of a successful login? Choose one a. HOME b. BASH_ENV c. PWD d. BLENDERDIR# Every time you attempt to delete a file using the rm utility, the operating system prompts you for confirmation. You know that this is not the customary behavior for the rm command. What is wrong? Choose one a. rm has been aliased as rm -i b. The version of rm installed on your system is incorrect. c. This is the normal behavior of the newest version of rm. d. There is an incorrect link on your system.

Page 99: Linux Windows Networking Interview Questions Asked 11111

99

# You are running out of space in your home directory. While looking for files to delete or compress you find a large file called .bash_history and delete it. A few days later, it is back and as large as before. What do you need to do to ensure that its size is smaller? Choose one a. Set the HISTFILESIZE variable to a smaller number. b. Set the HISTSIZE to a smaller number. c. Set the NOHISTFILE variable to true. d. Set the HISTAPPEND variable to true.# In order to display the last five commands you have entered using the history command, you would type ___________.# In order to display the last five commands you have entered using the fc command, you would type ___________.# You previously ran the find command to locate a particular file. You want to run that command again. What would be the quickest way to do this? Choose one a. fc -l find fc n b. history -l find history n c. Retype the command d. fc -n find# Using command substitution, how would you display the value of the present working directory? Choose one a. echo $(pwd) b. echo pwd c. $pwd d. pwd | echo# You need to search the entire directory structure to locate a specific file. How could you do this and still be able to run other commands while the find command is still searching for your file? Choose one a. find / -name filename & b. find / -name filename c. bg find / -name filename d. &find / -name filename &# In order to create a file called DirContents containing the contents of the /etc directory you would type ____________.# What would be displayed as the result of issuing the command ps ef? Choose one a. A listing of the user’s running processes formatted as a tree. b. A listing of the stopped processes c. A listing of all the running processes formatted as a tree. d. A listing of all system processes formatted as a tree.# What utility can you use to show a dynamic listing of running processes? __________# The top utility can be used to change the priority of a running process? Another utility that can also be used to change priority is ___________?# What key combination can you press to suspend a running job and place it in the background?# You issue the command jobs and receive the following output: [1]- Stopped (tty output) pine [2]+ Stopped (tty output) MyScript How would you bring the MyScript process to the foreground? Choose one: a. fg %2 b. ctrl-c c. fg MyScript d. ctrl-z# You enter the command cat MyFile | sort > DirList & and the operating system displays [4] 3499 What does this mean? Choose one a. This is job number 4 and the PID of the sort command is 3499. b. This is job number 4 and the PID of the job is 3499. c. This is job number 3499 and the PID of the cat command is 4. d. This is job number 4 and the PID of the cat command is 3499.# You attempt to log out but receive an error message that you cannot. When you issue the jobs command, you see a process that is running in the background. How can you fix this so that you can logout? Choose one a. Issue the kill command with the PID of each running command of the pipeline as an argument. b. Issue the kill command with the job number as an argument. c. Issue the kill command with the PID of the last command as an argument. d. Issue the kill command without any arguments.# You have been given the job of administering a new server. It houses a database used by the sales people. This information is changed frequently and is not duplicated anywhere else. What should you do to ensure that this information is not lost? Choose one a. Create a backup strategy that includes backing up this information at least daily. b. Prepare a proposal to purchase a backup server c. Recommend that the server be made part of a cluster. d. Install an additional hard drive in the server.# When planning your backup strategy you need to consider how often you will perform a backup, how much time the backup takes and what media you will use. What other factor must you consider when planning your backup strategy? _________# Many factors are taken into account when planning a backup strategy. The one most important one is how often does the file ____________.# Which one of the following factors does not play a role in choosing the type of backup media to use? Choose one: a. How frequently a file changes b. How long you need to retain the backup c. How much data needs to be backed up d. How frequently the backed up data needs to be accessed# When you only back up one partition, this is called a ______ backup. Choose one a. Differential b. Full c. Partial d. Copy# When you back up only the files that have changed since the last backup, this is called a ______ backup. 

Page 100: Linux Windows Networking Interview Questions Asked 11111

100

Choose one a. Partial b. Differential c. Full d. Copy# The easiest, most basic form of backing up a file is to _____ it to another location.# When is the most important time to restore a file from your backup? Choose one a. On a regular scheduled basis to verify that the data is available. b. When the system crashes. c. When a user inadvertently loses a file. d. When your boss asks to see how restoring a file works.# As a system administrator, you are instructed to backup all the users’ home directories. Which of the following commands would accomplish this? Choose one a. tar rf usersbkup home/* b. tar cf usersbkup home/* c. tar cbf usersbkup home/* d. tar rvf usersbkup home/*# What is wrong with the following command? tar cvfb / /dev/tape 20 Choose one a. You cannot use the c option with the b option. b. The correct line should be tar -cvfb / /dev/tape20. c. The arguments are not in the same order as the corresponding modifiers. d. The files to be backed up have not been specified.# You need to view the contents of the tarfile called MyBackup.tar. What command would you use? __________# After creating a backup of the users’ home directories called backup.cpio you are asked to restore a file called memo.ben. What command should you type?# You want to create a compressed backup of the users’ home directories so you issue the command gzip /home/* backup.gz but it fails. The reason that it failed is that gzip will only compress one _______ at a time.# You want to create a compressed backup of the users’ home directories. What utility should you use?# You routinely compress old log files. You now need to examine a log from two months ago. In order to view its contents without first having to decompress it, use the _________ utility.# Which two utilities can you use to set up a job to run at a specified time? Choose one: a. at and crond b. atrun and crontab c. at and crontab d. atd and crond# You have written a script called usrs to parse the passwd file and create a list of usernames. You want to have this run at 5 am tomorrow so you can see the results when you get to work. Which of the following commands will work? Choose one: a. at 5:00 wed usrs b. at 5:00 wed -b usrs c. at 5:00 wed -l usrs d. at 5:00 wed -d usrs# Several of your users have been scheduling large at jobs to run during peak load times. How can you prevent anyone from scheduling an at job? Choose one: a. delete the file /etc/at.deny b. create an empty file called /etc/at.deny c. create two empty files: /etc/at.deny and /etc/at.allow file d. create an empty file called /etc/at.allow# How can you determine who has scheduled at jobs? Choose one: a. at -l b. at -q c. at -d d. atwho# When defining a cronjob, there are five fields used to specify when the job will run. What are these fields and what is the correct order? Choose one: a. minute, hour, day of week, day of month, month b. minute, hour, month, day of month, day of week c. minute, hour, day of month, month, day of week d. hour, minute, day of month, month, day of week# You have entered the following cronjob. When will it run? 15 * * * 1,3,5 myscript Choose one: a. at 15 minutes after every hour on the 1st, 3rd and 5th of each month. b. at 1:15 am, 3:15 am, and 5:15 am every day c. at 3:00 pm on the 1st, 3rd, and 5th of each month d. at 15 minutes after every hour every Monday, Wednesday, and Friday# As the system administrator you need to review Bob’s cronjobs. What command would you use? Choose one: a. crontab -lu bob b. crontab -u bob c. crontab -l d. cronq -lu bob# In order to schedule a cronjob, the first task is to create a text file containing the jobs to be run along with the time they are to run. Which of the following commands will run the script MyScript every day at 11:45 pm? Choose one: a. * 23 45 * * MyScript b. 23 45 * * * MyScript c. 45 23 * * * MyScript d. * * * 23 45 MyScript# Which daemon must be running in order to have any scheduled jobs run as scheduled? Choose one: a. crond b. atd c. atrun d. crontab# You want to ensure that your system is not overloaded with users running multiple scheduled jobs. A policy has been established that only the system administrators can create any scheduled jobs. It is your job to implement this policy. How are you going to do this? Choose one: a. create an empty file called /etc/cron.deny b. create a file called /etc/cron.allow which contains the names of those allowed to schedule jobs. c. create a file called /etc/cron.deny containing all regular usernames. d. create two empty 

Page 101: Linux Windows Networking Interview Questions Asked 11111

101

files called /etc/cron.allow and /etc/cron.deny# You notice that your server load is exceptionally high during the hours of 10 am to 2 noon. When investigating the cause, you suspect that it may be a cron job scheduled by one of your users. What command can you use to determine if your suspicions are correct? Choose one: a. crontab -u b. crond -u c. crontab -l d. crond -l# One of your users, Bob, has created a script to reindex his database. Now he has it scheduled to run every day at 10:30 am. What command should you use to delete this job. Choose one: a. crontab -ru bob b. crontab -u bob c. crontab -du bob d. crontab -lu bob# What daemon is responsible for tracking events on your system?# What is the name and path of the default configuration file used by the syslogd daemon?# You have made changes to the /etc/syslog.conf file. Which of the following commands will cause these changes to be implemented without having to reboot your computer? Choose one: a. kill SIGHINT `cat /var/run/syslogd.pid` b. kill SIGHUP `cat /var/run/syslogd.pid` c. kill SIGHUP syslogd d. kill SIGHINT syslogd# Which of the following lines in your /etc/syslog.conf file will cause all critical messages to be logged to the file /var/log/critmessages? Choose one: a. *.=crit /var/log/critmessages b. *crit /var/log/critmessages c. *=crit /var/log/critmessages d. *.crit /var/log/critmessages# You wish to have all mail messages except those of type info to the /var/log/mailmessages file. Which of the following lines in your /etc/syslogd.conf file would accomplish this? Choose one: a. mail.*;mail!=info /var/log/mailmessages b. mail.*;mail.=info /var/log/mailmessages c. mail.*;mail.info /var/log/mailmessages d. mail.*;mail.!=info /var/log/mailmessages# What is the name and path of the main system log?# Which log contains information on currently logged in users? Choose one: a. /var/log/utmp b. /var/log/wtmp c. /var/log/lastlog d. /var/log/messages# You have been assigned the task of determining if there are any user accounts defined on your system that have not been used during the last three months. Which log file should you examine to determine this information? Choose one: a. /var/log/wtmp b. /var/log/lastlog c. /var/log/utmp d. /var/log/messages# You have been told to configure a method of rotating log files on your system. Which of the following factors do you not need to consider? Choose one: a. date and time of messages b. log size c. frequency of rotation d. amount of available disk space# What utility can you use to automate rotation of logs?# You wish to rotate all your logs weekly except for the /var/log/wtmp log which you wish to rotate monthly. How could you accomplish this. Choose one: a. Assign a global option to rotate all logs weekly and a local option to rotate the /var/log/wtmp log monthly. b. Assign a local option to rotate all logs weekly and a global option to rotate the /var/log/wtmp log monthly. c. Move the /var/log/wtmp log to a different directory. Run logrotate against the new location. d. Configure logrotate to not rotate the /var/log/wtmp log. Rotate it manually every month.# You have configured logrotate to rotate your logs weekly and keep them for eight weeks. You are running our of disk space. What should you do? Choose one: a. Quit using logrotate and manually save old logs to another location. b. Reconfigure logrotate to only save logs for four weeks. c. Configure logrotate to save old files to another location. d. Use the prerotate command to run a script to move the older logs to another location.# What command can you use to review boot messages?# What file defines the levels of messages written to system log files?# What account is created when you install Linux?# While logged on as a regular user, your boss calls up and wants you to create a new user account immediately. How can you do this without first having to close your work, log off and logon as root? Choose one: a. Issue the command rootlog. b. Issue the command su and type exit when finished. c. Issue the command su and type logoff when finished. d. Issue the command logon root and type exit when finished.# Which file defines all users on your system? Choose one: a. /etc/passwd b. /etc/users c. /etc/password d. /etc/user.conf# There are seven fields in the /etc/passwd file. Which of the following lists all the fields in the correct order? Choose one: a. username, UID, GID, home directory, command, comment b. username, UID, GID, comment, home directory, command c. UID, username, GID, home directory, comment, command d. username, UID, group name, GID, home directory, comment

Page 102: Linux Windows Networking Interview Questions Asked 11111

102

# Which of the following user names is invalid? Choose one: a. Theresa Hadden b. thadden c. TheresaH d. T.H.# In order to prevent a user from logging in, you can add a(n) ________at the beginning of the password field.# The beginning user identifier is defined in the _________ file.# Which field is used to define the user’s default shell?# Bob Armstrong, who has a username of boba, calls to tell you he forgot his password. What command should you use to reset his command?# Your company has implemented a policy that users’ passwords must be reset every ninety days. Since you have over 100 users you created a file with each username and the new password. How are you going to change the old passwords to the new ones? Choose one: a. Use the chpasswd command along with the name of the file containing the new passwords. b. Use the passwd command with the -f option and the name of the file containing the new passwords. c. Open the /etc/passwd file in a text editor and manually change each password. d. Use the passwd command with the -u option

Read more: http://blog.learnadmin.com/2009/09/linux-interview-questions.html#ixzz1cRZ69Z3E

Explain Process management and related commands

Explain Memory management and related commands

What is Open Group standards?

Secify seciaal usage for each one of the following file/dev/null - Send unwanted output /dev/random - Random number generation /dev/zero - Cache or Destroy data on a partition - dd if=/dev/zero of=/dev/sda98

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? 

Page 103: Linux Windows Networking Interview Questions Asked 11111

103

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?grepsedawkifconfignetstatdfduprtvtocfdisk -lumaksgetfaclsetfaclsudofsck

Page 104: Linux Windows Networking Interview Questions Asked 11111

104

probe-scsivmstat

Explain LVM1) 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 ?8)Different RAID levels ?

What are the services required for nfs, apache(http) and NIS?

What is the best way to check the status of any service?

What do you mean by parity in RAID and which RAID is useful now a days?

Explain Linux Boot process especially kernel and initrd.

Why we do have two commands useradd and adduser when their functialnality is same?

Read more: http://blog.learnadmin.com/2009/01/please-answer-these-questions.html#ixzz1cRZFQP36

thanks for mailing the answers after subscribing please send answers to these questions as well. 1. How do you list the files in an UNIX directory while also showing hidden files? 2. How do you execute a UNIX command in the background? 3. What UNIX command will control the default file permissions when files are created? 4. Explain the read, write, and execute permissions on a UNIX directory. 5. What is the difference between a soft link and a hard link? 6. Give the command to display space usage on the UNIX file system. 7. Explain iostat, vmstat and netstat. 8. How would you change all occurrences of a value using VI? 9. Give two UNIX kernel parameters that effect an Oracle install 10. Briefly, how do you install Oracle software on UNIX. 11. What are the main differences between Apache 1.x and 2.x? 12. What does the “route” command do? 13. What are the read/write/execute bits on a directory mean? 14. What does iostat do? 15. what does vmstat do? 16. What does netstat do? 17. What is the most graceful way to bring a system into single user mode? 18. How do you determine disk usage? 19. What is AWK? 20. What is SED? 21. What is the difference between binaries in /bin, and /usr/bin? 22. What is a dynamically linked file? 23. What is a statically linked file? 

Page 105: Linux Windows Networking Interview Questions Asked 11111

105

24. How do you list the files in an UNIX directory while also showing hidden files? ls -ltra 25. How do you execute a UNIX command in the background? Use the “&”. 26. What UNIX command will control the default file permissions when files are created? umask 27. Explain the read, write, and execute permissions on a UNIX directory. Read allows you to see and list the directory contents. Write allows you to create, edit and delete files and subdirectories in the directory. Execute gives you the permissions to run programs or shells from the directory. 28. What is the difference between a soft link and a hard link? A symbolic (soft) linked file and the targeted file can be located on the same or different file system while for a hard link they must be located on the same file system. 29. Give the command to display space usage on the UNIX file system. df -lk 30. 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. netstat reports on the contents of network data structures. 31. How would you change all occurrences of a value using VI? %s/(old value)/(new value)/g 32. Give two UNIX kernel parameters that effect an Oracle install. SHMMAX & SHMMNI 33. Briefly, how do you install Oracle software on UNIX? Basically, set up disks, kernel parameters, and run orainst. 34. Job Scheduling; mainly crontab, at, batch command 35. Backup stetegy; incremental, full system back up; diff between tar & ufsdump 36. diff between hard link & softlink 37. How to list only the directories inside a directory (Ans. ls -l|grep “^d”) 38. RAID levels; pros & cons of diffrent levels; what is RAID 1+0 39. How to recover a system whose root password has lost? 40. What is a daemon? 41. How to put a job in background & bring it to foreground? 42. What is default permissions for others in a file? 43. Questions on shell initialization scripts? 44. Questions on restricted shell 45. What is diff betwn grep & find? 46. What is egrep? 47. Questions on shell programming 48. What is a pipe? 49. Questions on Solaris patch management like pkgadd etc 50. Questions on file system creation; actually what happens when we create a file system? 51. Questions on RBAC? what is a role accound & what is a profile? 52. From command line how will you add a user account? the full command will all arguments. 53. Fs it advisable to put a swap partion in RAID1 (mirroring?) pros & cons?

Read more: http://blog.learnadmin.com/2009/01/please-answer-these-questions.html#ixzz1cRZagFr3

UNIX - LINUX Interview Questions and Answers :

1. How are devices represented in UNIX?

All devices are represented by files called special files that are located in/dev

directory. Thus, device files and other files are named and accessed in the same way.

A 'regular file' is just an ordinary data file in the disk. A 'block special file' represents a

device with characteristics similar to a disk (data transfer in terms of blocks). A

Page 106: Linux Windows Networking Interview Questions Asked 11111

106

'character special file' represents a device with characteristics similar to a keyboard

(data transfer is by stream of bits in sequential order).

2. What is 'inode'?

All UNIX files have its description stored in a structure called 'inode'. The inode

contains info about the file-size, its location, time of last access, time of last

modification, permission and so on. Directories are also represented as files and have

an associated inode. In addition to descriptions about the file, the inode contains

pointers to the data blocks of the file. If the file is large, inode has indirect pointer to a

block of pointers to additional data blocks (this further aggregates for larger files). A

block is typically 8k.

Inode consists of the following fields:

File owner identifier

File type

File access permissions

File access times

Number of links

File size

Location of the file data

3. Brief about the directory representation in UNIX

A Unix directory is a file containing a correspondence between filenames and inodes. A

directory is a special file that the kernel maintains. Only kernel modifies directories,

but processes can read directories. The contents of a directory are a list of filename

and inode number pairs. When new directories are created, kernel makes two entries

named '.' (refers to the directory itself) and '..' (refers to parent directory).

System call for creating directory is mkdir (pathname, mode).

4. What are the Unix system calls for I/O?

open(pathname,flag,mode) - open file

creat(pathname,mode) - create file

close(filedes) - close an open file

read(filedes,buffer,bytes) - read data from an open file

write(filedes,buffer,bytes) - write data to an open file

lseek(filedes,offset,from) - position an open file

dup(filedes) - duplicate an existing file descriptor

dup2(oldfd,newfd) - duplicate to a desired file descriptor

fcntl(filedes,cmd,arg) - change properties of an open file

ioctl(filedes,request,arg) - change the behaviour of an open file

Page 107: Linux Windows Networking Interview Questions Asked 11111

107

The difference between fcntl anf ioctl is that the former is intended for any open file,

while the latter is for device-specific operations.

5. How do you change File Access Permissions?

Every file has following attributes:

owner's user ID ( 16 bit integer )

owner's group ID ( 16 bit integer )

File access mode word'r w x -r w x- r w x'

(user permission-group permission-others permission)

r-read, w-write, x-execute

To change the access mode, we use chmod(filename,mode).

Example 1:

To change mode of myfile to 'rw-rw-r–' (ie. read, write permission for user - read,write

permission for group - only read permission for others) we give the args as:

chmod(myfile,0664) .

Each operation is represented by discrete values'r' is 4'w' is 2'x' is 1

Therefore, for 'rw' the value is 6(4+2).

Example 2:

To change mode of myfile to 'rwxr–r–' we give the args as:chmod(myfile,0744).

 

6. What are links and symbolic links in UNIX file system?

A link is a second name (not a file) for a file. Links can be used to assign more than

one name to a file, but cannot be used to assign a directory more than one name or

link filenames on different computers.

Symbolic link 'is' a file that only contains the name of another file.Operation on the

symbolic link is directed to the file pointed by the it.Both the limitations of links are

eliminated in symbolic links.

Commands for linking files are:

Page 108: Linux Windows Networking Interview Questions Asked 11111

108

Link ln filename1 filename2Symbolic link ln -s filename1 filename2

7. What is a FIFO?

FIFO are otherwise called as 'named pipes'. FIFO (first-in-first-out) is a special file

which is said to be data transient. Once data is read from named pipe, it cannot be

read again. Also, data can be read only in the order written. It is used in interprocess

communication where a process writes to one end of the pipe (producer) and the other

reads from the other end (consumer).

8. How do you create special files like named pipes and device files?

The system call mknod creates special files in the following sequence.

1. kernel assigns new inode,

2. sets the file type to indicate that the file is a pipe, directory or special file,

3. If it is a device file, it makes the other entries like major, minor device numbers.

For example:

If the device is a disk, major device number refers to the disk controller and minor

device number is the disk.

9. Discuss the mount and unmount system calls

The privileged mount system call is used to attach a file system to a directory of

another file system; the unmount system call detaches a file system. When you mount

another file system on to your directory, you are essentially splicing one directory tree

onto a branch in another directory tree. The first argument to mount call is the mount

point, that is , a directory in the current file naming system. The second argument is

the file system to mount to that point. When you insert a cdrom to your unix system's

drive, the file system in the cdrom automatically mounts to /dev/cdrom in your system.

10. How does the inode map to data block of a file?

Inode has 13 block addresses. The first 10 are direct block addresses of the first 10

data blocks in the file. The 11th address points to a one-level index block. The 12th

address points to a two-level (double in-direction) index block. The 13th address points

to a three-level(triple in-direction)index block. This provides a very large maximum file

size with efficient access to large files, but also small files are accessed directly in one

disk read.

11. What is a shell?

Page 109: Linux Windows Networking Interview Questions Asked 11111

109

A shell is an interactive user interface to an operating system services that allows an

user to enter commands as character strings or through a graphical user interface. The

shell converts them to system calls to the OS or forks off a process to execute the

command. System call results and other information from the OS are presented to the

user through an interactive interface. Commonly used shells are sh,csh,ks etc.

12. Brief about the initial process sequence while the system boots up.

While booting, special process called the 'swapper' or 'scheduler' is created with

Process-ID 0. The swapper manages memory allocation for processes and influences

CPU allocation. The swapper inturn creates 3 children:

the process dispatcher,

vhand and

dbflush

with IDs 1,2 and 3 respectively.

This is done by executing the file /etc/init. Process dispatcher gives birth to the shell.

Unix keeps track of all the processes in an internal data structure called the Process

Table (listing command is ps -el).

13. What are various IDs associated with a process?

Unix identifies each process with a unique integer called ProcessID. The process that

executes the request for creation of a process is called the 'parent process' whose PID

is 'Parent Process ID'. Every process is associated with a particular user called the

'owner' who has privileges over the process. The identification for the user is 'UserID'.

Owner is the user who executes the process. Process also has 'Effective User ID' which

determines the access privileges for accessing resources like files.

getpid() -process id

getppid() -parent process id

getuid() -user id

geteuid() -effective user id

14. Explain fork() system call.

The `fork()' used to create a new process from an existing process. The new process is

called the child process, and the existing process is called the parent. We can tell

which is which by checking the return value from `fork()'. The parent gets the child's

pid returned to him, but the child gets 0 returned to him.

15. Predict the output of the following program code

Page 110: Linux Windows Networking Interview Questions Asked 11111

110

main(){  fork();  printf("Hello World!");}

Answer:Hello World!Hello World!

Explanation:

The fork creates a child that is a duplicate of the parent process. The child begins from

the fork().All the statements after the call to fork() will be executed twice.(once by the

parent process and other by child). The statement before fork() is executed only by

the parent process.

16. Predict the output of the following program codemain(){fork(); fork(); fork();printf("Hello World!");}

Answer:

"Hello World" will be printed 8 times.

Explanation:

2^n times where n is the number of calls to fork()

17. List the system calls used for process management:

System calls Description

fork() To create a new process

exec() To execute a new program in a process

wait() To wait until a created process completes its execution

exit() To exit from a process execution

getpid() To get a process identifier of the current process

getppid() To get parent process identifier

nice() To bias the existing priority of a process

brk() To increase/decrease the data segment size of a process.

18. How can you get/set an environment variable from a program?

Page 111: Linux Windows Networking Interview Questions Asked 11111

111

Getting the value of an environment variable is done by using `getenv()'. Setting the

value of an environment variable is done by using `putenv()'.

19. How can a parent and child process communicate?

A parent and child can communicate through any of the normal inter-process

communication schemes (pipes, sockets, message queues, shared memory), but also

have some special ways to communicate that take advantage of their relationship as a

parent and child. One of the most obvious is that the parent can get the exit status of

the child.

20. What is a zombie?

When a program forks and the child finishes before the parent, the kernel still keeps

some of its information about the child in case the parent might need it - for example,

the parent may need to check the child's exit status. To be able to get this

information, the parent calls `wait()'; In the interval between the child terminating and

the parent calling `wait()', the child is said to be a `zombie' (If you do `ps', the child

will have a `Z' in its status field to indicate this.)

21. What are the process states in Unix?

As a process executes it changes state according to its circumstances. Unix processes

have the following states:

Running : The process is either running or it is ready to run .

Waiting : The process is waiting for an event or for a resource.

Stopped : The process has been stopped, usually by receiving a signal.

Zombie : The process is dead but have not been removed from the process table.

Setting up a VPN in Windows is a two step process:

Set up one computer to share files (server).

Set up another computer to access them (client).

Begin by setting up the server:

Open Internet Explorer and go to www.whatismyip.com. Write down the IP address.

You will need it to configure the client.

1. Click the Start button and click Run.

2. Type control and hit Enter.

3. Click Network and Internet Connections.

4. Click Network Connections .

5. Click Create a New Connection, which is the first option on the left toolbar.

Page 112: Linux Windows Networking Interview Questions Asked 11111

112

6. The New Connection Wizard will open. Click Next.

7. Choose Set up an advanced connection, the last element on the list. Click Next .

8. Choose Accept incoming connections. Click Next.

9. You will see the Devices for Incoming Connections screen.

10. Do not select anything on this screen. Click Next.

11. Select Allow virtual private connections. Click Next.

12. Select to whom you want to give access. Click Next. If a user is not listed, you

will have to add an account. See "Related Wikihows" for more information.

13. Do not change anything on the Networking Software screen. Click Next.

That's it! Your computer is now set up to allow for VPNs. Click Finish to complete the

wizard.

Now proceed to connect the client:

1. Click the Start button and click Run.

2. Type control and hit Enter.

3. Click Network and Internet Connections.

4. Click Network Connections.

5. Click Create a New Connection, which is the first option on the left toolbar.

6. The New Connection Wizard will open. Click Next.

7. Select Connect to the network at my workplace and click Next.

8. Select Virtual Private Network connection and click Next.

9. Type the name of your network in the blank box. Click Next.

10. Enter the IP address you wrote down earlier and click Next.

11. Select Add a shortcut to this connection to my desktop and click Finish.Tips :

1. Both computers must be connected to the internet.

2. The user name and password must be entered exactly as you saved them.

3. The IP address must be written exactly as listed on the screen.

4. If the VPN doesn't work, turn off your firewall. Warnings :

Do not give access to the "guest" account. It does not require a password, allowing

anyone to access the VPN.

How to Configure DHCP in your PC..

Dynamic Host Configuration Protocol (DHCP) is the configuration of your Internet

Protocol (IP) address, subnet mask, DNS servers, domain name suffix and about 200

other possible options to let your computer communicate with a network automatically

Page 113: Linux Windows Networking Interview Questions Asked 11111

113

via a server or router. It sounds complicated, but once set up, it can make connecting

to a network much easier.

Steps :

1. Log into Windows XP with administrator rights. This makes setting up the

network for you, and other users, easier as you can make all the necessary

changes to settings.

2. Look for the Network Neighborhood or My Network Places icon in your desktop.

If it is not there, try your Start Menu. 

Right-click the Network Neighborhood/ My Network Places icon. A drop-down

menu will appear.

3. Choose the "Properties" option, generally found at the bottom of the menu.

4. Look for an icon named "Local Area Connection". The icon looks like a pair of

computer connected by a link. Double-click this icon.

5. Click the "General" tab, if it is not already selected. You will see a list of

protocols to choose form.

6. Scroll down and choose Internet Protocol (TCP/IP), and then click the button that

is labeled "Properties" .

7. Again, click the "General" tab, it it is not alreay selected. You will see two

choices:

o "Obtain an IP address Automatically"

o "Use the following IP address..."

8. Choose option 1

You have effectively configured DHCP for your PC. When your computer obtains the IP

address, it will also obtain DNS server information automatically. This is provided by

your dhcp server.

Tips :

1. Make sure your NIC (Network Card)is working properly.

2. Make sure you are connected directly to a router, switch or hub.

3. Make sure the Link light is on. (small green light where the cable plugs into the

computer)

4. If you are connected to a LAN, make sure that you have a router that will give

addresses away, since the address will be obtained by the PC from the router.

5. If you have a Server on the LAN such as Windows 2000 or 2003, make sure the

server is configured DHCP enabled as well.

Page 114: Linux Windows Networking Interview Questions Asked 11111

114

Networking Interview Questions and Answers :

1. What is an Object server?

With an object server, the Client/Server application is written as a set of

communicating objects. Client object communicate with server objects using an Object

Request Broker (ORB). The client invokes a method on a remote object. The ORB

locates an instance of that object server class, invokes the requested method and

returns the results to the client object. Server objects must provide support for

concurrency and sharing. The ORB brings it all together.

2. What is a Transaction server?

With a transaction server, the client invokes remote procedures that reside on the

server with an SQL database engine. These remote procedures on the server execute

a group of SQL statements. The network exchange consists of a single request/reply

message. The SQL statements either all succeed or fail as a unit.

3. What is a Database Server?

With a database server, the client passes SQL requests as messages to the database

server. The results of each SQL command are returned over the network. The server

uses its own processing power to find the request data instead of passing all the

records back to the client and then getting it find its own data. The result is a much

more efficient use of distributed processing power. It is also known as SQL engine.

4. What are the most typical functional units of the Client/Server

applications?

User interface

Business Logic and

Shared data.

5. What are all the Extended services provided by the OS?

Ubiquitous communications

Network OS extension

Binary large objects (BLOBs)

Global directories and Network yellow pages

Authentication and Authorization services

System management

Network time

Database and transaction services

Internet services

Page 115: Linux Windows Networking Interview Questions Asked 11111

115

Object- oriented services

6. What are Triggers and Rules?

Triggers are special user defined actions usually in the form of stored procedures, that

are automatically invoked by the server based on data related events. It can perform

complex actions and can use the full power of procedural languages.

A rule is a special type of trigger that is used to perform simple checks on data.

7. What is meant by Transparency?

Transparency really means hiding the network and its servers from the users and even

the application programmers.

8. What are TP-Lite and TP-Heavy Monitors?

TP-Lite is simply the integration of TP Monitor functions in the database engines. TP-

Heavy are TP Monitors which supports the Client/Server architecture and allow PC to

initiate some very complex multiserver transaction from the desktop.

9. What are the two types of OLTP?

TP lite, based on stored procedures. TP heavy, based on the TP monitors.

10. What is a Web server?

This new model of Client/Server consists of thin, protable, "universal" clients that talk

to superfat servers. In the simplet form, a web server returns documents when clients

ask for them by name. The clients and server communicate using an RPC-like protocol

called HTTP.

11. What are Super servers?

These are fully-loaded machines which includes multiprocessors, high-speed disk

arrays for intervive I/O and fault tolerant features.

12. What is a TP Monitor?

There is no commonly accepted definition for a TP monitor. According to Jeri Edwards'

a TP Monitor is "an OS for transaction processing".

13. TP Monitor does mainly two things extremely well. They are Process

management and Transaction management.?

They were originally introduced to run classes of applications that could service

hundreds and sometimes thousands of clients. TP Monitors provide an OS - on top of

existing OS - that connects in real time these thousands of humans with a pool of

shared server processes.

Page 116: Linux Windows Networking Interview Questions Asked 11111

116

14. What is meant by Asymmetrical protocols?

There is a many-to-one relationship between clients and server. Clients always initiate

the dialog by requesting a service. Servers are passively awaiting for requests from

clients.

15. What are the types of Transparencies?

The types of transparencies the NOS middleware is expected to provide are:-

Location transparency

Namespace transparency

Logon transparency

Replication transparency

Local/Remote access transparency

Distributed time transparency

Failure transparency and

Administration transparency.

16. What is the difference between trigger and rule?

The triggers are called implicitly by database generated events, while stored

procedures are called explicitly by client applications.

17. What are called Transactions?

The grouped SQL statements are called Transactions (or) A transaction is a collection

of actions embused with ACID properties.

18. What are the building blocks of Client/Server?

The client

The server and

Middleware.

19. Explain the building blocks of Client/Server?

The client side building block runs the client side of the application.

The server side building block runs the server side of the application.

20. The middleware buliding block runs on both the client and server sides of

an application. It is broken into three categories:-

Transport stack

Network OS

Service-specific middleware.

21. What are all the Base services provided by the OS?

Page 117: Linux Windows Networking Interview Questions Asked 11111

117

Task preemption

Task priority

Semaphores

Interprocess communications (IPC)

Local/Remote Interprocess communication

Threads

Intertask protection

Multiuser

High performance file system

Efficient memory management and

Dynamically linked Run-time extensions.

22. What are the roles of SQL?

SQL is an interactive query language for ad hoc database queries.

SQL is a database programming language.

SQL is a data definition and data administration language.

SQL is the language of networked database servers

SQL helps protect the data in a multi-user networked environment.

Because of these multifacted roles it plays, physicists might call SQL as "The

grand unified theory of database".

23. What is Structured Query Langauge (SQL)?

SQL is a powerful set-oriented language which was developed by IBM research for the

databases that adhere to the relational model. It consists of a short list of powerful, yet

highly flexible, commands that can be used to manipulate information collected in

tables. Through SQL, we can manipulate and control sets of records at a time.

24. What are the characteristics of Client/Server?

Service

Shared resources

Asymmentrical protocols

Transparency of location

Mix-and-match

Message based exchanges

Encapsulation of services

Scalability

Integrity

Page 118: Linux Windows Networking Interview Questions Asked 11111

118

Client/Server computing is the ultimate "Open platform". It gives the freedom to mix-

and-match components of almost any level. Clients and servers are loosely coupled

systems that interact through a message-passing mechanism.

25. What is Remote Procedure Call (RPC)?

RPC hides the intricacies of the network by using the ordinary procedure call

mechanism familiar to every programmer. A client process calls a function on a remote

server and suspends itself until it gets back the results. Parameters are passed like in

any ordinary procedure. The RPC, like an ordinary procedure, is synchoronous. The

process that issues the call waits until it gets the results.

Under the covers, the RPC run-time software collects values for the parameters, forms

a message, and sends it to the remote server. The server receives the request, unpack

the parameters, calls the procedures, and sends the reply back to the client. It is a

telephone-like metaphor.

26. What are the main components of Transaction-based Systems?

Resource Manager

Transaction Manager and

Application Program.

27. What are the three types of SQL database server architecture?

Process-per-client Architecture. (Example: Oracle 6, Informix )

Multithreaded Architecture. (Example: Sybase, SQL server)

Hybrid Architecture (Example: Oracle 7)

28. What are the Classification of clients?

Non-GUI clients - Two types are:-

1. Non-GUI clients that do not need multi-tasking

(Example: Automatic Teller Machines (ATM), Cell phone)

2. Non-GUI clients that need multi-tasking

(Example: ROBOTs)

GUI clients

OOUI clients

29. What are called Non-GUI clients, GUI Clients and OOUI Clients?

Non-GUI Client: These are applications, generate server requests with a minimal

amount of human interaction.

GUI Clients: These are applicatoins, where occassional requests to the server result

Page 119: Linux Windows Networking Interview Questions Asked 11111

119

from a human interacting with a GUI

(Example: Windows 3.x, NT 3.5)

OOUI clients : These are applications, which are highly-iconic, object-oriented user

interface that provides seamless access to information in very visual formats.

(Example: MAC OS, Windows 95, NT 4.0)

30. What is Message Oriented Middleware (MOM)?

MOM allows general purpose messages to be exchanged in a Client/Server system

using message queues. Applications communicate over networks by simply putting

messages in the queues and getting messages from queues. It typically provides a

very simple high level APIs to its services.

MOM's messaging and queuing allow clients and servers to communicate across a

network without being linked by a private, dedicated, logical connection. The clients

and server can run at different times. It is a post-office like metaphor.

31. What is meant by Middleware?

Middleware is a distributed software needed to support interaction between clients

and servers. In short, it is the software that is in the middle of the Client/Server

systems and it acts as a bridge between the clients and servers. It starts with the API

set on the client side that is used to invoke a service and it covers the transmission of

the request over the network and the resulting response.

It neither includes the software that provides the actual service - that is in the servers

domain nor the user interface or the application login - that's in clients domain.

32. What are the functions of the typical server program?

It waits for client-initiated requests. Executes many requests at the same time. Takes

care of VIP clients first. Initiates and runs background task activity. Keeps running.

Grown bigger and faster.

33. What is meant by Symmentric Multiprocessing (SMP)?

It treats all processors as equal. Any processor can do the work of any other processor.

Applications are divided into threads that can run concurrently on any available

processor. Any processor in the pool can run the OS kernel and execute user-written

threads.

34. What are Service-specific middleware?

It is needed to accomplish a particular Client/Server type of services which includes:-

Database specific middleware

OLTP specific middleware

Page 120: Linux Windows Networking Interview Questions Asked 11111

120

Groupware specific middleware

Object specific middleware

Internet specific middleware and

System management specific middleware.

35. What are General Middleware?

It includes the communication stacks, distributed directories, authentication services,

network time, RPC, Queuing services along with the network OS extensions such as

the distributed file and print services.

36. What is meant by Asymmetric Multiprocessing (AMP)?

It imposses hierarchy and a division of labour among processors. Only one designated

processor, the master, controls (in a tightly coupled arrangement) slave processors

dedicated to specific functions.

37. What is OLTP?

In the transaction server, the client component usually includes GUI and the server

components usually consists of SQL transactions against a database. These

applications are called OLTP (Online Transaction Processing) OLTP Applications

typically,

Receive a fixed set of inputs from remote clients. Perform multiple pre-compiled SQL

comments against a local database. Commit the work and Return a fixed set of results.

38. What is meant by 3-Tier architecture?

In 3-tier Client/Server systems, the application logic (or process) lives in the middle tier

and it is separated from the data and the user interface. In theory, the 3-tier

Client/Server systems are more scalable, robust and flexible.

Example: TP monitor, Web.

39. What is meant by 2-Tier architecture?

In 2-tier Client/Server systems, the application logic is either burried inside the user

interface on the client or within the database on the server.

Example: File servers and Database servers with stored procedures.

40. What is Load balancing?

If the number of incoming clients requests exceeds the number of processes in a

server class, the TP Monitor may dynamically start new ones and this is called Load

balancing.

41. What are called Fat clients and Fat servers?

Page 121: Linux Windows Networking Interview Questions Asked 11111

121

If the bulk of the application runs on the Client side, then it is Fat clients. It is used for

decision support and personal software.

If the bulk of the application runs on the Server side, then it is Fat servers. It tries to

minimize network interchanges by creating more abstract levels of services.

42. What is meant by Horizontal scaling and Vertical scaling?

Horizontal scaling means adding or removing client workstations with only a slight

performance impact. Vertical scaling means migrating to a larger and faster server

machine or multiservers.

43. What is Groupware server?

Groupware addresses the management of semi-structured information such as text,

image, mail, bulletin boards and the flow of work. These Client/Server systems have

people in direct contact with other people.

44. What are the two broad classes of middleware?

General middleware

Service-specific middleware.

45. What are the types of Servers?

File servers

Database servers Transaction servers Groupware servers

Object servers Web servers.

46. What is a File server?

File servers are useful for sharing files across a network. With a file server, the client

passes requests for file records over nerwork to file server.

47. What are the five major technologies that can be used to create

Client/Server applications?

Database Servers

TP Monitors

Groupware

Distributed Objects

Intranets.

48. What is Client/Server?

Clients and Servers are separate logical entities that work together over a network to

accomplish a task. Many systems with very different architectures that are connected

together are also called Client/Server.

Page 122: Linux Windows Networking Interview Questions Asked 11111

122

49. List out the benefits obtained by using the Client/Server oriented TP

Monitors?

Client/Server applications development framework.

Firewalls of protection.

High availability.

Load balancing.

MOM integration.

Scalability of functions.

Reduced system cost.

50. What are the services provided by the Operating System?

Extended services - These are add-on modular software components that are

layered on top of base service.

BandWidth Explained

Most hosting companies offer a variety of bandwidth options in their plans. So exactly

what is bandwidth as it relates to web hosting? Put simply, bandwidth is the amount of

traffic that is allowed to occur between your web site and the rest of the internet. The

amount of bandwidth a hosting company can provide is determined by their network

connections, both internal to their data center and external to the public internet.

Network Connectivity :

The internet, in the most simplest of terms, is a group of millions of computers

connected by networks. These connections within the internet can be large or small

depending upon the cabling and equipment that is used at a particular internet

location. It is the size of each network connection that determines how much

bandwidth is available. For example, if you use a DSL connection to connect to the

internet, you have 1.54 Mega bits (Mb) of bandwidth. Bandwidth therefore is measured

in bits (a single 0 or 1). Bits are grouped in bytes which form words, text, and other

information that is transferred between your computer and the internet.

If you have a DSL connection to the internet, you have dedicated bandwidth between

your computer and your internet provider. But your internet provider may have

thousands of DSL connections to their location. All of these connection aggregate at

Page 123: Linux Windows Networking Interview Questions Asked 11111

123

your internet provider who then has their own dedicated connection to the internet (or

multiple connections) which is much larger than your single connection. They must

have enough bandwidth to serve your computing needs as well as all of their other

customers. So while you have a 1.54Mb connection to your internet provider, your

internet provider may have a 255Mb connection to the internet so it can accommodate

your needs and up to 166 other users (255/1.54).

Traffic :

A very simple analogy to use to understand bandwidth and traffic is to think of

highways and cars. Bandwidth is the number of lanes on the highway and traffic is the

number of cars on the highway. If you are the only car on a highway, you can travel

very quickly. If you are stuck in the middle of rush hour, you may travel very slowly

since all of the lanes are being used up.

Traffic is simply the number of bits that are transferred on network connections. It is

easiest to understand traffic using examples. One Gigabyte is 2 to the 30th power

(1,073,741,824) bytes. One gigabyte is equal to 1,024 megabytes. To put this in

perspective, it takes one byte to store one character. Imagine 100 file cabinets in a

building, each of these cabinets holds 1000 folders. Each folder has 100 papers. Each

paper contains 100 characters - A GB is all the characters in the building. An MP3 song

is about 4MB, the same song in wav format is about 40MB, a full length movie can be

800MB to 1000MB (1000MB = 1GB).

If you were to transfer this MP3 song from a web site to your computer, you would

create 4MB of traffic between the web site you are downloading from and your

computer. Depending upon the network connection between the web site and the

internet, the transfer may occur very quickly, or it could take time if other people are

also downloading files at the same time. If, for example, the web site you download

from has a 10MB connection to the internet, and you are the only person accessing

that web site to download your MP3, your 4MB file will be the only traffic on that web

site. However, if three people are all downloading that same MP at the same time,

12MB (3 x 4MB) of traffic has been created. Because in this example, the host only has

10MB of bandwidth, someone will have to wait. The network equipment at the hosting

company will cycle through each person downloading the file and transfer a small

portion at a time so each person's file transfer can take place, but the transfer for

everyone downloading the file will be slower. If 100 people all came to the site and

downloaded the MP3 at the same time, the transfers would be extremely slow. If the

Page 124: Linux Windows Networking Interview Questions Asked 11111

124

host wanted to decrease the time it took to download files simultaneously, it could

increase the bandwidth of their internet connection (at a cost due to upgrading

equipment).

Hosting Bandwidth :

In the example above, we discussed traffic in terms of downloading an MP3 file.

However, each time you visit a web site, you are creating traffic, because in order to

view that web page on your computer, the web page is first downloaded to your

computer (between the web site and you) which is then displayed using your browser

software (Internet Explorer, Netscape, etc.) . The page itself is simply a file that

creates traffic just like the MP3 file in the example above (however, a web page is

usually much smaller than a music file).

A web page may be very small or large depending upon the amount of text and the

number and quality of images integrated within the web page. For example, the home

page for CNN.com is about 200KB (200 Kilobytes = 200,000 bytes = 1,600,000 bits).

This is typically large for a web page. In comparison, Yahoo's home page is about

70KB.

How Much Bandwidth Is Enough?

It depends (don't you hate that answer). But in truth, it does. Since bandwidth is a

significant determinant of hosting plan prices, you should take time to determine just

how much is right for you. Almost all hosting plans have bandwidth requirements

measured in months, so you need to estimate the amount of bandwidth that will be

required by your site on a monthly basis

If you do not intend to provide file download capability from your site, the formula for calculating bandwidth is fairly straightforward:

Average Daily Visitors x Average Page Views x Average Page Size x 31 x Fudge Factor

If you intend to allow people to download files from your site, your bandwidth

calculation should be:

[(Average Daily Visitors x Average Page Views x Average Page Size) + (Average Daily

File Downloads x Average File Size)] x 31 x Fudge Factor

Let us examine each item in the formula:

Page 125: Linux Windows Networking Interview Questions Asked 11111

125

Average Daily Visitors - The number of people you expect to visit your site, on

average, each day. Depending upon how you market your site, this number could be

from 1 to 1,000,000.

Average Page Views - On average, the number of web pages you expect a person to

view. If you have 50 web pages in your web site, an average person may only view 5

of those pages each time they visit.

Average Page Size - The average size of your web pages, in Kilobytes (KB). If you

have already designed your site, you can calculate this directly.

Average Daily File Downloads - The number of downloads you expect to occur on

your site. This is a function of the numbers of visitors and how many times a visitor

downloads a file, on average, each day.

Average File Size - Average file size of files that are downloadable from your site.

Similar to your web pages, if you already know which files can be downloaded, you can

calculate this directly.

Fudge Factor - A number greater than 1. Using 1.5 would be safe, which assumes

that your estimate is off by 50%. However, if you were very unsure, you could use 2 or

3 to ensure that your bandwidth requirements are more than met.

Usually, hosting plans offer bandwidth in terms of Gigabytes (GB) per month. This is

why our formula takes daily averages and multiplies them by 31.

Summary :

Most personal or small business sites will not need more than 1GB of bandwidth per

month. If you have a web site that is composed of static web pages and you expect

little traffic to your site on a daily basis, go with a low bandwidth plan. If you go over

the amount of bandwidth allocated in your plan, your hosting company could charge

you over usage fees, so if you think the traffic to your site will be significant, you may

want to go through the calculations above to estimate the amount of bandwidth

required in a hosting plan.

*To display a list of all manual pages containing the keyword "date", what command would you type?Code:

man -k dateman -f date

Page 126: Linux Windows Networking Interview Questions Asked 11111

126

Linux / UNIX: Getting help with man page

* What command will display the first several lines of a file called "junk"?Code:

head junkman head

== Users and permissions practicum ==* Rig it so everything in the folder gets deleted tonight at 10pm. Every night at 10pm.Set cronjob, see How do I add jobs to cron under Linux or UNIX oses?

== Local security ==* How do you feel about `sudo`?sudo allows a permitted user to execute a command as the superuser or another user. sudo is much better than su and you don't have to share root password with other users/admin.Linux sudo Configuration

* What's the difference between `telnet` and `ssh`? What's a good use for each?TELNET, by default, does not encrypt any data sent over the connection (including password, and so it is often practical to eavesdrop on the communications and use the password later for malicious purposes;SSH by default encrypt password and traffic. SSH is recommended for all use.

* How do you ensure your users have hard-to-guess passwords?Set password policy, seeHowto: Protect account against a password cracking attack

Linux check passwords against a dictionary attack

Linux Password Cracking: Explain unshadow and john commands ( john the ripper tool )

== Filesystem ==* What is the difference between a symbolic and hard link? When would you use each?How to: Linux / UNIX create soft link with ln command

Understanding UNIX / Linux symbolic (soft) and hard links

* I have a file named `-fr`. How do I get rid of it?Code:

rm -- -frrm \-rf

How to: Linux / UNIX Delete or Remove Files With Inode Number

* Why did I just ask that question?For testing UNIX concepts and command line args.

* To partition or not? How?Sure. See The importance of Linux partitions

* What are RAID 0, 1, 5, 0+1? What level would you use for a web server and why? A database server?See level @ What are the different RAID levels for Linux / UNIX and Windows Server?

Page 127: Linux Windows Networking Interview Questions Asked 11111

127

More about RAID - Can RAID Act As The Reliable BACKUP Solution For Linux / UNIX / Windows Server?

Linux Check The Health of Adaptec RAID array

== `/etc` ==* `ls -l /etc`. What is all this stuff?See, Linux / UNIX - Display the permissions of a file

* You added a line to `/etc/aliases`, but it doesn't seem to be working. Why?Restart sendmail so that file get updated. The program "newaliases" must be run after this file is updated for any changes to show through to sendmail / postfix.Code:

newaliases

* You've created a `zope` user to run Zope under. How do you secure it so someone doesn't guess its password, log in with it, and mess with stuff?Deny login access to zope and set shell to /sbin/nologin. There are other ways too...

* Bring up `/etc/passwd`. What is all this junk?See, Understanding /etc/passwd file format

* What are shadow passwords?/etc/shadow file stores actual password in encrypted format for user's account with additional properties related to user passwordUnderstanding /etc/ shadow file

== Processes ==* How many processes are running on your machine right now?Code:

topatopps -eps auxps aux | wc -lman ps

== Shells ==* Name as many shells as you can.Bourne shell (sh)Almquist shell (ash)Debian Almquist shell (dash)Bourne-Again shell (bash)Friendly interactive shell (fish)Korn shell (ksh)C shell (csh)TENEX C shell (tcsh)Es shell (eesh (Unix) Easy Shellrc shell (rc) - shell for Plan 9 and Unixrunscript The initial shell interpreter used to process startup scripts in Gentooscsh (Scheme Shell)Stand-alone Shell (sash)Z shell (zsh)

Page 128: Linux Windows Networking Interview Questions Asked 11111

128

* What's your favorite shell? Why?bash - it rocks and feature rich. 

* Write a shell script to append "snork" to the file "test" but only if "test" already exists.Code:

[ -f test ] && echo "snork" >> test ||:

* A user performed a `cd; chmod 644 .` before logging out. What problem occurs when he logs in the next time, and what level of privilege is required to correct the problem?User will not able to login. A root user can this problem by resting permissioncmod perm /home/user. is current directory.. parent directory 

== Startup ==* Describe the boot process of your favorite Linux in as much detail as you can.See redhat or any other distro doc 

* What are runlevels?The term runlevel refers to a mode of operation in one of the computer operating systems that implement Unix System V-style initialization. Conventionally, seven runlevels exist, numbered from zero to six, though up to ten, from zero to nine, may be used.Code:

man initman runlevel

== Social ==* Describe an experience you had with a difficult user.* How do you keep up with current tools and practices?* How did you document your work at your last job so someone else could pick up where you left off?Use our social skillz

== Totally miscellaneous ==* When debugging a core in gdb, what does the command `bt` give: core memory, heap usage, or calling stack?Code:

man gdbRead gdb page

* A user complains the web site is slow. What do you do?Ask user to upgrade internet connection. If using windows ask to reboot windows .. LOL just kidding, google for slow apache problem. There could be zillions of causes 

== Apache ==* How do you rig Apache to start up on boot?Code:

chkconfig httpd on

* Apache doesn't start up on boot, and the thing above checks out okay. How do you track down the problem?

Page 129: Linux Windows Networking Interview Questions Asked 11111

129

Code:

chkconfig httpd onhttpd -tservice httpd onnetstat -tulpn | grep 80tail -f /var/log/httpd/access_logtail -f /var/log/httpd/error_log

HTH

Quote:

Originally Posted by pansarevai 1. What is the transparent proxy?

The client / browser does not need to configure a proxy and cannot directly detect that its requests are being proxied via squid or other proxy server. Linux: Setup a transparent proxy with Squid in three easy steps

Quote:

Originally Posted by pansarevai 2.Can a squid proxy server is used as DNS, if yes how?

No, you need to use caching dns or use ISP dns.How To Set Caching DNS Server

Quote:

Originally Posted by pansarevai 3.Is swap partition mandatory in any installation, and why it is necessary to define at the time of installation?

Yes, it is used to improve performance. Most installer force to create swap partition. You can install Linux w/o swap if you have tons of ram.Quote:

Originally Posted by pansarevai 4.can Apache be use as proxy server? how? What is reverse proxy?

A reverse proxy is a proxy server that is installed in the neighborhood of one or more web servers. All traffic coming from the Internet and with a destination of one of the web servers goes through the proxy server. Apache has mod_proxy for proxy support.Quote:

Originally Posted by pansarevai 5.What is the ssh version you are using. What are the drawbacks of ssh?

No drawbacks,Code:

sshd -v

Quote:

Page 130: Linux Windows Networking Interview Questions Asked 11111

130

Originally Posted by pansarevai .6 What is the difference between ssh version 1 and 2?

SSH Frequently Asked Questions

LINUX Interview Questions with Answers

3.1  LINUX Subjective Questions with Answers3.2   LINUX Interview Questions with Answers3.3   LINUX Objective Questions And Answers3.3   FAQS

Introduction of Linux -

    Linux is an operating system. An operating system is the basic set of programs and utilities that make your computer run. Some other common operating systems are Unix (and its variants BSD, AIX, Solaris, HP-UX, and others) DOS, Microsoft Windows, Amiga, Google Chrome and Mac OS.Linux is an ideal operating system for power-users and programmers.    Linux is a UNIX-based operating system originally developed as for Intel-compatible PC's. Linux is built and supported by a large internationalcommunity of developers and users dedicated to free, open-source software.    This community sees Linux as an alternative to such proprietary systems as Windows and Solaris, and as a platform for alternatives to suchproprietary applications as MS Office, Internet Explorer, and Outlook.

History of Linux - 

1969 Summer 1969 Unix was developed.1969 Linus Torvalds is born.1971 First edition of Unix released 11/03/1971. 

      In 1991, Linux is introduced by Linus Torvalds, a student in Finland. In Helsinki, Linus Torvalds began a project that later became the Linux kernel. It was initially a terminal emulator, which Torvalds used to access the large UNIX servers of the university. 

In 2001 Linus Torvalds releases version 2.4 of the Linux Kernel source code on January 4th. The first release of Ubuntu is released October 20, 2004.

Why  use Linux?

Configurability Convenience Stability Community Freedom

Programming on Linux -

   Linux supports many programming languages like  Ada, C, C++, Java, and Fortran. Linux include the Intel C++ Compiler, Sun Studio, and IBM XL. C/C++ Compiler. Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. While not as common, Linux also supports C# (via Mono), Vala, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the

Page 131: Linux Windows Networking Interview Questions Asked 11111

131

original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.

Architecture of Linux-

   

Advantages of Linux -

Linux is free. Linux is portable to any hardware platform. Linux was made to keep on running. Linux is secure and versatile. Linux is scalable. The Linux OS and most Linux applications have very short debug-times. 

 

Disadvantages of Linux -

Linux is not very user friendly and confusing for beginners. More technical ability needed. Not all hardware compatible.

Linux Interview Questions and Answers

You need to see the last fifteen lines of the files dog, cat and horse. What command should you use?tail -15 dog cat horse 

The tail utility displays the end of a file. The -15 tells tail to display the last fifteen lines of each specified file.

Who owns the data dictionary? The SYS user owns the data dictionary. The SYS and SYSTEM users are created when the database is created.

You routinely compress old log files. You now need to examine a log from two months ago. In order to view its contents without first having to decompress it, use the _________ utility. zcat 

The zcat utility allows you to examine the contents of a compressed file much the same way that cat displays a file.

Page 132: Linux Windows Networking Interview Questions Asked 11111

132

You suspect that you have two commands with the same name as the command is not producing the expected results. What command can you use to determine the location of the command being run? which 

The which command searches your path until it finds a command that matches the command you are looking for and displays its full path.

You locate a command in the /bin directory but do not know what it does. What command can you use to determine its purpose. whatis 

The whatis command displays a summary line from the man page for the specified command.

You wish to create a link to the /data directory in bob's home directory so you issue the command ln /data /home/bob/datalink but the command fails. What option should you use in this command line to be successful. Use the -F option 

In order to create a link to a directory you must use the -F option.

When you issue the command ls -l, the first character of the resulting display represents the file's ___________. type 

The first character of the permission block designates the type of file that is being displayed.

What utility can you use to show a dynamic listing of running processes? __________ top 

The top utility shows a listing of all running processes that is dynamically updated.

Where is standard output usually directed? to the screen or display 

By default, your shell directs standard output to your screen or display.

You wish to restore the file memo.ben which was backed up in the tarfile MyBackup.tar. What command should you type? tar xf MyBackup.tar memo.ben 

This command uses the x switch to extract a file. Here the file memo.ben will be restored from the tarfile MyBackup.tar.

You need to view the contents of the tarfile called MyBackup.tar. What command would you use?tar tf MyBackup.tar 

The t switch tells tar to display the contents and the f modifier specifies which file to examine.

You want to create a compressed backup of the users' home directories. What utility should you use? tar 

You can use the z modifier with tar to compress your archive at the same time as creating it.

What daemon is responsible for tracking events on your system? syslogd 

The syslogd daemon is responsible for tracking system information and saving it to specified log files.

Page 133: Linux Windows Networking Interview Questions Asked 11111

133

You have a file called phonenos that is almost 4,000 lines long. What text filter can you use to split it into four pieces each 1,000 lines long? split 

The split text filter will divide files into equally sized pieces. The default length of each piece is 1,000 lines.

You would like to temporarily change your command line editor to be vi. What command should you type to change it? set -o vi 

The set command is used to assign environment variables. In this case, you are instructing your shell to assign vi as your command line editor. However, once you log off and log back in you will return to the previously defined command line editor.

What account is created when you install Linux? root 

Whenever you install Linux, only one user account is created. This is the superuser account also known as root.

What command should you use to check the number of files and disk space used and each user's defined quotas? 

repquota 

The repquota command is used to get a report on the status of the quotas you have set including the amount of allocated space and amount of used space.

In order to run fsck on the root partition, the root partition must be mounted as readonly 

You cannot run fsck on a partition that is mounted as read-write.

In order to improve your system's security you decide to implement shadow passwords. What command should you use? pwconv 

The pwconv command creates the file /etc/shadow and changes all passwords to 'x' in the /etc/passwd file.

Bob Armstrong, who has a username of boba, calls to tell you he forgot his password. What command should you use to reset his command? passwd boba 

The passwd command is used to change your password. If you do not specify a username, your password will be changed.

The top utility can be used to change the priority of a running process? Another utility that can also be used to change priority is ___________? nice 

Both the top and nice utilities provide the capability to change the priority of a running process.

What command should you type to see all the files with an extension of 'mem' listed in reverse alphabetical order in the /home/ben/memos directory. ls -r /home/ben/memos/*.mem 

The -c option used with ls results in the files being listed in chronological order. You can use wildcards with the ls command to specify a pattern of filenames.

Page 134: Linux Windows Networking Interview Questions Asked 11111

134

What file defines the levels of messages written to system log files? kernel.h 

To determine the various levels of messages that are defined on your system, examine the kernel.h file.

What command is used to remove the password assigned to a group? gpasswd -r 

The gpasswd command is used to change the password assigned to a group. Use the -r option to remove the password from the group.

What command would you type to use the cpio to create a backup called backup.cpio of all the users' home directories? find /home | cpio -o > backup.cpio 

The find command is used to create a list of the files and directories contained in home. This list is then piped to the cpio utility as a list of files to include and the output is saved to a file called backup.cpio.

What can you type at a command line to determine which shell you are using? echo $SHELL 

The name and path to the shell you are using is saved to the SHELL environment variable. You can then use the echo command to print out the value of any variable by preceding the variable's name with $. Therefore, typing echo $SHELL will display the name of your shell.

What type of local file server can you use to provide the distribution installation materials to the new machine during a network installation?A) InetdB) FSSTNDC) DNSD) NNTPE) NFS E - You can use an NFS server to provide the distribution installation materials to the machine on which you are performing the installation. Answers a, b, c, and d are all valid items but none of them are file servers. Inetd is the superdaemon which controls all intermittently used network services. The FSSTND is the Linux File System Standard. DNS provides domain name resolution, and NNTP is the transfer protocol for usenet news.

If you type the command cat dog & > cat what would you see on your display? Choose one: a. Any error messages only.b. The contents of the file dog.c. The contents of the file dog and any error messages.d. Nothing as all output is saved to the file cat. 

When you use & > for redirection, it redirects both the standard output and standard error. The output would be saved to the file cat.

You are covering for another system administrator and one of the users asks you to restore a file for him. You locate the correct tarfile by checking the backup log but do not know how the directory structure was stored. What command can you use to determine this? Choose one:a. tar fx tarfile dirnameb. tar tvf tarfile filenamec. tar ctf tarfiled. tar tvf tarfile 

Page 135: Linux Windows Networking Interview Questions Asked 11111

135

The t switch will list the files contained in the tarfile. Using the v modifier will display the stored directory structure.

You have the /var directory on its own partition. You have run out of space. What should you do? Choose one:a. Reconfigure your system to not write to the log files.b. Use fips to enlarge the partition.c. Delete all the log files.d. Delete the partition and recreate it with a larger size. 

The only way to enlarge a partition is to delete it and recreate it. You will then have to restore the necessary files from backup.

You have a new application on a CD-ROM that you wish to install. What should your first step be? Choose one:a. Read the installation instructions on the CD-ROM.b. Use the mount command to mount your CD-ROM as read-write.c. Use the umount command to access your CD-ROM.d. Use the mount command to mount your CD-ROM as read-only. 

Before you can read any of the files contained on the CD-ROM, you must first mount the CD-ROM.

When you create a new partition, you need to designate its size by defining the starting and ending _____________. cylinders 

When creating a new partition you must first specify its starting cylinder. You can then either specify its size or the ending cylinder.

What key combination can you press to suspend a running job and place it in the background?ctrl-z 

Using ctrl-z will suspend a job and put it in the background.

The easiest, most basic form of backing up a file is to _____ it to another location. copy 

The easiest most basic form of backing up a file is to make a copy of that file to another location such as a floppy disk.

What type of server is used to remotely assign IP addresses to machines during the installation process? A) SMBB) NFSC) DHCPD) FTE) HTTP

C - You can use a DHCP server to assign IP addresses to individual machines during the installation process. Answers a, b, d, and e list legitimate Linux servers, but these servers do not provide IP addresses. The SMB, or Samba, tool is used for file and print sharing across multi-OS networks. An NFS server is for file sharing across Linux net-works. FTP is a file storage

Page 136: Linux Windows Networking Interview Questions Asked 11111

136

server that allows people to browse and retrieve information by logging in to it, and HTTP is for the Web.

Which password package should you install to ensure that the central password file couldn't be stolen easily? A) PAMB) tcp_wrappersC) shadowD) securepassE) ssh

C - The shadow password package moves the central password file to a more secure location. Answers a, b, and e all point to valid packages, but none of these places the password file in a more secure location. Answer d points to an invalid package.

When using useradd to create a new user account, which of the following tasks is not done automatically.Choose one:a. Assign a UID.b. Assign a default shell.c. Create the user's home directory.d. Define the user's home directory.

The useradd command will use the system default for the user's home directory. The home directory is not created, however, unless you use the -m option.

You want to enter a series of commands from the command-line. What would be the quickest way to do this? Choose Onea. Press enter after entering each command and its argumentsb. Put them in a script and execute the scriptc. Separate each command with a semi-colon (;) and press enter after the last commandd. Separate each command with a / and press enter after the last command

The semi-colon may be used to tell the shell that you are entering multiple commands that should be executed serially. If these were commands that you would frequently want to run, then a script might be more efficient. However, to run these commands only once, enter the commands directly at the command line.

You attempt to use shadow passwords but are unsuccessful. What characteristic of the /etc/passwd file may cause this? Choose one:a. The login command is missing.b. The username is too long.c. The password field is blank.d. The password field is prefaced by an asterisk. 

The password field must not be blank before converting to shadow passwords.

When you install a new application, documentation on that application is also usually installed. Where would you look for the documentation after installing an application called MyApp?Choose one:a. /usr/MyAppb. /lib/doc/MyApp

Page 137: Linux Windows Networking Interview Questions Asked 11111

137

c. /usr/doc/MyAppd. In the same directory where the application is installed.

The default location for application documentation is in a directory named for the application in the /usr/doc directory.

What file would you edit in your home directory to change which window manager you want to use? A) XinitB) .xinitrcC) XF86SetupD) xstartE) xf86init

Answer: B - The ~/.xinitrc file allows you to set which window man-ager you want to use when logging in to X from that account. Answers a, d, and e are all invalid files. Answer c is the main X server configuration file.

What command allows you to set a processor-intensive job to use less CPU time? A) psB) niceC) chpsD) lessE) more

Answer: B - The nice command is used to change a job's priority level, so that it runs slower or faster. Answers a, d, and e are valid commands but are not used to change process information. Answer c is an invalid command.

While logged on as a regular user, your boss calls up and wants you to create a new user account immediately. How can you do this without first having to close your work, log off and logon as root? Choose one:a. Issue the command rootlog.b. Issue the command su and type exit when finished.c. Issue the command su and type logoff when finished.d. Issue the command logon root and type exit when finished. 

Answer: b You can use the su command to imitate any user including root. You will be prompted for the password for the root account. Once you have provided it you are logged in as root and can do any administrative duties.

There are seven fields in the /etc/passwd file. Which of the following lists all the fields in the correct order? Choose one:a. username, UID, GID, home directory, command, commentb. username, UID, GID, comment, home directory, commandc. UID, username, GID, home directory, comment, commandd. username, UID, group name, GID, home directory, commentAnswer: b The seven fields required for each line in the /etc/passwd file are username, UID, GID, comment, home directory, command. Each of these fields must be separated by a colon even if they are empty.

Which of the following commands will show a list of the files in your home directory including hidden files and the contents of all subdirectories?Choose one:a. ls -c homeb. ls -aR /home/username

Page 138: Linux Windows Networking Interview Questions Asked 11111

138

c. ls -aF /home/usernamed. ls -l /home/username

Answer: b The ls command is used to display a listing of files. The -a option will cause hidden files to be displayed as well. The -R option causes ls to recurse down the directory tree. All of this starts at your home directory.

In order to prevent a user from logging in, you can add a(n) ________at the beginning of the password field. Answer: asterick 

If you add an asterick at the beginning of the password field in the /etc/passwd file, that user will not be able to log in.

You have a directory called /home/ben/memos and want to move it to /home/bob/memos so you issue the command mv /home/ben/memos /home/bob. What is the results of this action?Choose one:a. The files contained in /home/ben/memos are moved to the directory /home/bob/memos/memos.b. The files contained in /home/ben/memos are moved to the directory /home/bob/memos.c. The files contained in /home/ben/memos are moved to the directory /home/bob/.d. The command fails since a directory called memos already exists in the target directory. 

Answer: a When using the mv command to move a directory, if a directory of the same name exists then a subdirectory is created for the files to be moved.

Which of the following tasks is not necessary when creating a new user by editing the /etc/passwd file? Choose one:a. Create a link from the user's home directory to the shell the user will use.b. Create the user's home directoryc. Use the passwd command to assign a password to the account.d. Add the user to the specified group.

Answer: a There is no need to link the user's home directory to the shell command. Rather, the specified shell must be present on your system.

You issue the following command useradd -m bobm But the user cannot logon. What is the problem?Choose one:a. You need to assign a password to bobm's account using the passwd command.b. You need to create bobm's home directory and set the appropriate permissions.c. You need to edit the /etc/passwd file and assign a shell for bobm's account.d. The username must be at least five characters long.

Answer: a The useradd command does not assign a password to newly created accounts. You will still need to use the passwd command to assign a password.

You wish to print the file vacations with 60 lines to a page. Which of the following commands will accomplish this? Choose one:a. pr -l60 vacations | lprb. pr -f vacations | lprc. pr -m vacations | lprd. pr -l vacations | lpr

Page 139: Linux Windows Networking Interview Questions Asked 11111

139

Answer: a The default page length when using pr is 66 lines. The -l option is used to specify a different length.

Which file defines all users on your system? Choose one:a. /etc/passwdb. /etc/usersc. /etc/passwordd. /etc/user.conf

Answer: a The /etc/passwd file contains all the information on users who may log into your system. If a user account is not contained in this file, then the user cannot log in.

Which two commands can you use to delete directories? A) rmB) rm -rfC) rmdirD) rdE) rd -rf

Answer(s): B, C - You can use rmdir or rm -rf to delete a directory. Answer a is incorrect, because the rm command without any specific flags will not delete a directory, it will only delete files. Answers d and e point to a non-existent command.

Which partitioning tool is available in all distributions? A) Disk DruidB) fdiskC) Partition MagicD) FAT32E) System Commander

Answer(s): B - The fdisk partitioning tool is available in all Linux distributions. Answers a, c, and e all handle partitioning, but do not come with all distributions. Disk Druid is made by Red Hat and used in its distribution along with some derivatives. Partition Magic and System Commander are tools made by third-party companies. Answer d is not a tool, but a file system type. Specifically, FAT32 is the file system type used in Windows 98.

Which partitions might you create on the mail server's hard drive(s) other than the root, swap, and boot partitions? [Choose all correct answers]A) /var/spoolB) /tmpC) /procD) /binE) /home

Answer(s): A, B, E - Separating /var/spool onto its own partition helps to ensure that if something goes wrong with the mail server or spool, the output cannot overrun the file system. Putting /tmp on its own partition prevents either software or user items in the /tmp directory from overrunning the file system. Placing /home off on its own is mostly useful for system re-installs or upgrades, allowing you to not have to wipe the /home hierarchy along with other areas. Answers c and d are not possible, as the /proc portion of the file system is virtual-held in RAM-not placed on the hard drives, and the /bin hierarchy is necessary for basic system functionality and, therefore, not one that you can place on a different partition.

When planning your backup strategy you need to consider how often you will perform a backup, how much time the backup takes and what media you will use. What other factor must you consider when planning your backup strategy? _________ 

Page 140: Linux Windows Networking Interview Questions Asked 11111

140

what to backup Choosing which files to backup is the first step in planning your backup strategy.

What utility can you use to automate rotation of logs? Answer: logrotate The logrotate command can be used to automate the rotation of various logs.

In order to display the last five commands you have entered using the history command, you would type ___________ .

Answer: history 5 The history command displays the commands you have previously entered. By passing it an argument of 5, only the last five commands will be displayed.

What command can you use to review boot messages? Answer: dmesg The dmesg command displays the system messages contained in the kernel ring buffer. By using this command immediately after booting your computer, you will see the boot messages.

What is the minimum number of partitions you need to install Linux? Answer: 2 Linux can be installed on two partitions, one as / which will contain all files and a swap partition.

What is the name and path of the main system log? Answer: /var/log/messages By default, the main system log is /var/log/messages.

Of the following technologies, which is considered a client-side script? A) JavaScriptB) JavaC) ASPD) C++

Answer: A - JavaScript is the only client-side script listed. Java and C++ are complete programming languages. Active Server Pages are parsed on the server with the results being sent to the client in HTML

There are seven fields in the /etc/passwd file. Which of the following lists all the fields in the correct order? Choose one:a. username, UID, GID, home directory, command, commentb. username, UID, GID, comment, home directory, commandc. UID, username, GID, home directory, comment, commandd. username, UID, group name, GID, home directory, commentAnswer: b The seven fields required for each line in the /etc/passwd file are username, UID, GID, comment, home directory, command. Each of these fields must be separated by a colon even if they are empty.

Which of the following commands will show a list of the files in your home directory including hidden files and the contents of all subdirectories?Choose one:a. ls -c homeb. ls -aR /home/usernamec. ls -aF /home/usernamed. ls -l /home/username

Answer: b The ls command is used to display a listing of files. The -a option will cause hidden files to be

Page 141: Linux Windows Networking Interview Questions Asked 11111

141

displayed as well. The -R option causes ls to recurse down the directory tree. All of this starts at your home directory.

In order to prevent a user from logging in, you can add a(n) ________at the beginning of the password field. Answer: asterick 

If you add an asterick at the beginning of the password field in the /etc/passwd file, that user will not be able to log in.

You have a directory called /home/ben/memos and want to move it to /home/bob/memos so you issue the command mv /home/ben/memos /home/bob. What is the results of this action?Choose one:a. The files contained in /home/ben/memos are moved to the directory /home/bob/memos/memos.b. The files contained in /home/ben/memos are moved to the directory /home/bob/memos.c. The files contained in /home/ben/memos are moved to the directory /home/bob/.d. The command fails since a directory called memos already exists in the target directory. 

Answer: a When using the mv command to move a directory, if a directory of the same name exists then a subdirectory is created for the files to be moved.

Which of the following tasks is not necessary when creating a new user by editing the /etc/passwd file? Choose one:a. Create a link from the user's home directory to the shell the user will use.b. Create the user's home directoryc. Use the passwd command to assign a password to the account.d. Add the user to the specified group.

Answer: a There is no need to link the user's home directory to the shell command. Rather, the specified shell must be present on your system.

You issue the following command useradd -m bobm But the user cannot logon. What is the problem?Choose one:a. You need to assign a password to bobm's account using the passwd command.b. You need to create bobm's home directory and set the appropriate permissions.c. You need to edit the /etc/passwd file and assign a shell for bobm's account.d. The username must be at least five characters long.

Answer: a The useradd command does not assign a password to newly created accounts. You will still need to use the passwd command to assign a password.

You wish to print the file vacations with 60 lines to a page. Which of the following commands will accomplish this? Choose one:a. pr -l60 vacations | lprb. pr -f vacations | lprc. pr -m vacations | lprd. pr -l vacations | lpr

Answer: a The default page length when using pr is 66 lines. The -l option is used to specify a different length.

Page 142: Linux Windows Networking Interview Questions Asked 11111

142

Which file defines all users on your system? Choose one:a. /etc/passwdb. /etc/usersc. /etc/passwordd. /etc/user.conf

Answer: a The /etc/passwd file contains all the information on users who may log into your system. If a user account is not contained in this file, then the user cannot log in.

Which two commands can you use to delete directories? A) rmB) rm -rfC) rmdirD) rdE) rd -rf

Answer(s): B, C - You can use rmdir or rm -rf to delete a directory. Answer a is incorrect, because the rm command without any specific flags will not delete a directory, it will only delete files. Answers d and e point to a non-existent command.

Which partitioning tool is available in all distributions? A) Disk DruidB) fdiskC) Partition MagicD) FAT32E) System Commander

Answer(s): B - The fdisk partitioning tool is available in all Linux distributions. Answers a, c, and e all handle partitioning, but do not come with all distributions. Disk Druid is made by Red Hat and used in its distribution along with some derivatives. Partition Magic and System Commander are tools made by third-party companies. Answer d is not a tool, but a file system type. Specifically, FAT32 is the file system type used in Windows 98.

Which partitions might you create on the mail server's hard drive(s) other than the root, swap, and boot partitions? [Choose all correct answers]A) /var/spoolB) /tmpC) /procD) /binE) /home

Answer(s): A, B, E - Separating /var/spool onto its own partition helps to ensure that if something goes wrong with the mail server or spool, the output cannot overrun the file system. Putting /tmp on its own partition prevents either software or user items in the /tmp directory from overrunning the file system. Placing /home off on its own is mostly useful for system re-installs or upgrades, allowing you to not have to wipe the /home hierarchy along with other areas. Answers c and d are not possible, as the /proc portion of the file system is virtual-held in RAM-not placed on the hard drives, and the /bin hierarchy is necessary for basic system functionality and, therefore, not one that you can place on a different partition.

When planning your backup strategy you need to consider how often you will perform a backup, how much time the backup takes and what media you will use. What other factor must you consider when planning your backup strategy? _________ 

what to backup Choosing which files to backup is the first step in planning your backup strategy.

Page 143: Linux Windows Networking Interview Questions Asked 11111

143

What utility can you use to automate rotation of logs? Answer: logrotate The logrotate command can be used to automate the rotation of various logs.

In order to display the last five commands you have entered using the history command, you would type ___________ .

Answer: history 5 The history command displays the commands you have previously entered. By passing it an argument of 5, only the last five commands will be displayed.

What command can you use to review boot messages? Answer: dmesg The dmesg command displays the system messages contained in the kernel ring buffer. By using this command immediately after booting your computer, you will see the boot messages.

What is the minimum number of partitions you need to install Linux? Answer: 2 Linux can be installed on two partitions, one as / which will contain all files and a swap partition.

What is the name and path of the main system log? Answer: /var/log/messages By default, the main system log is /var/log/messages.

Of the following technologies, which is considered a client-side script? A) JavaScriptB) JavaC) ASPD) C++

Answer: A - JavaScript is the only client-side script listed. Java and C++ are complete programming languages. Active Server Pages are parsed on the server with the results being sent to the client in HTML

Linux Interview Questions And Answers

Page 1Ques: 1 What is Linux ?Ans:Linux is a multiuser operating system, like Unix, having GUI environment.Ans:Linux is multi user open source operating systemQues: 2 Why should we use Linux ?Ans:Because of its four advantages:Freely distributed, functionality, Adaptability and Robustness.Ques: 3 Who developed the Linux ?Ans:Linux was developed by LINUS TORVALDS, student of 'University of Helsinki' in Finland.Ans:Linux developed by LINUS TORVALDS, Who is also known as father of linux.Ques: 4 Write about the versions of Linux ?Ans:Previous version :version 0.02 in 1991, version 1.0 in 1994.Current version :version 2.6 in 2003.Ques: 5 What is the main use of Linux ?Ans:It is primarily used as a Server-platform for the client-server environment.

Page 144: Linux Windows Networking Interview Questions Asked 11111

144

Ques: 6

what is knoppix ?Ans:knoppix is CD version of the Linux. We can also work in Linux without installing it using bootable CD.Ques: 7 What makes Linux so popular ?Ans:Because it's source code is freely available for everyone and it is very easy to install, customize, and use.Ques: 8 What is 'tux' ?Ans:'Tux' is the official mascot,Linux Penguine of Linux.Ques: 9 How Linux is pronounced ?Ans:Linux is pronounced as LIH-nucks.Ques: 10 What is the difference between Linux and Unix ?Ans:Linux is an Operating system which use unix as its base and gives further more facilities and applications.Means, GUI is made in linux having unix as its core.Ques: 11 What is Kernel ?Ans:It is the central component of the OS, which manages the system resources.We can say"the system which provides the lowest-level abstraction layer for the resources".Ques: 12 What terminology is used in the Linux ?Ans:Different terminologies used in Linux are: Shell, Process, File, X-windows, Text-terminal, Session.Ques: 13 What do you mean by Linux utilities ?Ans:Linux utilities are the most important system softwares which enables the user to interact with OS.Ques: 14 What do you mean by Shell and Shell command ?Ans:Shell is the program for communication media between user and Linux OS.Shell commands that are part of command which are executed by shell.Ex- History.Ques: 15 What is System call ?Ans:System calls are predefined function which are defined in the Linux library.Ex- fork().Ques: 16 What are the different types of shell in Linux ?Ans:Three types of shell in Linux are: Bourne again shell(bash), korn shell(ksh), c shell(csh).Ques: 17 How can we select the shell ?Ans:To change the default login shell(bash), we use the 'chsh' utility. Ques: 18 What the following do ?echo, cd.Ans:echo is for displaying the information and cd is for changing directories.Ques: 19 What is the use of mkdir ?Ans:It is used for creating the directory.Ques: 20 What do you mean by Metacharacters ?

Page 145: Linux Windows Networking Interview Questions Asked 11111

145

Ans:Metacharcters are the special charcaters which has the special meaning in every shell.EX- <, >, >>, ?, *.

Ques: 21 Why we use ls ?Ans:ls is used to list out the contents of directory.Ques: 22 What do you mean by redirection ?Ans:With the help of redirection we can change the input output locations of the process ?Ques: 23 What are wildcards ?Ans:wildcard is the facility that provides the better selection of files from the file system.Ques: 24 what do you understand by 'pipes' ?Ans:pipe is the method of using two or more than two commands to get the desired output.In this the output of the previous command becomes the input for the next command.Ques: 25 What do you mean by sequence ?Ans:When we write some commands separated by semicolons, will execute individually in the given sequence. Ques: 26 What are the shell scripts ? How we work on them ?Ans:Normally shells are interactive. It means shell accept command from you (via keyboard) and execute them. But if you use command one by one (sequence of \'n\' number of commands) , the you can store this sequence of command to text file and tell the shell to execute this text file instead of entering the commands. This is know as shell script.Before you can run a script, you must give it execute permission by using the chmod utility. Then, to run it, you only need to type its name.

Ques: 27 What is the concept of Sub-shell or child-shell ?Ans:the shell is called Child-shell of that shell by which it was created.Ques: 28 Write the steps for creating the shell scripts ? Ans:Following steps are required to write shell script:(1) Use any editor like vi or mcedit to write shell script.(2) After writing shell script set execute permission for script.(3) Execute the scriptQues: 29 How to define 'user defined variables' ?Ans:To define UDV use following syntaxSyntax: variable name=valueEx-$ no=10Ques: 30 What about ps, kill, wait ?Explain each.Ans:These utilities or commands are used for the job control.(1) ps: which generates a list of processes and their attributes, including their name, process ID number, controlling terminal, and owner(2) kill: which allows you to terminate a process based on its ID number(3) wait: which allows a shell to wait for one of its child processes to terminateQues: 31 Describe the following commands. eval, exec, shift, umask

Page 146: Linux Windows Networking Interview Questions Asked 11111

146

Ans:The eval shell command executes the output of command as a regular shell command. The exec shell command causes the shell's image to be replaced with command in the process' memory space.The shift shell command causes all of the positional parameters $2..$n to be renamed $1..$(n-1), and $1 to be lost.The umask shell command sets the shell's umask value to the specified octal number, or displays the current umask value if the argument is omitted. Ques: 32 What are the different types of utilities which used to exchange the information over the internet ?Ans:(1) Identifying network user: users, who, w, hostname, finger

(2) communicating with the network user write, talk, wall, mail

(3) distributing data rcp, scp, ftp, sftp, uucp

(4) distributed processing rlogin, slogin, rsh, ssh, telnetQues: 33 What is desktop environment ?write its components also.Ans:the graphical representation by icons and windows of all the programs that manage and render the conceptual desktop. components: Menus, icons ,status bar and a cursor.Ques: 34 What are the different desktop environments of linux ?Ans:common desktop environment(CDE), GNU network object model environment(GNOME),K development envirnoment(KDE).Ques: 35 What is xclock and xterm ?Ans:these commands are used for client applications

The xclock command provides a simple clock on your desktop. The xterm command starts a terminal window on the desktop.Ques: 36 What is the C compiler in Linux ?Ans:Linux distributions include GNU C (gcc)

The gcc utility compiles C program code in one or more files and produces object modules or an executable file.Ques: 37 What is gprof and gdb ?Ans:The gprof is a GNU profile, utility allows to obtain a program's profile.The GNU debugger gdb allows to symbolically debug a program.Ques: 38 What is the use of strip utility ?Ans:it is used to remove the extra code from the executable file ?Ques: 39 What are the main categories of linux system calls ?Ans:there are three main categories of linux system calls :file management, process management, error handling.Ques: 40 What do you mean by Interprocess communication ?Ans:it is the method of enabling the two or more processes to communicate with each other for sharing the information.Ques: 41

Page 147: Linux Windows Networking Interview Questions Asked 11111

147

which facilities are provided by the kernel ?Ans:The kernel facilities may be divided into several subsystems:

memory management

process management

interprocess communication (IPC)

input/output

file management

Ques: 42 Define file for Linux.Ans:Basically files are used for the long term storage.Linux files are organized by a hierarchy of labels, commonly known as a directory structure. The files referenced by these labels may be of three kinds:

regular files, directory files, special files.Ques: 43 what are the main tasks of the system administrator ?Ans:main tasks of the system administrator are:(1) starting and stopping Linux(2) maintaining the file system(3) maintaining the user a/cs (4) maintaining the devices(5) providing the secure environmentQues: 44 Create a shell program called time from the following command line: banner `date | cut -c12-19`Ans:$ cat time banner `date | cut -c12-19` $ $ chmod u+x time Ques: 45 Write a shell program that gives only the date in a banner display. Be careful not to give your program the same name as a UNIX system command. Ans:$ cat mydate banner `date | cut -c1-10` $Ques: 46 Write a shell program that sends a note to several people on your system. Ans:$ cat tofriends echo Type in the name of the file containing the note. read note mail janice marylou bryan < $note $Ques: 47 Redirect the date command without the time into a file. Ans:date | cut -c1-10 > file1 Ques: 48 Echo the phrase ``Dear colleague'' in the same file as the previous exercise, without erasing the date. Ans:echo Dear colleague >> file1

Page 148: Linux Windows Networking Interview Questions Asked 11111

148

Ques: 49 Using the above exercises, write a shell program that sends a memo to the same people on your system mentioned in Exercise 2-3. Include in your memo: • lines at the top that include the current date and the words ``Dear colleague'' • the body of the memo (stored in an existing file) • a closing statement Ans:

$ cat send.memo date | cut -c1-10 > memo1 echo Dear colleague >> memo1 cat memo >> memo1 echo A memo from M. L. Kelly >> memo1 mail janice marylou bryan < memo1 $ Ques: 50 How can you read variables into the mv.file program? Ans:$ cat mv.file echo type in the directory path read path echo type in filenames, end with CTRL-d while read file do mv $file $path/$file done echo all done $ Ques: 51 Use a for loop to move a list of files in the current directory to another directory. How can you move all your files to another directory? Ans:$ cat mv.file echo Please type in directory path read path for file in $* do mv $file $path/$file done $ The command line for moving all files in the current directory is: $ mv.file *Ques: 52 How can you change the program search, so that it searches through several files? Ans:$ cat search for file in $* do if grep $word $file >/dev/null then echo $word is in $file else echo $word is NOT in $file fi done $ Ques: 53 Set the stty options for your environment. Ans:

Add the following lines to your .profile: stty -tabs

Page 149: Linux Windows Networking Interview Questions Asked 11111

149

stty erase stty echoeQues: 54 Change your prompt to the word HelloAns:Add the following command lines to your .profile: PS1=Hello export PS1Ques: 55 Check the settings of the variables $HOME, $TERM, and $PATH in your environment. Ans:Enter the following commands to check the values of the HOME, TERM, and PATH variables in your home environment: • $ echo $HOME • $ echo $TERM • $ echo $PATH Ques: 56 State the variables in Linux shell.Ans:Linux has two types of variables,local environmental .Both stores data in string format.Ques: 57 What is quoting ?Ans:quoting is the method in linux shell which is used to inhibit shell's wildcard-replacement, variable-substitution, and/or command-substitution mechanisms. Ques: 58 what are 'Here documents ?Ans:scripts that use << metacharacter to supply the standard input of other commands as inline text, called here documents.Ques: 59 what is job control in linux shell ?Ans:Job control is to control the current processes according to their behavior to provide the multitasking environment.Ques: 60 what are the steps to find the command followed by linux ?Ans:If it isn't a built-in command, the shell looks to see if the command begins with a / character. If it does, it assumes that the first token is the absolute pathname of a command, and tries to execute the file with the stated name. If the file doesn't exist or isn't an executable, an error occurs:

$ /bin/ls ...full pathname of the ls utility.script.csh script.ksh$ /bin/nsx ...a nonexistent filename.bash: /bin/nsx: not found$ /etc/passwd ...the name of the password file.bash: /etc/passwd: Permission denied ...it's not executable.$ _

If it isn't a built-in command or a full pathname, the shell searches the directories whose names are stored in the PATH environment variable. Each directory in the PATH variable (from left to right) is searched for an executable matching the command name. If a match is found, the file is executed. If a match isn't found in any of the directories, or the file that matches is not executable, an error occurs.

Ques: 61 why we supersede the standard utilities ?Ans:when any user created a \"bin\" subdirectory in their home directory and place this subdirectory before the traditional \"bin\" directories in their PATH setting,

Page 150: Linux Windows Networking Interview Questions Asked 11111

150

it makes a problem as scripts run from a shell expect to use standard utilities and might be confused by the nonstandard utilities that actually get executed. So to handle this problem we use the superseding of standard utilities.Ques: 62 what do you mean by 'exit codes' ?Ans:every linux process terminates with an exit value either 0 or any other value.these values are called exit codes.whether a process completes successfully returns 0 or becomes failure return other value.Ques: 63 What does the set command do ?Ans:

The set built-in command is used to set and display shell settings and to display the value of shell variables ex- $ setgameslost=3gameswon=12teamname="Denver Broncos"$ _Ques: 64 can bourne shell scripts run under bash ? if yes,explain.Ans:yes, because bash is compatible with Unix's bourne shell.Bash is installed as /bin/bash, but /bin/sh is a pointer to /bin/bash, since any script expecting Bourne shell functionality will run properly under Bash.Ques: 65 How to make bash as login shell ?Ans:we have to add ".bashrc" file to our ".bash_profile" file:Ques: 66 how can we create and access a simple variable in bourne shell ?Ans:there is an example to illustrate this:

$ verb=sing$ echo I like $verbing$ I like$ echo I like ${verb}ing$ I like singingqQues: 67 How to create and assign a list variable ?Illustrate with example.Ans:we create a list variable with declare keyword:

$ declare -a teamnames$ teamnames[0]="india"$ teamnames[1]="australia"$ teamnames[2]="england"

$ echo there are "${#teamnames[*]} teams in the IPL$ there are 3 teams in the IPLQues: 68 how to destroy the list variable ?Ans:for this we use unset commandex-$ unset name[index]$ unset teamnames[2]Ques: 69 how can we cerate the shortcut of commands ?

Ans:we can use following three methods for that-aliases, command history, auto completionQues: 70

Page 151: Linux Windows Networking Interview Questions Asked 11111

151

what does the trap command do ?Ans:The trap command allows you to specify a command that should be executed when the shell receives a signal of a particular value.ex-

$ cat trap.sh ...list the script.trap 'echo Control-C; exit 1' 2 # trap Ctl-C (signal #2)while test 1do echo infinite loop sleep 2 # sleep for two seconds.

done$ bash trap.sh ...execute the script.infinite loopinfinite loop^C ...I typed a Control-C here.Control-C ...displayed by the echo command.$ _Ques: 71 how we make functions in bash ?Ans:syntax:function name{ list of commands} or

name(){ list of commands}

ex-

$ cat func2.sh ...list the script.f (){ echo parameter 1 = $1 # display first parameter. echo parameter list = $* # display entire list.}# main program.f 1 # call with 1 parameter.f cat dog goat # call with 3 parameters.$ sh func2.sh ...execute the script.parameter 1 = 1parameter list = 1parameter 1 = catparameter list = cat dog goat$ _

Ques: 72 can functions be exported to subshells ?if yes,how ?Ans:yes,with help of export command.ex-

export -f functionname The export built-in command used with the -f option exports a function to a subshell the same way exported shell variable values are exported to subshells. Ques: 73

Page 152: Linux Windows Networking Interview Questions Asked 11111

152

how can we create menus in bash ?Ans:the select command is used to create menus

ex-$ cat newmenu.sh ...list the script.echo menu test programselect reply in "date" "pwd" "pwd" "exit"do case $reply in "date") date ;; "pwd") pwd ;; "exit") break ;; *) echo illegal choice ;; esacdone$ sh newmenu.sh ...execute the script.menu test program1) date2) pwd3) pwd4) exit#? 1Fri May 6 21:49:33 CST 2005#? 5illegal choice#? 4$ _Ques: 74 what does the following commands do ?cd, pushd ,popd ,dirsAns:Shell Command: cd { name } cd oldName newNameex-$ CDPATH=.:/usr ...set my CDPATH.$ cd dir1 ...move to "dir1", located under ".".$ pwd/home/glass/dir1$ cd include ...move to "include", located in "/usr".$ pwd ...display the current working dir./usr/include$ cd - ...move to my previous directory.$ pwd ...display the current working dir./home/glass/dir1$ _

If the second form of cd is used, the shell replaces the first occurrence of the token oldName by the token newName in the current directory's full pathname, and then attempts to change to the new pathname.

Shell command: pushd [-n] [dir] pushd saves the current directory as the most recent addition to (i.e., on top of) the directory stack.

Page 153: Linux Windows Networking Interview Questions Asked 11111

153

Shell command: popd [-n] popd retrieves the last directory that was pushed onto the stack and changes directory to that location. Shell command: dirs [-cp] If no arguments are given, dirs simply prints out the contents of the directory stack. The -p option causes the directories to be printed one per line. The -c option causes the directory stack to be cleared.

Ques: 75 what does the following do ?jobs, bg, fg, kill.Ans:shell command jobs: jobs displays a list of all the shell's jobs.shell command bg: it resumes the specified job as the background process.

shell command fg: it resumes the specified job as the foreground process.

shell command kill: kill sends the specified signal to the specified process. Either jobspec (e.g., "%1") or a process ID is required. If the -s option is used, signame is a valid signal name (e.g., SIGINT). If the -n option is used, signum is the signal number. If neither -s nor -n is used, a SIGTERM signal is sent to the process.Ans:Ques: 76 what do you mean by pathnames ?explain.Ans:A pathname is a sequence of directory names that lead you through the hierarchy from a starting directory to a target file.ex-File Absolute PathName A /home/glass/myFile B /home/myFile C /bin/myFile Ques: 77 what are GNU utilities ?Ans:GNU utilities are the software packages which are combined with linux kernel to make the linux very powerful and user interactive.ex-text editors, a C/C++ compiler, a sorting utility, a graphical user interface, several command shells, and text-processing tools. Ques: 78

How can we run a GNU utility ?Ans:To run a utility, simply enter its name and press the Enter key.ex-date, which displays the current date and time:

$ date ... run the date utility.

Page 154: Linux Windows Networking Interview Questions Asked 11111

154

Mon Sep 6 11:25:51 CDT 2004Ques: 79 what are input, output and error channels ?Ans:when we use linux for i/o operations we input something from keyboard and get the result on the screen.if we want to change in input and output, we can use following three channels: standard input:- stdin standard output:- stdout standard error:- stderr Ques: 80 what is the use of man utility ?Ans:it is used to know about the utility which i want to describe.ex- man [ section ] word man -k keyword

Ques: 81 which utility we use to list out the special characters of terminal ?Ans:we use stty util. ex- $ stty -a ...obtain a list of terminal metacharactersQues: 82 why we use passwd ?Ans:passwd is used to change the password ex- $ passwdQues: 83 why we use pwd ?Ans:pwd displays the pathname of current working directoryex- $ pwd/home/glassAns:To print working directory

Page 155: Linux Windows Networking Interview Questions Asked 11111

155

Linux interview - August 21, 2008 at 22:00 pm by Rajmeet Ghai

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

Page 156: Linux Windows Networking Interview Questions Asked 11111

156

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

 

Which command is used to check the number of files and disk space used and the each user’s defined quota?

repquota command is used to check the status of the user’s quota along with the disk space and number of files used. This command gives a summary of the user’s quota that how much space and files are left for the user. Every user has a defined quota in Linux. This is done mainly for the security, as some users have only limited access to files. This provides a security to the files from unwanted access. The quota can be given to a single user or to a group of users.

Page 157: Linux Windows Networking Interview Questions Asked 11111

157

What is the name and path of the main system log?

By default the main system log is /var/log/messages. This file contains all the messages and the script written by the user. By default all scripts are saved in this file. This is the standard system log file, which contains messages from all system software, non-kernel boot issues, and messages that go to 'dmesg'. dmesg is a system file that is written upon system boot.

How secured is Linux? Explain.

Security is the most important aspect of an operating system. Due to its unique authentication module, Linux is considered as more secured than other operating systems. Linux consists of PAM. PAM is Pluggable Authentication Modules. It provides a layer between applications and actual authentication mechanism. It is a library of loadable modules which are called by the application for authentication. It also allows the administrator to control when a user can log in. All PAM applications are configured in the directory "/etc/pam.d" or in a file "/etc/pam.conf". PAM is controlled using the configuration file or the configuration directory.

Can Linux computer be made a router so that several machines may share a single Internet connection? How?

Yes a Linux machine can be made a router. This is called "IP Masquerade." IP Masquerade is a networking function in Linux similar to the one-to-many (1: Many) NAT (Network Address Translation) servers found in many commercial firewalls and network routers. The IP Masquerade feature allows other "internal" computers connected to this Linux box (via PPP, Ethernet, etc.) to also reach the Internet as well. Linux IP Masquerading allows this functionality even if the internal computers do not have IP addresses.The IP masquerading can be done by the following steps:

1. The Linux PC must have an internet connection and a connection to LAN. Typically, the Linux PC has two network interfaces-an Ethernet card for the LAN and a dial-up PPP connection to the Internet (through an ISP).

2. All other systems on your LAN use the Linux PC as the default gateway for TCP/IP networking. Use the same ISP-provided DNS addresses on all systems.

3. Enable IP forwarding in the kernel. By default the IP forwarding is not enabled. To ensure that IP forwarding is enabled when you reboot your system, place this command in the /etc/rc.d/rc.local file.

4. Run /sbin/iptables-the IP packet filter administration program-to set up the rules that enable the Linux PC to masquerade for your LAN.

What is the minimum number of partitions you need to install Linux?

Minimum 2 partitions are needed for installing Linux. The one is / or root which contains all the files and the other is swap. Linux file system is function specific which means that files and folders are organized according to their functionality. For example, all executables are in one folder, all devices in another, all libraries in another and so on. / or ‘root’ is the base of this file system. All the other folders are under this one. / can be consider as C: .Swap is a partition that will be used as virtual memory. If there is no more available RAM a Linux computer will use an area of the hard disk, called swap, to temporarily store data. In other words it is a way of expanding your computers RAM.

Which command is used to review boot messages?

dmesg command is used to review boot messages. This command will display system messages contained in the kernel ring buffer. We can use this command immediately after booting to see boot messages. A ring buffer is a buffer of fixed size for which any new data added to it overwrites the oldest data in it. Its basic syntax is

dmesg [options]

Invoking dmesg without any of its options causes it to write all the kernel messages to standard output. This usually produces far too many lines to fit into the display screen all at once, and thus only the final messages are visible. However, the output can be redirected to the less command through the use of a pipe, thereby allowing the startup messages to be viewed on one screen at a timedmesg | less

Page 158: Linux Windows Networking Interview Questions Asked 11111

158

Which utility is used to make automate rotation of a log?

logrotate command is used to make automate rotation of log.Syntax of the command is:logrotate [-dv] [-f|] [-s|] config_file+It allows automatic rotation, compression, removal, and mailing of log files. This command is mainly used for rotating and compressing log files. This job is done every day when a log file becomes too large. This command can also be run by giving on command line. We can done force rotation by giving –f option with this command in command line. This command is also used for mailing. We can give –m option for mailing with this command. This option takes two arguments one is subject and other is recipient name.

What are the partitions created on the mail server hard drive?

The main partitions are done firstly which are root, swap and boot partition. But for the mail server three different partitions are also done which are as follows:1. /var/spool- This is done so that if something goes wrong with the mail server or spool than the output cannot overrun the file system.2. /tmp- putting this on its own partition prevents any user item or software from overrunning the system files.3. /home- putting this on its own is useful for system upgrades or reinstalls. It allow not to wipe off the /home hierarchy along with other areas.

What are the fields in the/etc/passwd file?

It contains all the information of the users who log into the system. It contains a list of the system's accounts, giving for each account some useful information like user ID, group ID, home directory, shell, etc. It should have general read permission as many utilities, like ls use it to map user IDs to user names, but write access only for the superuser (root). The main fields of /etc/passwd file are:1. Username: It is used when user logs in. It should be between 1 and 32 characters in length.2. Password: An x character indicates that encrypted password is stored in /etc/shadow file.3. User ID (UID): Each user must be assigned a user ID (UID). UID 0 (zero) is reserved for root and UIDs 1-99 are reserved for other predefined accounts. Further UID 100-999 are reserved by system for administrative and system accounts/groups.4. Group ID (GID): The primary group ID (stored in /etc/group file)5. User ID Info: The comment field. It allow you to add extra information about the users such as user's full name, phone number etc. This field use by finger command.6. Home directory: The absolute path to the directory the user will be in when they log in. If this directory does not exists then users directory becomes /7. Command/shell: The absolute path of a command or shell (/bin/bash). Typically, this is a shell.

Which commands are used to set a processor-intensive job to use less CPU time?

nice command is used for changing priority of the jobs.Syntax: nice [OPTION] [COMMAND [ARG]...]Range of priority goes from -20 (highest priority) to 19 (lowest).Priority is given to a job so that the most important job is executed first by the kernel and then the other least important jobs. This takes less CPU times as the jobs are scheduled and are given priorities so the CPU executes fast. The priority is given by numbers like -20 describe the highest priority and 19 describe the least priority.

How to change window manager by editing your home directory?

/.xinitrc file allows changing the window manager we want to use when logging into X from that account. The dot in the file name shows you that the file is a hidden file and doesn't show when you do a normal directory listing. For setting a window manager we have to save a command in this file. The syntax of command is: exec windowmanager.After this, save the file. Next time when you run a startx a new window manager will open and become default. The commands for starting some popular window managers and desktop environments are:-KDE = startkde-Gnome = gnome-session-Blackbox = blackbox-FVWM = fvwm-Window Maker = wmaker-IceWM = icewm

Page 159: Linux Windows Networking Interview Questions Asked 11111

159

How documentation of an application is stored?

When a new application is installed its documentation is also installed. This documentation is stored under the directory named for application. For example if my application name is App1 then the path of the documentation will be /user/doc/App1. It contains all the information about the application. It contains date of creating application, name of application and other important module of the application. We can get the basic information of application from the documentation.

How shadow passwords are given?

pwconv command is used for giving shadow passwords. Shadow passwords are given for better system security. The pwconv command creates the file /etc/shadow and changes all passwords to ‘x’ in the /etc/passwd file. First, entries in the shadowed file which don't exist in the main file are removed. Then, shadowed entries which don't have `x' as the password in the main file are updated. Any missing shadowed entries are added. Finally, passwords in the main file are replaced with `x'. These programs can be used for initial conversion as well to update the shadowed file if the main file is edited by hand.

How do you create a new user account?

useradd command is used for creating a new user account. When invoked without the-D option, the useradd command creates a new user account using the values specified on the command line and the default values from the system. The new user account will be entered into the system files as needed, and initial files copied, depending on the command line options. This command uses the system default as home directory. If –m option is given then the home directory is made.

Which password package is installed for the security of central password?

Shadow password packages are used for security of central passwords. Security is the most important aspect of every operating system. When this package is not installed the user information including passwords is stored in the /etc/passwd file. The password is stored in an encoded format. These encoded forms can be easily identified by the System crackers by randomly encoding the passwords from dictionaries. The Shadow Package solves the problem by relocating the passwords to another file (usually /etc/shadow). The /etc/shadow file is set so that it cannot be read by just anyone. Only root will be able to read and write to the /etc/shadow file.

Which shell do you assign to a POP3 mail-only account?

POP3 mail only account is assigned to the /bin/false shell. However, assigning bash shell to a POP3 mail only gives user login access, which is avoided. /bin/nologin can also be used. This shell is provided to the user when we don’t want to give shell access to the user. The user cannot access the shell and it reject shell login on the server like on telnet. It is mainly for the security of the shells. POP3 is basically used for downloading mail to mail program. So for illegal downloading of emails on the shell this account is assigned to the /bin/false shell or /bin/nologin. These both shells are same they both do the same work of rejecting the user login to the shell. The main difference between these two shells is that false shell shows the incorrect code and any unusual coding when user login with it. But the nologin shell simply tells that no such account is available. So nologin shell is used mostly in Linux.

Which daemon is responsible for tracking events on Linux system?

syslogd is responsible for tracking system information and save it to the desired log files. It provides two system utilities which provide system logging and kernel message trapping. Internet and UNIX domain sockets support enable this utility package to support both local and remote logging. Every logged message contains at least a time and a hostname field, normally a program name field, too. So to track these information this daemon is used. syslogd mainly reacts to the set of signals given by the user. These are the signals given to syslogd: SIGHUP: This lets syslogd perform a re-initialization. All open files are closed, the configuration file (default is /etc/syslog.conf) will be reread and the syslog facility is started again. SIGTERM: The syslogd will die. SIGINT, SIGQUIT: If debugging is enabled these are ignored, otherwise syslogd will die. SIGUSR1: Switch debugging on/off. This option can only be used if syslogd is started with the - d debug option. SIGCHLD: Wait for Childs if some were born, because of waiting messages.

Which daemon is used for scheduling of the commands?

The crontab command is used for scheduling of the commands to run at a later time. SYNTAXcrontab [ -u user ] file

Page 160: Linux Windows Networking Interview Questions Asked 11111

160

crontab [ -u user ] { -l | -r | -e }

Options-l List - display the current crontab entries.

-r Remove the current crontab.

-e Edit the current crontab using the editor specified by the VISUAL or EDITOR environment variables.When user exits from the editor, the modified crontab will be installed automatically. Each user can have their own crontab, and though these are files in /var, they are not intended to be edited directly. If the –u option is given than the crontab gives the name of the user whose crontab is to be tweaked. If it is given without this then it will display the crontab of the user who is executing the command.

How environment variable is set so that the file permission can be automatically set to the newly created files?

umask command is used to set file permission on newly created files automatically. Syntaxumask [-p] [-S] [mode]It is represented in octal numbers. We can simply use this command without arguments to see the current file permissions. To change the permissions, mode is given in the arguments. The default umask used for normal user is 0002. The default umask for the root user is 0022. For calculating the original values, the values shown by the umask must be subtracted by the default values. It is mainly used for masking of the file and directory permission. The /etc/profile script is where the umask command is usually set for all users. The –S option can be used to see the current default permissions displayed in the alpha symbolic format. For example, umask 022 ensures that new files will have at most 755 permissions (777 NAND 022).The permissions can be calculated by taking the NAND of original value with the default values of files and directories.