Saturday, May 3, 2008

Review for chptr 11

SLES chptr 11 review

1). Which of the following daemons is started on a NIS server?

ypserv, ypbind, RPC portmapper

2) What command may be used to generate NIS maps on the command line using entries on the /var/yp/Makefile?

make –c /var/yp

3) You have configured your system to Authenticate to a NIS server. When you use the passwd command to change your password, it does not change as expected. What command must you use to change your NIS password for it to take effect on the NIS server?

yppasswd

4) Which of the following is a valid DN for an LDAP object?

cn=joe,ou=acctg.dc=suse.dc=com

5) What package is used to implement LDAP in SLES 9?

Openldap2

6) Which of the following are common MTAs in Linux?

Postfix, Sendmail

7) What tow protocols do MUAs typically use to retrieve e-mails from across the network?

SMTP,TCP

8) What protocol does an MUA typically use to send e-mails to an MTA?

POP or IMAP

9) You have recently modified the /etc/aliases file.What command can you run to update your MTA with the changes?

newaliases

10) What file can you place in your home directory to create Procmail filters for your e-mail?

~/.procmailrc

11). What xinetd file could you edit to configure the telnet daemon?

/etc/xinet.d/telnet

12). What lines could you add to the /etc/host.allow and /etc/host.deny files to allow only the host arfa the ability to use the telnet utility when connecting to your server?

/etc/hosts.allow: in.telnetd: arfa
/etc/hosts.deny: in.telnetd: all

13). What command could you use to check the syntax of your TCP wrappers?

tcpdchk

14).What option to the SSH command can be used to start graphical programs on the remote computer?

SSH -x

15) Where can you find a sample DHCP server configuration file to copy and modify for your own DHCP server?

/usr/share/doc/packages/dhcp - server/examples/simple_dhcpd.conf

16). What directory on an SLES system contains the default web page for the Apache web server?

/srv/www/htdocs/

Monday, April 21, 2008

Chapter 10 review

Chapter 10 review pgs 543-545

1. What is the TLD for www.sample.com?

.com (commercial use)

2. What determines the default length of time that a name resolution result is cached on your computer?

time to live (TTL)

3. Which two packages must you have installed for your computer to function as a DNS server?

Bind &bind-utils

4. What line in the /etc/named.conf file can be used to forward name resolution requests that cannot be resolved locally to a DNS server with an IP address of 192.168.1.242?

In the options block part of the file in the forwarders line.

5. What record in a DNS zone file is used to map names to IP addresses for hosts on the network?

/var/lib/named

6. How does a slave DNS server know that changes have been made on the master DNS server?

The servers use zone transfer(s)

7. How many DNS servers can a single DNS server be configured to forward name resolution requests to?

Up to three DNS addresses

8. What three commands could you use to test name resolution?

host, dig, & NSlookup

9. What line in the /etc/exports file will export the /home directory to the host arfa as read-write, while ensuring that the root user does not have administrative rights to the exported directory?

/home arfa (rw,root_squash)

10. What three services need to started on an NFS server?

RPC portmapper

RPC nfsd

RPC mountd

11. What command may be used to mount the /home directory on a remote computer called server2 using the NFS protocol to the local /mnt directory?

mount –t nfs –o ro server2:/home /mnt

12. What command may be used to display the NFS ports registered by the RPM port-mapper daemon?

rpcinfo -p

13. What two commands can you run to activate changes made to the /etc/samba/smb.conf file?

rcnmb restart , rcsmb restart

14. What two commands can you use to check the etc/samba/smb.conf file for errors?

usr/bin/testparm

15. What command may be used to mount the acctg shared directory on the server arfa to the local /mnt directory using SMB?

mount –t smbfs //arfa/acctg /mnt

16. Which command may be used to create printers?

lpadmin

17. When you try to send a print job to the printer P1 you receive an error message stating that the print queue is unavailable. What command can you use to allow print jobs to enter the print queue for P1?

