Wednesday, December 30, 2009

Red Hat Linux System Administration Pre-assessment Questionnaire

Red Hat Linux System Administration Pre-assessment Questionnaire
Topic #1: Supported Hardware

1) Which statement is false?
The master drive on the primary IDE controller is /dev/hda.
USB and PCMCIA devices are supported by Red Hat, but only USB is hot swappable.
Both SCSI and IDE are supported by Red Hat.
Do not know.

2) Block and character special devices, used to address hardware, do not display size in a long ls listing. Instead, they display
the amount of addressable space on the device
bus and device numbers
major and minor device numbers
Do not know.

3) Which statement is false?
The i686 and athlon kernels can map up to 4 GB of RAM, but using the bigmem kernel, more than 4 GB of RAM can be mapped if your hardware supports Physical Address Extentions (PAE).
Support for virtual CPUs using hyperthreading technology is only available when using smp or bigmem kernels.
Architectures supported by Red Hat Enterprise Linux products include IA-32, IA-64, Alpha, S/390, z-Series, pSeries, and Sparc.
Do not know.


Topic #2: Installation

1) When selecting packages to install,
you may make your selection by individual package or by package group; no further level of refinement is possible.
you may make your selection by individual package or by package group; if you choose the latter method, you can refine your choice by selected the related "Details" item.
the installer does not track how much disk space the requested installation will take.
Do not know.

2) Which statement about installation is false?
It is not possible to set up logical volume management at install time.
It is possible to set up additional non-privileged user accounts at install time.
Kickstart installations allows system administrators to install an operating system in a virtually hands-free manner, often requiring no human intervention, other than starting the kickstart process.
Do not know.

3) Setting up software RAID partitions
is not possible during the install.
is a simple one step process of designating a partition as a software RAID partition and declaring the mount point.
is a multi-step process: declare various partitions to be software RAID partitions and then RAID them together.
Do not know.

Topic #3: Creating and maintaining filesystems

1) What is the default filesystem type under the current version of Red Hat?
ext2, the second extended Linux filesystem.
ext3, the third extended Linux filesystem.
reiserfs, the Reiser filesystem.
Do not know.

2) How many partitions are allowed on an IDE drive?
63 total partitions are allowed, but this number is only possible if you use an extended partition, which will limit the number primary partitions to three.
15 total partitions are allowed.
Four primary partitions are allowed, plus an extended partition. Logical partitions reside within the extended partition. Up to 15 logical partitions are allowed.
Do not know.

3) Explain filesystem remounts.
remount is an option to mount command allowing the system administrator to change the options on a currently mounted filesystem; these changes will take effect immediately.
remount is a command that forces an unmount (umount) and a mount of a filesystem, typically an NFS filesystem, to clear a stale file handle.
remount is a process that occurs when changing runlevels, effectively reapplying options from the /etc/fstab file.
Do not know.

Topic #4: X Window System Administration

1) Which statement is true about the configuration of the X server?
The redhat-config-xfree86 command will not create an /etc/X11/XF86Config file.
You cannot create an /etc/X11/XF86Config file at install time.
The redhat-config-xfree86 command will probe your hardware to determine values for the /etc/X11/XF86Config file.
Do not know.

2) Which statement is true about the relationship between display managers and desktop environments?
To use the KDE desktop, you must use the kdm display manager.
Regardless of the display manager you use, you may start up either the KDE desktop or the GNOME desktop.
When you use switchdesk to select a desktop environment, you also select a display manager.
Do not know.

3) Which of the following statements about using the Xauthority security mechanism with ssh is false?
An MIT magic cookie must be manually created before the Xauthority mechanism can be used with ssh.
To use the Xauthority mechanism with ssh, log into the remote computer using ssh from an xterm-type application running on the X server system and run the application.
When using the Xauthority security mechanism through ssh, all data passing between the remote client and the local X server will be encrypted.
Do not know.


Topic #5: System initialization

1) Which item below best represents the boot sequence?
The BIOS loads the boot loader; the boot loader loads the kernel; the kernel runs the initial process.
The BIOS loads the kernel; the kernel loads the boot loader; the boot loader loads the initial process.
The BIOS loads the initial process; the initial process loads the boot loader; the boot loader loads the kernel.
Do not know.

2) On a default Red Hat system, what is the first program run by /sbin/init?
/etc/rc.d/rc.sysinit
/etc/rc.d/rc
/sbin/initdefault
Do not know.

3) How does runlevel S differ from runlevel 1?
There is no difference; they are exactly the same.
Runlevel 1 runs the /etc/rc.d/rc1.d scripts, but runlevel S does not.
Runlevel S runs rc.sysinit, but runlevel 1 does not.
Do not know.

