Linux Boot Process.

In the shortest possible form, the Linux boot sequence looks something like this:

1. Computer gets powered on, BIOS runs whatever it finds in the Master Boot Record (MBR), usually lilo or GRUB

2. lilo, in turn, starts up the Linux kernel
3. The Linux kernel starts up the primal process, init. Since init is always started first, it always has               PID of   1.
4. init then runs your boot scripts, also known as "rc files". These are similar in concept to DOS's autoexec.bat and config.sys, if those had been developed to a fine art. These rc files, which are generally shell scripts, spawn all the processes that make up a running Unix system.


One interesting consequence of this multi-step booting process is that it's very flexible. Once lilo has been loaded, and control over the boot process has been passed to it, it can run any sort of arbitrary (but self-contained) program that you'd care to run. This means that you can use lilo to boot into multiple operating systems.

Once lilo has started to run whatever operating system you've chosen (Linux would be a good choice ;-), it is no longer running.The lilo config file is usually located at /etc/lilo.conf; and you can find the grub.conf in /boot/grub/grub.conf remember to run the lilo command after editing it to save your changes to the master boot record on disk.

The next step in the Linux boot process is for the Linux kernel to run. This does all sorts of things, but the most important thing that we're interested in is that kernel spawns a copy of init, the First Process. Being the First Process, init will be assigned a PID of 1.

init is in charge of starting all of the normal processes that a running Linux system needs, including the mingetty processes that give your virtual consoles (ALT-F1 through ALT-F6 on most default Linux installations), starting up any needed services (like networking), and anything else that you might want to do while booting. These are controlled by shell scripts known as "rc files", which are started by commands in the init config file. The config file is usually located at /etc/inittab, and you'll have to tell init to re-read its config file by running telinit q as root. You can find a lot more information on this under the man pages for inittab and init (man inittab and man init).

There are two types of rc files that could be used: System V style or BSD style. Most Linux distributions use System V system, so that is what will be covered here. In general, System V rc files are considered more powerful than BSD ones, at the expense of simplicity. BSD rc files are generally stored in the /etc directory, while System V expects to find its files in the /etc/rc.d directory (and any subdirectories from there).

The idea behind System V rc files is that you may want to boot in different ways. For example, you may want to boot into single-user mode to fix a hard drive problem, or you may want regular multi-user console mode, or perhaps you want to boot straight to the X window system. All of these different types of boot sequences can be automated into "run levels"; Red Hat's convention is:

* Run Level 1 (directory: /etc/rc.d/rc1.d) - Single user mode
* Run Level 2 (directory: /etc/rc.d/rc2.d) - Same as 3, but without NFS
* Run Level 3 (directory: /etc/rc.d/rc3.d) - Regular multi-user and networking mode
* Run Level 4 (directory: /etc/rc.d/rc4.d) - Unused
* Run Level 5 (directory: /etc/rc.d/rc5.d) - Same as 3, but boots straight to the X window system



Of course, this convention is arbitrary and other distributions can (and do!) vary. The most common variations are for run level 2 to be the default mode (but have it operate the same as run level 3 in the chart above), and for X to be run level 4 rather than 5. There is also a special run level 6 that isn't really a run level, its a shortcut for rebooting.

Note: To change the run level that you're operating under, use the telinit command. For example, for a quick reboot, you can use telinit 6. Naturally, you have to be root to do this.

Note: The default runlevel is decided in /etc/inittab. The line that controls it looks like this: id:3:initdefault:

Inside the /etc/rc.d/init.d directory are all of the shell scripts that do the actual work. The rc#.d directories simply contain symbolic links to the scripts in the init.d directory.

In the /etc/rc.d directory there is also a file called rc.local, which is the rc file that init will run after everything else is done. You can add simple things to the end of it if you don't want to go through the process of setting up a full script in the /etc/rc.d/init.d directory, but it's not a good idea if you want an easy to understand and consistent boot process.

Knowing a bit about how the System V boot process works now, it's easer to understand how the boot sequence operates:

* Once the Linux kernel has been loaded by lilo, it looks in "all the usual places" for init and runs the first copy it finds
* In turn, init runs the shell script found at /etc/rc.d/rc.sysinit
* Next, rc.sysinit does a bunch of necessary things to make System V rc files possible
* init then runs all the scripts for the default runlevel
o It knows the default run level by examing /etc/inittab
o Symbolic links to the real scripts (in /etc/rc.d/init.d) are kept in each of the run level directories (/etc/rc.d/rc1.d through rc6.d)
* Lastly, init runs whatever it finds in /etc/rc.d/rc.local (regardless of run level). rc.local is rather special in that it is executed every time that you change run levels.


Note: There's some trickery in how the symbolic links in the rc#.d directories work. Link names that start with an "S" are scripts that "started", while links that begin with a "K" are scripts that are "killed", or stopped. The number that follows is simply a way to determine the order that the scripts run in: lower numbered scripts run first.

Note: There's also some trickery done with rc.sysinit for a file called rc.serial, used to set up your serial ports, but the file does not exist by default on most Linux distributions and is not often used.



Important Linux Port Numbers