/usr/sbin/accept printer p1

18. What address would you use in your web browser to administer your CUPS server?

http://localhost:631/admin

19. When you save print options to the K printer utility as the root user, what file are these options saved to?

/etc/cups/lpoptions

20. What CUPS log stores remote printing requests?

/var/log/cups/access_log

Saturday, April 12, 2008

Chapter 9 network config admin review questions

1. What must each computer have in order to participate on a TCP/IP network, as well as contact hosts on remote networks by name?

Must have an IP address
a default gateway
DNS server

2. How long is the host ID by default in a class A network?

1byte

3. Which of the following are class B IP addresses?

177.16.41.10
133.1.1.2

4. What network address is reserved for loop back?

127.0.0.1

5. What name is used to identify the first Ethernet network interface in Linux?

eth0

6. What file stores the list of DNS servers that your computer can contact to resolve hostnames into IP addresses?

/etc/resolv.conf

7. What command can you use to configure the IP address 192.168.1.1 and default subnet mask on your first Ethernet network interface?

ifconfig eth0 192.168.1.1 netmask 255.255.255.0

8. What command can you use to configure an additional IP address of 192.168.1.2 and default subnet mask on the same network interface in question 7?

ifconfig eth0:1 192.168.1.2 netmask 255.255.255.0

9. Which of the following commands may be used to view IP configurations?

The two commands that may be used to view IP configurations are: ifconfig and ip

10. What file contains the information used to configure your second Ethernet network interface at boot time?

/etc/sysconfig/network/ifcfg –eth1

11. What line would you configure in the file described in question 10 to obtain an IP configuration from a DHCP server?

BOOTPROTO= ‘dhcp’

12. How many DNS servers may be listed in /etc/resolve.conf?

three

13. Which two commands could you type at a command prompt to add a route to the 168.16.0.0 network via the router 192.168.1.254?

ip route add 188.16.0.0/16 via 192.168.1.254

route add –net 188.16.0.0 netmask 255.255.0.0 gw 192.168.1.254

14. What file could you use to configure the static route configured in question 13 for use with all network interfaces on your system?

/etc/sysconfig/network/ifcfg

15. What command could you use to send five ICMP requests to the host 192.168.1.254?

ping 192.168.1.254

16. What command could you use to listen to all traffic sent to port 1433 on your computer?

netcat -l –p (hostname) 1433

17. What options to the netstat command could you use to display the routing table?

netstat -rn

18. What command could you use to listen to all packets received on your first Ethernet network interface?

tcpdump –i eth0

Friday, April 4, 2008

SLES chptr 8

1).Which of the following terms refers to a system service that does not run on a terminal?

daemon process

2).What is the PID of init?

PID1 belongs to init

3).Which of the following statements are true?

4).Which of the following commands can quickly identify the child process started by a particular daemon?

pstree

5).To what processes are regular users allowed to send KILL signals?

Only their own processes

6). You have just run the ps aux command and notice that most of the daemons have an s in the STAT column, what does this mean?

(s) sleeping

7).What key can you press in the top command to send the process a signal?

top –k

8).What can you type at a command prompt to run the updatedb command in the background?

updatedb&

9).Which of the following key combinations can you use to pause a foreground process, such that it may be sent to the background with the bg command?

Ctrl+z

10).Which of the following KILL commands may be used to send the second background job a SIGINT?

Kill -2 %2

11). If you do not specify the type of signal when using the kill or killall commands, which signal is used by default?

Sigterm

12).What command could you use to change the priority of a process (PID=592) to run with the highest priority?

nice –n -20 592

13).What action in the /etc/inittab file is used to determine the default runlevel at system initialization?

initdefault

14).What is the default run level in SLES?

Init 5 or init 3

15).What runlevel loads all networking daemons (incl. NFS) but does not start a display manager?

init 3

16).What command can you type to change your runlevel to single user mode?

init 1

17).Which of the following commands will force your system to reboot?

init 6