Topic #6: User and group administration

1) How can a system administrator change the password of a non-privileged user?
If using shadow passwords, run shadow username. If using an integrated /etc/passwd file, run passwd username. Either version will prompt the superuser for the new password.
Run passwd username. This will prompt the superuser for the new password.
It is necessary to know the non-privileged user's password in order to change it. The system administrator can run passwd username. This will prompt the superuser for the user's current password and the new password.
Do not know.

2) The /etc/shadow file:
must be used to hold the encrypted password; the second field of the /etc/passwd file is no longer valid.
is optional; a system administrator can choose to use it or not.
is considered less secure than using an integrated /etc/passwd file.
Do not know.

3) What is the net effect of running the following commands:
usermod -G sysadmns digby
usermod -G websters digby
digby is a member of the websters group.
digby is a member of the sysadmns and websters groups.
digby's primary group (as specified in the /etc/passwd file) is websters.
Do not know.

Topic #7: Client-side network authentication

1) Which of the following is not a common network authentication scheme?
NIS
LDAP
autofs
Do not know.

2) What is the name of the tool that configures a network authentication scheme?
systemauth
userconfig
authconfig
Do not know.

3) Where is the NISDOMAIN variable set and stored?
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-interface, where interface is an interface name, such as eth0.
/var/yp/securenets
Do not know.

Topic #8: Network setup and troubleshooting

1) The configuration file for the first ethernet interface is:
/etc/sysconfig/ifcfg-eth0
/etc/sysconfig/ifcfg-eth1
/etc/sysconfig/network-scripts/ifcfg-eth0
Do not know.

2) Which command does not modify the configuration file for the first ethernet interface?
ifconfig
netconfig
redhat-config-network
Do not know.

3) Where can the default route be specified?
In the global network default file, /etc/sysconfig/network, only.
In the network interface configuration files only.
In either the global network default file, /etc/sysconfig/network, or the network interface configuration files.
Do not know.

Topic #9: Printing

1) Which printing subsystem is available under current versions of Red Hat:
printcap
CUPS
BSD
Do not know.

2) From the user's perspective, which printing user interfaces are available on Red Hat:
LPRng and CUPS
BSD and LPRng
BSD and System V
Do not know.

3) What is the name of a valid print daemon under Red Hat?
printd
cupsd
spoold
Do not know.

Topic #10: System Logging and Monitoring

1) Most daemon log messages get logged to:
/var/log/daemonname, where daemonname is the name of the daemon.
/var/log/messages
/var/log/dmesg
Do not know.

2) Which statement about system logging is false?
klogd logs kernel messages; syslogd logs some other log messages.
The system logging subsystem can send messages over the network to a log host.
The following line in the /etc/syslog.conf file means that no messages will be logged through the mail facility:
mail.* /var/log/maillog
Do not know.

3) The load average is a measure of how busy your CPU is. What does it measure?
The number of non-timer interrupts divided by the number of minutes over which the average is taken, divided by 1000 (or 1024, depending on the version of Linux or Unix being used).
The average number of processes in the process table over an increment of time.
The average number of processes in the runnable state over an increment of time.
Do not know.

Topic #11: System-wide task automation

1) How many fields does an entry in the /etc/crontab file have?
6: five time specifications and a command, the same number as users' crontab files.
7: five time specifications, a user under whose authority the command should be run, a command; this is one more than users' crontab files.
7: five time specifications, an email address to receive unredirected standard output and standard error, and a command; this is one more than users' crontab files.
Do not know.

2) By default, the /etc/crontab file is populated with:
A series of commands such as makewhatis, tmpwatch, and logrotate that perform system maintenance on a regular basis.
A series of runparts commands that, in turn, run a series of other commands, such as makewhatis, tmpwatch, and logrotate, that perform system maintenance on a regular basis.
By default, the file contains no commands, allowing individual system administrators to populate the file.
Do not know.

3) To prevent some users from using the at command:
add the users to the atdeny group in the /etc/group file.
put the usernames of those users in the /etc/at.deny file.
as there is no /etc/at.deny file, you must put the names of the users permitted to use the at command in the /etc/at.allow file.
Do not know.

Topic #12: RPM

1) What is not one of the functions of the rpm command?
Install software.
Query the database of installed software.
Optionally, interactively configure newly installed software packages, asking the system administrator a series of questions about the install, such as whether or not the files have been relocated to a different directory.
Do not know.