21 => FTP
22 => SSH
23 => Telnet
25 => SMTP Mail Transfer
43 => WHOIS service
53 => name server (DNS)
80 => HTTP (Web server)
110 => POP protocol (for email)
995 => POP over SSL
3306 => MysQL Server
111 => rpcbind
953 => rndc
143 => IMAP Protocol (for email)
993 => IMAP Secure
443 => HTTP Secure
3128 => Squid Proxy
3306 => MysQL Server
3636 => Piranha
4643 => Virtuosso Power Panel
10000 => Webmin

For more port numbers Click Here 
and Click Here


Cisco CCNA Training




How to setup Nagios basic configuration from scratch

This setup is intended to provide you with simple instructions on how to install Nagios on Fedora , Redhat and Centos and have it monitoring your local machine. Nagios is very easy to setup and monitor.

We would require the following packages to install Nagios.

Apache --> yum -y install httpd*
PHP --> yum -y install php*
GCC --> yum -y install gcc, yum -y install gcc-c++, yum -y install glibc
GD --> yum -y install gd gd-level

* -y will not prompt you for an yes/no input.

Create a new nagios user account and give it a password.
useradd nagios

Create a new  nag group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to that group.

groupadd nag
usermod -a -G nag nagios
usermod -a -G nag apache

Download nagios tar file along with the plugins

wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.0.tar.gz

wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz

Now go to the folder or directory where you have downloaded the files. In my case it is /root

cd /root
tar xzf nagios-3.2.0.tar.gz
cd nagios-3.2.0
./configure --with-command-group=nag
make all
make install
make install-init
make install-config
make install-commandmode

cd /root
tar xzf nagios-plugins-1.4.11.tar.gz
cd nagios-plugins-1.4.11
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install

Now start Nagios and add it to the list of system services.

service nagios start
chkconfig nagios on

We are done with the basic installation of nagios and its corresponding plugins. Now, I will show you how to monitor a group of hosts. I cannot explain you all the configuration files but will try to throw light on those we require. On successful completion of the installation you will find localhost.cfg in the following path.

/usr/local/nagios/etc/objects/localhost.cfg

In short localhost.cfg is used to define the hosts and services that we want to monitor on the host system.(Host system here refers to the one we want to monitor)

open this file and add the following next to host definition lines.

define host{
use linux-server
host_name www.testing-server.com
address 192.168.36.1
}


use - uses the default template defined in templates.cfg
host_name - hostname can be anything
address- address of the host

Now save the file and restart Nagios.
service nagios restart

NOTE: Make sure you dont add anything to this file because if you are new to nagios debugging would be difficult.

Now you can check the output in the browser.

http://localhost/nagios (Create the password using the htpasswd command)

Computer Training

You can see the host that you have mentioned in the localhost.cfg file. You can add any number of hosts and by default it will check whether the host is alive or not using the check_host_alive plug in. If the host is dead it will display in red and you can click on that to see the details. This is the most basic configuration of Nagios one can configure it according to their requirements. There are lot many features which sets nagios apart from the crowd. Go through the official documentation for further information.
 

Accessing files of Linux system from Windows

Steps to access files from Linux:
  1. Install Samba On Linux, read article here
  2. Prepare VBScript to mount network drive for the mapped folder thru Samba, read article here
  3. Run the vbscript on startup, by creating shortcut on start menu, read article here





Various technologies for a System administrators

  • EMC SAN
  • HP Smart arrays
  • SSH
  • NIS+
  • NFS
  • DNS
  • Veritas Net backup
  • Mid range/Enterprise Servers Hardware
  • Solaris 10 zones and containers.(virtualization)
  • Red Hat Linux OS
  • Solaris 8 & 10 OS
  • Disk storage management ( Solstice Disk suite and VERITAS Volume Manager)
  • HA skills (VERITAS Cluster server,Sun Cluster (a plus))
  • scripting ( Shell & Perl scripting)
  • Symantec Net backup Administration
  • Network Services: Webserver (Apache/tomcat), DNS, Mail, FTP
  • Fail over/Redundancy: RAID, Clustering, Heartbeat, LVS
  • Virtualization: Xen, Vmware,citrix
  • Security: IPtables, TCP wrappers, SElinux, Hardware based firewalls
  • monitoring tools i.e. open view , Tivoli , Big-brother , Ngaios

About Crontab file

crontab -l -r -e

-l list the current contab file

-r removes entry

-e edit the crontab file

Fileds of crontab file

Minute [ 0-59]

Hour [0-23]

Day of Month [1-31]

Month [1-12]

Day of Week [0-6] 0-Sunday

Download Linux Ebooks RedHat Fedora