18).Which of the following commands may be used to stop the SSH daemon (sshd)?

rcsshd stop
/etc/init.d/sshd stop

19).What template can you copy to create a script that is used to start or stop daemons in the /etc/init.d directory?

/etc/init.d/skeleton

20).Which of the following methods can you use to start the SSH daemon (sshd) upon entering runlevel 3?

Create a shortcut to the /etc/init.d/ssh script called /etc/init.d/rc3.d/s88sshd .

Change the INIT INFO section of the /etc/init.d/sshd script and run the insserv command.

21).You have a script that us used to remove temporary files and would like this script to run on a daily basis. What directory could you place this script in to have the cron daemon execute it each day?

/etc/cron.daily/

22).What command could a regular user use to edit their crontab?

crontab -e

23).What lines would you add to your crontab to schedule the /bin/false command to run at 10:30am and 2:50pm from Monday to Friday?

*/ 10:30 – 14:50** 1-5 /bin/false

24).What command can you use to run the contents of the file CLEANUP at noon?

at –f cleanup 12:00

25).Which command can you use to view at jobs that have been scheduled on your system?

atq or at -l

Monday, March 17, 2008

chapter 7 Q&A

chapter 7 review questions

1). Which of the following are always stored in the /etc/passwd file?

c. the default shell each user uses

2). When you check the /etc/shadow file on your system, you notice that the date of the last password change is 12907. What does this number represent?

b. December 9 2007

3). You currently use both /etc/passwd and /etc/shadow files to store user account information. What command can you use to consolidate this information into the /etc/passwd file only?

pwunconv

4). Which of the following files could you edit to create groups and add members to these groups?

/etc/group

5). Which of the following file are used to obtain default user account settings when you create a user with the useradd command?

/etc/default useradd & /etc/login.defs

6). You have a file called "Policies and procedures.txt" That you wish to place in the home directories of all newly created user accounts where should you place these files?

/etc/skel

7). What command can you use to add user bob to your system, create a home directory for him, set his primary group to acctg, and give his account an expiry date of May 11 2006?

useradd -m -g acctg -e 2006-05-11 bob

8). After creating the user in question 7 what must you do to allow the user to login to the system?

bob must have a valid user name, login name to log into the system.

9). What command can be used to change the UID of the user in question 7 to 741?

usermod -u 741 bob

10). What two commands can be used to create the group acctg and add the user bob to it?

groupadd acctg , groupmod -A bob acctg

11). Which of the following commands may be used to see the current user resource limits for your system?
ulimit -a

12). Which of the following file permissions gives the group owner the ablity to edit the file contents?

rw-rw-r-x

13). Which of the following directory permissions gives the owner the ablity to list the contents of the directory?
rwxr--r-x or r-xrw-r-x

14). What command could you use to change the owner to bob and the group owner to acctg for the file /etc/yearend?

chown bob /etc/yearend , chgrp acctg /etc/yearend

15). What command could you use to change the permissions on the file /etc/yearend to rw-rw-r-- using octal notation?

chmod 664 /etc/yearend

16). What permissions does the system give to new file and directories by default prior to appyling the umask?

Directories 777 files 777

17). What will the permissions be on a new directory if the umask is set to 027?

----w-rwx

18). Which of the following commands will set the sticky bit special permissions on the directory /public?
chmod 1777 /public

19). You have enabled user and group quotas on the filesystem that is mounted to the /var directory. Which files contain the quota limits?

/aquota.group
/aquota.user

20). What command can you use to modify the grace period for quota soft limits?

edquota -t

21). Which of the following are journaling filesystems that can created using the mkfs command?

jfs, ext3, Reiserfs

22). How many partitions can be made on a single IDE hard drive using the fdisk program?

four (primary partitions) if you need more than that use one of the four partitions as an extended partition, in there you can create logical partitions (up to 64 logical) for IDE

23). Which option to the fsck command would you use to check all filesystems listed in /etc/fstab?

fsck -A /etc/fstab