2) What is the difference between these two rpm commands?
rpm -Uhv mypkg.1.0-2.noarch.rpm
rpm -Fhv mypkg.1.0-2.noarch.rpm
The -U version of the command uninstalls the package, whereas the -F version will upgrade the package if a previous version is already installed.
Both will upgrade the mypkg package if it is already installed, but if the mypkg package is not installed, the -U version will install it, whereas the -F version will not.
The -U version will uninstall the package, whereas the -F version will do a test install, reporting any install errors without actually installing it.
Do not know.

3) In the query command below, what is being queried?
rpm -qp mypkg.1.0-0.noarch.rpm
The package file.
The RPM database on the current system.
Nothing. This is not a valid query.
Do not know.

Linux Questions (Redhat Linux Essentials)

Red Hat Enterprise Linux Essentials Pre-assessment Questionnaire
Topic #1: Basic Filesystem and File Commands

1) If the file newdir/file2 does not exist but the directory newdir does exist, what is the effect of the following command?
mv file1 newdir/file2
file1 will be moved to newdir and renamed file2.
file1 will be copied to newdir and named file2.
An error will be reported, as this is an invalid command.
Do not know.

2) What will this command return?
ls -F
A listing of items in the current directory unsorted.
A listing of items in the current directory with file type indicators after some files.
A listing of items in the current directory separated by commas on a single line instead of presented in columns.
Do not know.

3) Considering the command below, which of the following statements is true?
ln file1 file2
file2 will be symbolically linked to file1.
Regardless of the size of file1, file2 will have a size of 5 bytes.
file1 and file2 have the same inode number.
Do not know.


Topic #2: The Linux Filesystem Layout

1) What type of files are typically in the /etc directory?
Configuration files.
Miscellaneous files.
Standard Linux commands.
Do not know.

2) In what directory are email inboxes stored by default?
/var/spool/mail
The mail directory in the user's home directory.
/usr/mail
Do not know.

3) The /lib directory contains:
Libraries of documentation.
Configuration files.
Shared objects.
Do not know.

Topic #3: Permissions and Attributes

1) What command lists file permissions?
a. chmod
b. ls -l
c. perms
d. Do not know.

2) What are the numeric permissions on a file with permissions of -rwxr-x--- after you run the command:
chmod g+s file
a. 2750
b. 750
c. 751
d. Do not know.

3) What is the effect of the following command?
chattr +i file
a. Changes of any kind are forbidden; in effect, the file is immutable.
b. The file will be compressed when saved to the disk, but be uncompressed when read.
c. The file can only be opened in insert mode only: data can be added, but data in the file cannot be changed or removed.
d. Do not know.

Ans : a

Topic #4: Text Processing Tools

1) Which of the following is best suited for viewing text one page at a time?
a. cut
b. less
c. grep
d. Do not know.
Ans : b

2) Which of the following is best suited for extracting columns of text?
cut
less
grep
Do not know.

Ans : a

3) For the file reports.txt, which of the following commands would, ignoring case, extract every line containing the word "expense", the lines before and after each match, and print the relevant line numbers?
grep -i expense reports.txt
grep -A1 -B1 -n -i expense report.txt
grep --context=1 -N -i expense report.txt
Do not know.

Ans : b

Topic #5: The vi and vim Editors

1) When using the vi editor, which of the following is true?
In command mode, the capital letter "O" opens a line below the current line, placing you in insert mode.
In command mode, the lower case letter "a" places you in insert mode, appending after the cursor.
In command mode, "dd4" deletes four lines.
Do not know.

ans : b

2) When using the vi editor, in command mode, which of the following sequences will delete four words?
4xw
wwww
4dw
Do not know.

ans : c

3) In vim, you search for a string of characters and the characters are highlighted. How do you turn off the highlighting?
:set nohighlight
:set nohl
:nohl
Do not know.

ans :


Topic #6: System Configuration Tools

1) Which of the following might you use to configure the network?
redhat-config-network
system-config-network
ipconfig
Do not know.



2) Where is the configuration information for network interface eth0 stored?
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/eth0.conf
/etc/network/eth0.cfg
Do not know.

3) Which of the following commands could be used to configure a system's date and time?
datetime
date
timeconf
Do not know.


Topic #7: Standard Input and Output System

1) What will the following command do?
ls -l /etc > /tmp/etc.ls
Display a long listing of the /etc directory and the /tmp/etc.ls file.
Display a long listing of the /etc directory, redirecting the output into the /tmp/etc.ls file.
Report an error message, as this is a poorly constructed command.
Do not know.

ans : b