Addison Wesley - A Practical Guide to Red Hat Linux 8 (2002).chm
Apress - Beginning Fedora, From Novice to Professional (2007).pdf
Hungry Minds - Red Hat Linux Security and Optimization (2002).pdf
Hungry Minds - RedHat Linux Networking and System Administration (2002).pdf
McGraw Hill - Red Hat Linux Pocket Administrator (2003).pdf
McGraw-Hill - Fedora 7 and Red Hat Enterprise Linux, The Complete Reference (2007).pdf
McGraw-Hill - Red Hat, The Complete Reference Enterprise Linux & Fedora Edition (2004).chm
McGraw-Hill - RHCE Red Hat Certified Engineer Linux Study Guide 5th Edition (2007).chm
O'Reilly - Fedora Linux (2006).chm
O'Reilly - Learning Red Hat Enterprise Linux & Fedora 4th Edition (2004).chm
O'Reilly - Learning RedHat Linux 3rd Edition (2003).chm
Prentice Hall - A Practical Guide to Red Hat Linux 3rd Edition (2006).chm
Que - Red Hat Linux Fedora 3 Unleashed (2004).chm
Red Hat - Red Hat Linux 9, Red Hat Linux Customization Guid (2003).pdf
Red Hat - Red Hat Linux 9, Red Hat Linux Getting Started Guide (2003).pdf
Red Hat - Red Hat Linux 9, Red Hat Linux Security Guide (2002).pdf
Red Hat - Red Hat Linux 9, Red Hat Linux x86 Installation Guide (2003).pdf
RedHat Cluster Manager.pdf
Sams - Fedora 7 Unleashed (2008).pdf
Sams - Fedora Unleashed 2008 Edition (2008).pdf
Sams - Red Hat Enterprise Linux 5 Administration Unleashed (2007).pdf
Sams - Red Hat Fedora Core 6 Unleashed (2007).pdf
Sams - Red Hat Linux Unleashed 2nd Edition (1998).pdf
Sams - Teach Yourself Red Hat Fedora 4 Linux All in One (2005).chm
Sams - Teach Yourself Red Hat Linux Fedora in 24 Hours (2004).pdf
Wiley - Fedora 10 and Red Hat Enterprise Linux Bible (2009).pdf
Wiley - Fedora 8 and Red Hat Enterprise Linux Bible (2008).pdf
Wiley - Fedora Linux Toolbox (2008).pdf
Wiley - Red Hat Enterprise Linux 4 For Dummies (2005).pdf
Wiley - Red Hat Fedora Linux 2 All-in-One Desk Reference For Dummies (2004).pdf
Wiley - Red Hat Fedora Linux 3 Bible (2005).chm
Wiley - Red Hat Linux Bible (2003).chm
Wrox - Beginning Fedora 2 (2004).chm
Wrox - Beginning Red Hat Linux 9 (2003).chm
Wrox - Beginning Red Hat Linux 9 (2003).pdf

Part1
Part2
Part3
Part4

Apache configuration httpd.conf

3 main sections of httpd.conf
---------------------------------------

Main server configuration ( host-specific server directives)

Global environment ( the location of configuration files )

Virtual hosts (Server values specific to virtual hosts)


Global environment

ServerType ( run under inetd daemon or standalone service)
ServerRoot ( identifies server root , for security resons you need to ensure that root has exclusive write access to the server root directory tree and its contents and ordinary users cant make modifications )

Timeout 300 (default is 300 ie 5mins) ( sets time period for which apache waits during certain operations are performed before it sends or recieves a timeout signal )

StartServers ( number of services you want to run on startup)

Main server configuration

it contains directives for main server. the values of these directives are also used as default values for virtual hosts unless virtual hosts section of the file specifes diffrent values

it contains configrations related to

PortNumber
User and Group
ServerAdmin email@address.com ( mails if any notifications of server problems to this id)
ServerName www.validhostname.com:80 (address to which sites clients will connect, so give valid DNS name.)
DocumentRoot "/var/www/html" (content will be in this directory we can use symbolic links if space is less)
DirectoryIndex
ErrorLog
Alias
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

It is important to keep all the CGI scripts and executable files in single direcotry "cgi-bin" to avoid security risks
or if you want to give access to some executables then keep them in another directory.Also keep cgi-bin directory
outside /var/www/html
create different CGI direcotries for diffrent virtualhosts we can do it by setting User and Group

User apache
Group apache

when apache starts or get initiated it starts as root to configure itself but later it forks into child and run as
specified user and group as running as root causes security risks.

ps -aux | grep httpd

(display httpd processes currently running )

Listen 80 ( portnumber to listen to default is 80)

if you want to change port chage port higher than 1023 as below 1024 are reserverd for root's use

most commonly used options for httpd are
------------------------------------------------------

-d serverroot (sets the location of the server root overrieds ServerRoot in httpd.conf)
-f config ( carryout commands in configurations at startup)

-h display summary of possible commands
-L provides directive list and possible argeuments and locations where each directive is valid
-t run syntax tests on configuration files returns 0 if acceptable
-x instructs httpd to run in single-process mode genrally used for internal debugging.
-s verify the virtual host configuration

Virtual hosts

it enables to setup virtual host containers to enable multiple-server capability
without vritual hosting you need to run two seperate web servers listening on diffrent IP addresses, and
have a unique network interface bound to each address.
Virtual hosting enables you to host both sites on one computer with the same IP address.

Creating and Managing Virtual Networks Part 1

We start with

1) Identifying the compents of virtual Netwoks

2) creating virtual switches and virtual Switch port groups

3) managing NIC teams

4)managinv Virtual LANs (VLANs)

5)configuring virtual switch security policies

VIRTUAL SWITCH
-------------------------

it resides in vmkernel , it manages traffic between virtual machines


PORT GROUP
------------------

Its on virtual switch (logical object).

it provies services for Service console,Vmkernel and hosted virtual machines

i) service console port : It is configured with an IP address to allow access to service console at that respective address.(vswif)

ii)VMkernel port: it is configured with IP address to allow access to VMotion,
iscsi storage or NAS/NFS storage access,

this is referred as (vmknic)

iii)VM port group:it is switch to switch connection which allows VMs to access physical networks