24). What command would you use to check a ReiserFS filesystem for errors?

reiserfsck

25). You cannot unmount a filesystem that you had previously mounted to the /mnt directory. What command can show you which users are still using the /mnt directory?

mount

26). What command can you use to list the package in the RPM database that the /etc/hosts file belongs to?

rpm -qf /etc/hosts

27). You have downloaded the source code for a program that you wish to compile. What command can you use in the source code directory to create a makefile?

make

28). Which is the first area on your hd that typically contains a Linux bootloader?

MBR

29). Which of the following boot managers contain an interactive shell?

grub

30). You have modified the /etc/lilo.conf file but, your changes have not taken effect. What command must you run?

lilo must update so as root /sbin/lilo After that has finished run the command shutdown -r now
Which hopefuly reboots the system, and what ever conf changes that were made will be in affect.

Friday, March 14, 2008

Questions from chptr 6

1. Which of the following are valid shells that are available in Linux?

Answers: /bin/bash , /bin/ksh, and /bin/tcsh

2. Which of the following files are executed when you start another shell following login?

Answer: ~/.bashrc

3. Which of the following files can you edit to create a variable that must exist in all shells that are started by users on your system?

Answer: /etc/profile

4. You have just edited your ~/.bash file and added a line that loads a variable. How can you read this file into your current shell environment?

Answer: source .bashrc or . .bashrc

5. Which of the following may be used to protect the $ character in the phrase $DIR from being interpreted specially by the bash shell?

Answer: \$DIR

6. You wish to recall a previous command that starts with the letters “cron” after you type the letters “cron” on the command line. What key combination could you use to search the command history for previous commands that start with “cron” ?

Answer: Ctrl +R

7. Which key may be used to complete the name of a file or directory on the command line?

Answer: you can use the Tab key.

8. Which of the following commands can be used to view contents of the $NOVELL variable?

Answer: echo $NOVELL

9. What command could you use to create a variable called TEST that is available to child processes in subshells?

Answer: export TEST

10. What function call is used by a shell to create a subshell for program execution?

Answer: forking

11. Which of the following commands may be used to view all shell and environment variables on the system?

Answer: env

12. What command could you use to create an alias called C that runs the clear command in your current shell?

Answer: alias c=’clear’

13. Which of the following files are best suited to storing aliases?

Answers: ~/.alias or ~/.bashrc

14. Which command can be used to view all files in the /etc directory that are three characters long and start with either A or B?

answer: ls /etc/ [AB]??

15. Which of the following output redirection symbols will not overwrite an existing file?

Answer: d. >>

16. What command could you enter at a command prompt to view a long listing of the file in the /proc directory, and save the stdout and stderr to the file results in your current directory?

Answer: ls –l /proc/ > results 2>&1 .

17. Which of the following demonstrates correct syntax?

Answers: command command , command >file

18. To which device file can you redirect stderr in order to ignore stderr completely?

Answer: /dev/null

19. Which of the following will run the command echo “I found it!” Only if the command grep local host /etc/hosts is successful?

Answer: c. grep localhost /etc/hosts && echo “I found it!”

20. What command accepts information from stdin and sends it to both a file and stdout

Answer: tee

21. Which key can you use to switch from command mode to insert mode in the vi editor?

Answer: b. i

22. What key sequence in the vi editor will allow you to save your changes and quit?

Answers: :wq or :x

23. What sed command would you use to replace all occurrences of the word mom with dad in the file letter?

Answer: sed –s ‘/mom .*/dad’ letter

24. What sed command would you use to delete all lines that begin with a # character in the file /etc/samba/smb.conf?

Answer: sed ‘/# .*/d /etc/samba/smb.conf

25. What awk command would you use to print the third and fifth fields of the colon delimited /etc/passwd file?

Answer: awk ‘BEGIN {FS= “:”} {print NR $3, $5}’ /etc/passwd

Monday, March 3, 2008

review q's from chptr 5