2) Which command below will merge the standard output and standard error of the ls command and then place the merged data into two separate files?
ls -lR /data > mylist1 > mylist2 2>&1
ls -lR /data 2>&1 | tee mylist1 > mylist2
ls -lR /data | tee mylist 1 > mylist2 2>&1
Do not know.

Ans : b

3) What happens to standard output and standard error when running the following command?
ls -lR /data 2>&1 > /tmp/output
stdout and stderr go to the /tmp/output file.
stdout goes to the /tmp/output file and stderr is displayed on the screen as standard output.
stderr goes to the /tmp/output file and stdout is displayed on the screen.
Do not know.

ans : b

Topic #8: Process Control

1) What command diplays a list of processes currently running on your system?
ps ax
proc -a
stat
Do not know.

2) For a job running in the foreground, how can you run it in the background?
This is not possible.
Suspend the job by typing Control-c and then place it in the background by sending kill -TSTP PID, where PID is the process ID number.
Suspend the job by typing Control-z and then place it in the background by executing the bg command.
Do not know.

3) In a process listing, what does a T indicate in the STAT column?
The process execution has been suspended.
The process is defunct.
The process has no resident pages.
Do not know.

Topic #9: Client-side Encrypted Communications

1) Which of the following will allow you to log into another computer using an encrypted tunnel?
telnet
ssh
rlogin
Do not know.

2) In order to allow an encrypted ftp connection to your box, which service or services must you provide?
sshd
vsftpd
both vsftpd (or some other FTP daemon) and sshd
Do not know.

3) You wish to automatically log into computer1 from computer2. To accomplish this, you place a key from computer2 in a file in the proper hidden directory of computer1. In which file do you place this key?
authorized_keys
known_hosts
id_dsa.pub
Do not know.


Topic #10: bash Command Line Shortcuts

1) Your present working directory contains the following files:

parrot

pelican

penguin

You type:
ls -l pa
and then hit the tab key. You are using the bash shell as your interactive shell. What happens?
"pa" will be expanded to "parrot".
Nothing.
"pa" will be expanded to "parrot" and then the ls command will be executed.
Do not know.

2) The following command returns a list of files. What best describes the files listed?
ls *.*
A list of all files in the present working directory.
A list of all non-hidden files in the present working directory.
A list of all files in the present working directory that have a dot in the name, but not as a first character.
Do not know.

3) What command will be run by this sequence?
!?cat
The most recent cat command.
The most recent command that has cat in the command name.
The most recent command that has cat somewhere on the command line.
Do not know.


Topic #11: Shell Scripting

1) In the following shell script, how many times will the date command run?
for i in a b; do date; done
0
1
2
Do not know.

2) Under what condition is hello echo'ed in the following shell script?
if [ -d newitem ]; then echo hello; fi
If newitem is a directory.
Always.
Never, as newitem is a non-zero length string.
Do not know.

3) In a shell script in a while/do loop, what does the continue statement do?
Pause for one second and then continue to execute.
Interrupt that particular time through the do loop and jump to the while statement to reevaluate the conditional statement.
Jump past the done statement and continue executing.
Do not know.


Topic #12: Task Automation

1) What is the proper way to call the at command to submit a job to run sometime in the future?
at

This will prompt you for the command you wish to run and the time you wish to run it.


at timespec

timespec is the time that you want the command to run. You will be prompted for the command that you wish to run.


at timespec command

This will run the command at the time timespec.


Do not know.

2) Considering this entry in a user's crontab file, how often will the command in this line run?
30 4 * * 3 mycmd
Hourly.
Weekly.
Hourly in the month of March.
Do not know.

3) Considering this entry in a user's crontab file, how often will the command in this line run?
*/5 * * * * mycmd
Every five minutes.
Five minutes past the hour every hour.
This will not run, as the format is invalid.
Do not know.

Wednesday, December 16, 2009

Some Linux Questions

Linux Questions :

1. Using bash, what will be the current working directory after these commands:

cd /
cd /tmp
ls /etc
cd $_

a. /
b. /tmp
c. /etc
d. /home

ans : c

2. "kudzu" is:

a. A pallete mixer
b. A sound mixer
c. The program that probes for new or missing hardware
d. a device driver for Mouse

and : c


3. The following messages are observed in a logfile:

Aug 11 10:14:58 linbox -- MARK --
Aug 11 10:34:58 linbox -- MARK --
Aug 11 10:54:58 linbox -- MARK --
Aug 11 11:14:59 linbox -- MARK --

4. What program is most likely to be responsible for these?

a. syslogd
b. sendmail
c. cron
d. init

ans : a