About ESX Server

 

Esx server is core product of Vmware.

It functions as Hyper visor or Virtulization Layer

It is foundation of Virtual Infrastructure Suite

Its a Bare metal Installation ( It doesn't need operation system )

Its runs only on 64-bit servers

It comes in 3 flavors
1. ESX Full
2. ESXi
3. ESXiFree

As its bare metal installation Hardware resources are highly utilized by
Virtual machines. As resources are not utilized by Host operation system
And one more thing is no limitation on hardware usage.


Esx server has two components

Service Console :

its OS used to manage ESX Server and virtual machines that run on the server.
these include firewall,SNMP agents,Web server.
This Service Console is Redhat Based. and Not the Kernel

VMkernel:

it manages virtual machine's access to the underlying physical hardware
Cpu scheudling
Memory Management
Virtual Switch data processing

Various Virtulization solutions and Vmware Virtual Infrastructure suite

Various virtualization solutions include

Vmware vSphere
Citrix XenServer
Microsoft Hyper-v

there are many other solutions but these are widely used.

Among them Vmware is the top product. Their solutions are stable,efficient and its a complete virtualization solution.

They have developed a pack of solutions and still continuing with its development.
this is called Virtual Infrastructure suite or shortly VI.

this suite contains

Esx server

Virtual SMP (symmetric multi processing)

VirtualCenter

Infrastructure Client

Vmotion

Distributed Resource Scheduler (DRS)

High Availability (HA)

Consolidated Backup (VCB)



































i have not mentioned the versions because here i just wanted to focus on showing different products vmware offers in its Vmware Infrastructure Suite.
I will try to brief all the above mentioned topics in coming articles

Compare Vsphere editions

Essentials for Retail
Essentials Plus for Retail

Standard

Advanced

Enterprise

Enterprise Plus


VMware ESX Server Banner



what is virtualization ?

virtualization is a make belief of things that don't actually exist in real world. ( actual meaning )



Don't ask me if things actually don't exist then what is the use of it :)
 i am going to answer that any way...


 here virtualization is not Simulation or Emulation.

Here we can run multiple operating systems on one server .
These operating systems are called virtual machines.

This virtualization technology is used to convert Hardware to Software

This concept or technology is called virtualization.


what can be virtualized

  • Server
  • Desktop
  • Network
  • Storage
  • Data Centers
these include virtual switches and virtual LAN etc .. yes physical devices can also be virtualized.






Virtualization tutorial on my Blog

I have attend a virtualization forum in mumbai last year

Venue: Taj Lands End
Date: Thursday, 6 Nov 08
Time: 8:00am to 6:30pm

Click here for details


there they have provided many details like
latest in virtualization technologies and trends that are transforming IT environments from the datacentre to the desktop

I found that technology very interesting and took time to learn this upcoming new technology
and post some tutorials and interesting things here..

Nice blog

One of my friend is sharing his real time experiences on linux
i found the articles intresting ... go thourgh...

Click link below to visit his blog....

My Experiences With Linux -Bipinkdas






Linux some common things to remember

1. In Linux systems, to document access to equipment.

2. Linux kernel boot, from the file / etc / fstab to read the file system to load.

3. Linux file system, each file to identify with the i node.

4. All the disk block consists of four parts, namely, guide blocks, special blocks, i node table blocks and blocks of data storage

5. Links divided into: hard links and symbolic links.

6. Super-block contains the i node table and the free block table and other important file system information.

7. A certain file permissions: d-rw--r - -r -, with values expressed as to the authority, then the octal number: 644, the file attribute is a directory.

8. Foreground the process of starting to use Ctrl + c to terminate. 8. Foreground the process of starting to use Ctrl + c to terminate.

9. Static routing settings, if the network topology change is required by the system administrator to modify the routing settings.

10. The important task of network management: control and monitoring.

11. Install Linux system hard disk partition, there must be two kinds of partition types: file system partition and swap partition.

13. Prepared by Shell to run the script file must be given before the execute permission.

14. System management tasks is to be able to achieve in a distributed environment, programs and data security protection, backup, restore and update.

15. The system swap partition as a virtual memory system, a regional.

16. Kernel is divided into process management systems, memory management system, I / O management system and document management systems, four sub-systems.

17. Kernel configuration is the system administrator to change the system configuration hardware to conduct a major operation.

18. In the installation of Linux systems, use the netconfig program to configure the network, the installation program prompts the user for a step by step, type the host name, domain names, domain name server, IP address, gateway address and subnet mask and other necessary information.

19. That uniquely identifies each user is the user ID and user name.

20. RIP protocol is the most common is an internal agreement, commonly known as dynamic routing information protocol. Agreement is the most common is an internal agreement, commonly known as dynamic routing information protocol.

21. In the Linux system, all the contents are represented as files, organize files in various ways is called the file system.

22. DHCP dynamic IP address assignment can be achieved. 22. DHCP dynamic IP address assignment can be achieved.

23. System network management object is a server administrator, user and server processes and system resources.

24. Network management usually monitoring, transmission and management of three parts, of which management component of the entire network management center.

25. When you want to delete this system without access to the device driver must compile the kernel, when the kernel does not support the device driver on the system, you must upgrade to the kernel.

26 Ping command to test the network, the local systems are able to get to a remote host, so I often used to test network connectivity.