1. Where can you find the detail specifications of FHS?

Answer:
www.pathname.com/fhs/

2. How long can the total path name to a particular file be in Linux (from the root directory?)

Answer: can not exceed 4096 characters including the /’s (slashes)

3. What directories must reside on the same file system partition as the root directory?

Answers: /bin/ , /dev/ , /etc/ , /lib/ , and /sbin/

4. Which of the following are absolute path names?

Answers: b. /home/bin/

5. Which of the following devices can be referenced using device files?

Answers: a. printers , b. mice, and d. hd partitions

6. When you do a long listing of the file /dev/fd0, you notice the following output: brw-rw----1 root disk 2 0 Jun 30 2007 /dev/fd0 Which of the following statements are true regarding this file?

Answer: b. The file is a block oriented device file that has a major number of 2 and a minor number of 0.

7. What device file is used to refer to the first partition on your IDE hd?

Answer: /dev/hd*

8. What three hidden files exist in user home directories?

Answers: . profile, .bashrc, and .bash_history

9. Which directory stores administrative programs?

Answer: /sbin

10. You are trouble shooting a system problem and believe there is a duplicate interrupt being used on the system what file can you view to verify this?

Answer: /proc/interrupts

11. What command can you type at a command prompt to mount a cd-rom file system to the /mnt/cdrom directory?

Answer: mount /dev/cdrom/mnt

12. Which option to the ls command can you use to view a long listing of files in your current directory including hidden files?

Answer: ls –al

13. Which of the following commands can be used to change your present working directory /etc/sysconfig to /home/geeko using a relative path?

Answer: cd ../../home/geeko

14. What command could you type at a command prompt to view the first 25 lines of the file /etc/hosts?

Answer: head +25 /etc/hosts

15. Which option to the tail command is useful when viewing log files, and why?

Answer: tail –f log files can be extremely long and if you need to find updated information quickly this can be a good option, as updated information comes at the end of the file saving you time.

16. Which key combination can you use to cancel your current command?

Answer: ctrl+c

17. Which command could you use to copy the directory /data/secret to the /var directory?

Answer: cp –R /data/secret /var

18. Which command can be used to remove a directory and all of the files within?

Answer: rm-r

19. Which of the following commands would you use to undelete a file that was accidentally deleted using the rm command?

Answer: None of the above, there is no undelete in Linux!
*If you are not sure before you delete files use the rm –i option,
which will ask you if you are sure you want to delete the item.

20. What command could you type at a command prompt window to create a new symbolic link called shortcut in your present working directory that points to the /etc/inittab file?

Answer: ln –s /etc/inittab shortcut

21. Which of the following statements regarding file links are true?

Answer: C. Symbolic links are given a different color in your terminal window.

22. Which command can be used to search the path variable for executable programs?

Answer: which

23. What command may be used to search the /etc directory for files that are owned by the user geeko?

Answer: find /etc/geeko

24. You are attempting to locate a new file in the file system using the locate command, however, no results are displayed. What command could you run to remedy the problem?

Answer: updatedb

25. Which command may be used to search the /etc/hosts file for lines that start with 127.0.0.1?

Answer: grep “^127.0.0.1” /etc/hosts

26. Which of the following utilities must be run in a GUI environment?

Answer: b. ark

27. What tar command could you use to create a gzip compressed archive file called /root/myfile.tar.gz that contains the entire contents of the /opt directory?

Answer: tar –czvf /root/myfile.tar.gz /opt

28. You have created a script that contains cpio commands used to create a daily back up of your system. What directory could you place this script in to allow the cron daemon to execute it each day?

Answer: /etc/cron.daily/

29. After downloading a file you notice that it has a .bz2 extension. Which command could you use to extract the contents of this file?

Answer: bunzip2 (name of the file goes here).bz2

30. Many file management commands support the –R (recursive) option. How does this option change the operation of the command?

Answer: The –R option after a command is an instruction that tells the command given to apply to all directories and or files.