27. Vi editor has two operating modes: command mode and input mode.

28. Can use ls-al command to see the file permissions, the permissions of each file are in 10 bits and is divided into four sections, which accounted for a paragraph that file type, accounting for 3 second paragraph that the owner of the file permissions for the file.

29. The distinction between process and procedure lies in its dynamic nature, dynamic creation and termination of the process from creation to the termination of the basic state can have: Run state, ready state and wait state (blocked state).

30. DNS is actually distributed in the internet database of information on the host, its role is to achieve the IP address and host name conversion.

31. Apache is to achieve WWW server function of the application, known as the "Browse web server" in the server-side web services to provide users here is the apache application.

32. In the Linux system can have two types of backup: a backup system backup and user. Where the former refers to the operating system backup, which refers to applications and user files backed up. Where the former refers to the operating system backup, which refers to applications and user files backed up.

33. CD-ROM standard file system type is iso9660.

34. When the lilo.conf configuration has been completed, bring it into force, should run the command and parameters is lilo.

35. In using the ls command, use the octal display non-printing characters should be used to parameter-b.

36. Linux that supports Windows 9.x/2000 long file name file system type is vfat.

37. Set limits on the use of disk space a user command is quota.

38 In the Linux system, used to store system configuration files and subdirectories needed directory is /etc.

39. Hard link can only be built on the file link. Symbolic links across different file systems can be created. Symbolic links across different file systems can be created.

40. Socket file attribute bit is s.

41. The end of the background process command is kill.

42. There are two ways to run the process, that is independently run and use the parent process to run.

43. Links are divided into hard links and symbolic links.

44. In the super-user Linux system, under the display of all running processes, you should use the command and parameters are ps-aux.

45. Pipeline file attribute bit is p.

46. Will be the standard output of the previous command, after a command as standard input, called pipes.

47. For the implementation of the right of the specified script command and parameters are chmod a + x filename.

48. Remote login commands are telnet.

49. To send 10 packets packets abc.tuu.edu.cn test connectivity with the host, you should use the commands and parameters are: ping abc.tuu.edu.cn-c 10.

50. DNS server process named named, when it starts to automatically load / etc directory of the named.conf file partition defined in the DNS database file.

51. Apache server process configuration file is httpd.conf.


52. In the Linux system, the compressed files generated after the suffix. Gz file command is gzip.

53. Edit a file using vi, it will be put into the file test.txt file, should be the command mode, type: w test.txt.

54 can be displayed on standard output the whole year calendar orders and parameters are cal-y.

55. In shell programming, the use of square brackets indicate that the rules of test conditions are: there must be space on both sides of the square brackets.

56. Check the installed file system / dev/had5 is normal, if the check is wrong, then the auto-repair, the command and parameters are fsck-a / dev/had5.

57. Windows9.x environment shared Unix / Linux users in the directory tool is a Samba server.

58. System Administrator is responsible for system resource management, system performance management, device management, security management and system performance monitoring.

59 In the Linux system to test DNS server is able to correctly resolve the domain name of the client-side command, use the command nslookup.


60. In the Linux system, the second IDE channel hard disk (slave) was identified as hdb.

61. When the system administrator needs to upgrade the kernel version and change the system hardware configuration, should be re-compile the kernel.

62. If you just want to modify the system IP address, should be amended / etc/rc.d/rc.inet1 configuration file.

63. When the LAN there are no conditions for the establishment DNS server, but want to LAN users can use the computer name to visit each other, we should configure / etc / hosts file.

64. In the vi editor environment, using the Esc key to model.


65. Slackware Linux 9.0 typically use ext3 file system, the system's total disk block consists of four parts.

66. To / home/stud1/naresh directory do archive compression, the compressed generated naresh.tar.gz file, and save this file to the / home directory, to achieve this task tar command format tar zcvf /home/naresh.tar.gz /home/stud1/naresh.

67. Pipeline from the former standard output as a command after a command standard input.

68. In the use of manual methods to configure the network, you can modify / etc / HOSTNAME file to change the host name, to configure the computer's domain name resolution client, the need to configure / etc / resolv.conf file.

69. Startup process is to manually start and scheduling are two ways to start, where to start commonly used scheduling command at, batch, and crontab.

70. Test.bns.com.cn domain name is bns.com.cn, if you want to configure a domain name server should be defined in the named.conf file, DNS database, working directory.

71. Sendmail e-mail system uses two main protocols are: SMTP and POP, the former is used to send the message, which is used for receiving mail.

72. DHCP is short for Dynamic Host Configuration Protocol, its role is: To network host allocation of IP addresses.

73. At present the use of a proxy server software package there are a variety of teaching materials used in the squid.

74. Rm command to delete files or directories, the main difference is whether to use recursive switch-r or-R.

75. Mv command can move files and directories, you can also rename files and directories.

76. Routing Protocol (RIP) of the number of hops that must pass before the destination gateway number, RIP acceptable to jump the longest distance is 15.

77. Ping command is used to test network connectivity, ping command through the ICMP protocol (internet control message protocol) to achieve.

78. Nfs protocol used to implement Unix (/ linux) file system shared between hosts.
79. In the Linux operating system, devices are accessed through special files.


80. Shell is not only the user command interpreter, it is also a powerful programming language. Bash is the Linux default shell. bash is the Linux default shell.

81. Use ";"; symbol redirects the contents of the output appended to the back of the original.

82. To increase a user's command is: adduser or useradd.

83 for string search using grep command.

84. Use * for each match the number of characters.

85. / Sbin directory is used to store the system administrator using the management procedure

Linux interview questions

-------------------------------
* 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 -tulp
or
#netstat -tulpn

to verfy the open ports
-------------------------------
* how u use the iptable firewall to restrict ssh,telnet,ftp
For SSH
iptables -A INPUT -s -p tcp --dport <22> -j
REJECT/DROP/DENY

For Telnet
iptables -A INPUT -s -p tcp --dport <23> -j
REJECT/DROP/DENY

For FTP
iptables -A INPUT -s -p tcp --dport <21> -j
REJECT/DROP/DENY

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

* what is the difference between unix and linux

graphics is the main difference
extra more command are in linux
userfriendly then unix

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

filesystem are different
there diff lies in kernel
linux is under gpl and unix proprietary

Difference Between Linux and Unix
1)Linux default shell is /bin/bash, where Unix default shell
is /bin/sh (other shell also supported)
2) Linux Store all their command history,but if the default
shell 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, no
Oracle 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. The
security administrator should keep strict control of this
central account.

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

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

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 use
following 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 used
to build,install, query, verify, update, and erase
individual software packages. A package consists of an
archive of files and meta-data used to install and erase the
archive files.

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

eg : # stat /etc/passwd
Output:
File: `/etc/group'
Size: 566 Blocks: 16 IO Block: 4096
regular file
Device: fd00h/64768d Inode: 2443679 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: (
0/ root)
Access: 2009-08-12 08:23:31.245032672 +0530
Modify: 2002-01-01 05:54:15.000000000 +0530
Change: 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 version
rpm -qa | grep nfs
rpm -qi nfs nfs-utils
yum 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

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

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

Root can login through telnet session, but by default it is
disabled. You can enable by appending /etc/securetty file
open /etc/securetty using vi

#vi /etc/securetty

pts/0
pts/1

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

vi /etc/pam.d/login

auth required pam_securetty.so== 1st line
should be placed as required.if we change the option as
sufficient 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 and
create a crond entry
2)configure sendmail & postfix to configure procmail..
Or configure Q-mail / Squirrel mail & use contab
----------------------------------------------------
how do i check which package has installed some command
suppose ls , mkdir or whatever ???

rpm -qa | grep "pakage name"

rpm -qa | grep
yum install it will show already installed
or not if not then it will install
Pirut same as yum
rpm -qa /usr/bin/ls
gives 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 secured
one.when you ssh to trasnfer data between a system, the data
will be send in the encrypted form, where the hacker cannot
encode or decode it. While you telnet,the data send between
the system is alphabetical format(ASCII), where every one
can understand. More over as per network security, telnet
and 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 in
that network

SSH -> secured shocket shell
Its more secure than Telnet .
This has an encrption and decrption of the data /usr/pwd
None 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 control
and it is its default working directory when its logs in.
while the working directory is the users current directory
which may or may not be his home directory.
------------------------------------------
How can you see all mounted drives?

with df -hT command and
with 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 the
two distinct modes of operation of the CPU in Linux. The
other 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 be
executing trusted software, and thus it can execute any
instructions and reference any memory addresses. The kernel
is trusted software, but all other programs are considered
untrusted software. Thus, all user mode software must
request use of the kernel by means of a system call in order
to perform privileged instructions, such as process creation
or input/output.

Kernel compilation is installing a new kernel or adding
custom modules to the same kernel.
Kernel upgradation is upgrading it to a different version
altogether.
------------------------------
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 process
the new process (child process) which is an exact copy of
the calling process(parent process).return value from fork
() is used to distinguish the parent from the child; the
parent receives the child's process id, but the child
receives zero.

A thread is a stream of instructions that can be scheduled
as an independent unit.

A thread is a stream of instructions that can be scheduled
as an independent unit. It is important to understand the
difference between a thread and a process. A process
contains two kinds of information: resources that are
available to the entire process such as program
instructions, global data and working directory, and
schedulable entities, which include program counters and
stacks. A thread is an entity within a process that
consists of the schedulable part of the process.

A fork() duplicates all the threads of a process. The
problem with this is that fork() in a process where threads
work with external resources may corrupt those resources
(e.g., writing duplicate records to a file) because neither
thread may know that the fork() has occurred.

When a new perl thread is created, all the data associated
with the current thread is copied to the new thread, and is
subsequently private to that new thread! This is similar in
feel to what happens when a UNIX process forks, except that
in this case, the data is just copied to a different part
of memory within the same process rather than a real fork
taking place.

A fork() induces a parent-child relationship between two
processes. Thread creation induces a peer relationship
between 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/username
If we want to extract
the 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 /boot
here ls command, -a is option,/boot is arguement

option specifies the command how to run
arguement specifies the command on what to run
---------------------------------------------------------
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 the
end of the system memory for the BIOS (Basic Input/Output
System) and runs it. The BIOS program is written into
permanent read-only memory and is always available for use.
The BIOS provides the lowest level interface to peripheral
devices 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 many
newer systems) for bootable media, if present, and then it
looks to the hard drive. The order of the drives used for
booting is usually controlled by a particular BIOS setting
on the system. Once Linux is installed on the hard drive of
a system, the BIOS looks for a Master Boot Record (MBR)
starting at the first sector on the first hard drive, loads
its contents into memory, then passes control to it.

This MBR contains instructions on how to load the GRUB (or
LILO) boot-loader, using a pre-selected operating system.
The MBR then loads the boot-loader, which takes over the
process (if the boot-loader is installed in the MBR). In the
default Red Hat Linux configuration, GRUB uses the settings
in the MBR to display boot options in a menu. Once GRUB has
received the correct instructions for the operating system
to start, either from its command line or configuration
file, it finds the necessary boot file and hands off control
of the machine to that operating system.

1. The system BIOS checks the system and launches the first
stage boot loader on the MBR of the primary hard disk.

2. The Frist stage boot loader loads itself into memory and
launches the second stage boot loader from the /boot/
partition.

3. The second stage boot loader loads the kernel into
memory, which in turn loads any necessary modules and
mounts the root
partition 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-space
tools, and mounts all partitions
listed in /etc/fstab.

6. The user is presented with a login screen for the
freshly booted Linux system.
-------------------------------------------------------------
What are the main differences between RHEL4 & RHEL5?

XEN, YUM and improved SELinux
all the features updated with better options
Better GUI support then RHEL4
YUM over RPM package management
IPTables and SELinux for more secure environment
ext2 & ext3 file system
In RHEL 4 SELinux Block only 13 services, But on RHEL 5
SElinux 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 menu
ctl+l to clear screen
alt+f2 to open run application window
alt+f3 for find
alt+f4 to close application
alt+f9 to minimise window
Ctrl-Alt-D Show desktop
Crtl-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 poweroff
1 = single user mode
2 = multiuser mode without network and X window
3 = multiuser mode with network without X window
4 = unused
5 = X11 (multiuser mode with network and X window
6 = 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 demons
1)syslogd
2)klogd
3)auditd

klogd:- collect log file created by the Kernel
syslogd:- Collect log file created by the system
auditd:- Collect log file created by the SELinux

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 Techniques
Semaphores in Linux are sleeping locks. Because they cause a
task to sleep on contention, instead of spin, they are used
in situations where the lock-held time may be long.
Conversely, since they have the overhead of putting a task
to sleep and subsequently waking it up, they should not be
used where the lock-held time is short. Since they sleep,
however, they can be used to synchronize user contexts
whereas spinlocks cannot. In other words, it is safe to
block while holding a semaphore.

A "mutex" (or "mutual exclusion lock") is a signal that two
or more asynchronous processes can use to reserve a shared
resource for exclusive use. The first process that obtains
ownership of the "mutex" also obtains ownership of the
shared resource. Other processes must wait for for the first
process to release it's ownership of the "mutex" before they
may attempt to obtain it.

The most common locking primitive in the kernel is the
spinlock. The spinlock is a very simple single-holder lock.
If a process attempts to acquire a spinlock and it is
unavailable, the process will keep trying (spinning) until
it can acquire the lock. This simplicity creates a small and
fast 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 note that it does not have to be a shell.

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

1. Q. How do you list files in a directory?
A. ls - list directory contents
ls -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 filename
cat filename
pg filename
pr filename
more filename
most 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_name
info command_name (more information)

11.Q. How do you list contents of a directory including all of its
subdirectories, 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_name
Links create pointers to the actual files, without duplicating the contents of
the files. That is, a link is a way of providing another name to the same file.
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 -s
df

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

More interview questions click here




Linux Commands


a
alias
Create an alias
apropos Search Help manual pages (man -k)
apt-get Search for and install software packages (Debian)
aspell Spell Checker
awk Find and Replace text, database sort/validate/index
b
bash GNU Bourne-Again SHell
bc Arbitrary precision calculator language
bg Send to background
break Exit from a loop
builtin Run a shell builtin
bzip2 Compress or decompress named file(s)
c
cal Display a calendar
case Conditionally perform a command
cat Display the contents of a file
cd Change Directory
cfdisk Partition table manipulator for Linux
chgrp Change group ownership
chmod Change access permissions
chown Change file owner and group
chroot Run a command with a different root directory
chkconfig System services (runlevel)
cksum Print CRC checksum and byte counts
clear Clear terminal screen
cmp Compare two files
comm Compare two sorted files line by line
command Run a command - ignoring shell functions
continue Resume the next iteration of a loop
cp Copy one or more files to another location
cron Daemon to execute scheduled commands
crontab Schedule a command to run at a later time
csplit Split a file into context-determined pieces
cut Divide a file into several parts
d
date Display or change the date & time
dc Desk Calculator
dd Convert and copy a file, write disk headers, boot records
ddrescue Data recovery tool
declare Declare variables and give them attributes
df Display free disk space
diff Display the differences between two files
diff3 Show differences among three files
dig DNS lookup
dir Briefly list directory contents
dircolors Colour setup for `ls'
dirname Convert a full pathname to just a path
dirs Display list of remembered directories
dmesg Print kernel & driver messages
du Estimate file space usage
e
echo Display message on screen
egrep Search file(s) for lines that match an extended expression
eject Eject removable media
enable Enable and disable builtin shell commands
env Environment variables
ethtool Ethernet card settings
eval Evaluate several commands/arguments
exec Execute a command
exit Exit the shell
expect Automate arbitrary applications accessed over a terminal
expand Convert tabs to spaces
export Set an environment variable
expr Evaluate expressions
f
false Do nothing, unsuccessfully
fdformat Low-level format a floppy disk
fdisk Partition table manipulator for Linux
fg Send job to foreground
fgrep Search file(s) for lines that match a fixed string
file Determine file type
find Search for files that meet a desired criteria
fmt Reformat paragraph text
fold Wrap text to fit a specified width.
for Expand words, and execute commands
format Format disks or tapes
free Display memory usage
fsck File system consistency check and repair
ftp File Transfer Protocol
function Define Function Macros
fuser Identify/kill the process that is accessing a file
g
gawk Find and Replace text within file(s)
getopts Parse positional parameters
grep Search file(s) for lines that match a given pattern
groups Print group names a user is in
gzip Compress or decompress named file(s)
h
hash Remember the full pathname of a name argument
head Output the first part of file(s)
history Command History
hostname Print or set system name
i
id Print user and group id's
if Conditionally perform a command
ifconfig Configure a network interface
ifdown Stop a network interface
ifup Start a network interface up
import Capture an X server screen and save the image to file
install Copy files and set attributes
j
join Join lines on a common field
k
kill Stop a process from running
killall Kill processes by name
l
less Display output one screen at a time
let Perform arithmetic on shell variables
ln Make links between files
local Create variables
locate Find files
logname Print current login name
logout Exit a login shell
look Display lines beginning with a given string
lpc Line printer control program
lpr Off line print
lprint Print a file
lprintd Abort a print job
lprintq List the print queue
lprm Remove jobs from the print queue
ls List information about file(s)
lsof List open files
m
make Recompile a group of programs
man Help manual
mkdir Create new folder(s)
mkfifo Make FIFOs (named pipes)
mkisofs Create an hybrid ISO9660/JOLIET/HFS filesystem
mknod Make block or character special files
more Display output one screen at a time
mount Mount a file system
mtools Manipulate MS-DOS files
mv Move or rename files or directories
mmv Mass Move and rename (files)
n
netstat Networking information
nice Set the priority of a command or job
nl Number lines and write files
nohup Run a command immune to hangups
nslookup Query Internet name servers interactively
o
open Open a file in its default application
op Operator access
p
passwd Modify a user password
paste Merge lines of files
pathchk Check file name portability
ping Test a network connection
pkill Stop processes from running
popd Restore the previous value of the current directory
pr Prepare files for printing
printcap Printer capability database
printenv Print environment variables
printf Format and print data
ps Process status
pushd Save and then change the current directory
pwd Print Working Directory
q
quota Display disk usage and limits
quotacheck Scan a file system for disk usage
quotactl Set disk quotas
r
ram ram disk device
rcp Copy files between two machines
read read a line from standard input
readonly Mark variables/functions as readonly
reboot Reboot the system
renice Alter priority of running processes
remsync Synchronize remote files via email
return Exit a shell function
rev Reverse lines of a file
rm Remove files
rmdir Remove folder(s)
rsync Remote file copy (Synchronize file trees)
s
screen Multiplex terminal, run remote shells via ssh
scp Secure copy (remote file copy)
sdiff Merge two files interactively
sed Stream Editor
select Accept keyboard input
seq Print numeric sequences
set Manipulate shell variables and functions
sftp Secure File Transfer Program
shift Shift positional parameters
shopt Shell Options
shutdown Shutdown or restart linux
sleep Delay for a specified time
slocate Find files
sort Sort text files
source Run commands from a file `.'
split Split a file into fixed-size pieces
ssh Secure Shell client (remote login program)
strace Trace system calls and signals
su Substitute user identity
sudo Execute a command as another user
sum Print a checksum for a file
symlink Make a new name for a file
sync Synchronize data on disk with memory
t
tail Output the last part of files
tar Tape ARchiver
tee Redirect output to multiple files
test Evaluate a conditional expression
time Measure Program running time
times User and system times
touch Change file timestamps
top List processes running on the system
traceroute Trace Route to Host
trap Run a command when a signal is set(bourne)
tr Translate, squeeze, and/or delete characters
true Do nothing, successfully
tsort Topological sort
tty Print filename of terminal on stdin
type Describe a command
u
ulimit Limit user resources
umask Users file creation mask
umount Unmount a device
unalias Remove an alias
uname Print system information
unexpand Convert spaces to tabs
uniq Uniquify files
units Convert units from one scale to another
unset Remove variable or function names
unshar Unpack shell archive scripts
until Execute commands (until error)
useradd Create new user account
usermod Modify user account
users List users currently logged in
uuencode Encode a binary file
uudecode Decode a file created by uuencode
v
v Verbosely list directory contents (`ls -l -b')
vdir Verbosely list directory contents (`ls -l -b')
vi Text Editor
vmstat Report virtual memory statistics
w
watch Execute/display a program periodically
wc Print byte, word, and line counts
whereis Report all known instances of a command
which Locate a program file in the user's path.
while Execute commands
who Print all usernames currently logged in
whoami Print the current user id and name (`id -un')
Wget Retrieve web pages or files via HTTP, HTTPS or FTP
write Send a message to another user
x
xargs Execute utility, passing constructed argument list(s)
yes Print a string until interrupted
. Run a command script in the current shell