LPI Question Set Flashcards

1
Q

What can be used to link together multiple programs so that the output of one program becomes the input of another?

A

Pipes enable you to link together multiple programs. At the command line, the pipe character is a vertical bar

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What command will show you the path of the directory you’re currently working in?

A

The pwd command will show you the path of the directory you’re currently in.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

You type ps ax | grep xterm. What is the purpose of the grep xterm portion of this command?

A

It searches the output for the string xterm. The grep command searches for patterns in input files (the output of the ps ax command, given the pipe in the original command).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can you display all the environment variables that are currently set in your login shell?

A

Type env

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do man pages and info pages differ?

A

man pages are “flat” documents—that is, single files. By contrast, info pages use hypertext (similar to Web pages) to help organize documents.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the uniq command do?

A

By default, it outputs a file without any duplicate lines from the input file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the fmt command do?

A

It reformats the paragraphs within a file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

You type the command testprog < somefile.txt. What is the effect of the less-than (<) character in this command?

A

This is an input redirection operator; it causes the contents of somefile.txt to be sent to testprog as if the contents of somefile.txt were typed at the console.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How would you read a Linux manual page?

A

Type man topic, where topic is the name of the command, configuration file, or other topic you want to investigate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the function of the tail command?

A

It displays the last few lines (10 by default) of a file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the difference between grep and egrep?

A

The grep program uses basic regular expressions by default, but egrep uses extended regular expressions by default.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What command would you use to combine two text files, each of which contains tab-delimited data with at least one field in common between the two files?

A

The join command performs this task.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do the exit and logout commands differ?

A

The logout command works with login shells only, whereas exit is intended for use with non-login shells (such as xterm windows), but in practice works with both login and non-login shells.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

A text file contains tabs that are expanding into the wrong number of spaces in your chosen text editor. What command can you use to process the text file to substitute multiple spaces for each tab?

A

The expand command does this job.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

As root, you type tail -f /var/log/messages. What will be the result of this command?

A

The command displays the last few lines of /var/log/messages and then continues to monitor the file and display new lines as they’re added to it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

As root, you type renice 19 2548. What is the effect of this command?

A

The priority of the process with a process ID (PID) number 2548, if it’s present, is changed to 19—that is, the process’s priority is set to the lowest possible value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the purpose of the nice command?

A

It allows you to run a program with a specified priority.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What does the output of the uptime utility show?

A

The output of the uptime utility shows the time the system has been running, as well as three load averages (for the past minute, the past 5 minutes, and the past 15 minutes).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are the advantages of shared (aka dynamic) libraries over static libraries?

A

Shared libraries save disk space and memory, at least when they’re used by multiple programs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What can you learn from the uname utility?

A

You can learn the kernel name, the network hostname, the kernel release, the kernel version number, the machine name, the processor type, the hardware platform, and the OS name.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What are some common solutions to the problem of an unsatisfied dependency when installing a program package?

A

You can force the installation, install/upgrade the required package, install a different version of the target package, or rebuild the target package from source code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How can you identify processes that consume an inordinate amount of CPU time?

A

You can use either the top utility or the ps utility with appropriate switches.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Sally types rpm -e badprogram as root. What is the effect of this command, if the system uses RPM?

A

The badprogram package, if it’s installed and not depended on by other programs, is uninstalled from the system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the function of the top program?

A

top displays an ordered process list, updating it frequently. By default, top orders processes by CPU use, but you can give it commands to order processes by other criteria.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Which common package management systems include support for dependency tracking?

A

The Red Hat Package Manager (RPM) and Debian package systems include such support.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What file holds information about the library path the system uses in human-readable form?

A

The /etc/ld.so.conf file includes this information.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What tool does Debian provide that can be used to keep your system automatically up to date with the latest system updates?

A

You can use the Advanced Package Tools (APT), and particularly apt-get, dselect, and aptitude.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What happens when you try to run a program that requires a library that’s not installed?

A

The program responds with a message saying that it couldn’t find a library file. (The message may not be visible if the program is launched in a GUI environment.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

How do you tell kill what process you want to terminate?

A

Pass kill the target process’s process ID (PID) number.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

You want to upgrade the bigserver package on an RPM-based system with a new file called bigserver-4.2.3-3.i386.rpm. What should you type?

A

Type rpm -Uvh bigserver-4.2.3-3.i386.rpm. The v and h options may be omitted if you don’t want a progress display.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

You want to kill a process by name. What command can you use to do this?

A

Type killall processname. Alternatively, you can use ps to find the process ID (PID) of the process and use kill.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

What tools are most commonly used to install or remove Debian packages?

A

The most commonly used tools are dselect, dpkg, apt-get, and GUI front ends to these.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

Why might you not want to edit /boot/grub/grub.cfg directly to change your boot loader configuration?

A

The /boot/grub/grub.cfg file is a GRUB 2 configuration file. GRUB 2 encourages editing files in the /etc/grub.d directory and the /etc/default/grub file and then using scripts to regenerate /boot/grub/grub.cfg.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

In Linux’s fdisk, you want to create a new partition. What major fdisk command do you use?

A

Typing n creates a new partition in fdisk.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

What programs does Linux use to write to optical media?

A

The mkisofs program creates an ISO-9660 filesystem, which is then burned to the disc by cdrecord. The growisofs program combines these two functions for recordable DVDs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

What command is used to create a filesystem?

A

The mkfs command is used to create a filesystem. This command actually calls filesystem-specific creation tools like mkfs.ext2 (aka mke2fs), which you can call directly if you prefer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

What software component determines whether Linux supports a given SCSI host adapter?

A

The Linux kernel determines this.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

What is the physical location of the first code an x86 CPU executes when it starts up?

A

This code is located in the firmware (BIOS or EFI), which is stored on a chip on the motherboard.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

What GRUB Legacy and GRUB 2 command is used to pass control to another boot loader?

A

The chainloader command, which passes control to the partition specified by a preceding root or rootnoverify command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

On what MBR partition type(s) (primary, extended, or logical) may the Linux root ( / ) partition reside?

A

The Linux root partition may reside on a primary or logical partition. Extended partitions are “placeholders” for one or more logical partitions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

Where do programs installed from source code normally reside?

A

They reside on /usr/local.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

In what two forms does Linux swap space generally come?

A

It may come as a dedicated swap partition or a swap file within a regular filesystem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

What GRUB command specifies a background image file to be displayed at boot time?

A

The splashimage command does this job.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

Where can the GRUB boot loader code be installed on a BIOS-based computer?

A

The GRUB boot loader can be installed on the hard disk’s MBR, a Linux partition’s boot sector, or a floppy disk’s boot sector. This code relies on files in the /boot partition as well.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

What command would you use to obtain information on PCI devices installed in your system?

A

You’d use the lspci command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

Your computer has a large hard disk, and you can’t allow extended downtime doing filesystem checks after a power failure. How can you avoid this?

A

Use a journaling filesystem, such as ReiserFS, ext3fs, ext4fs, XFS, JFS, or Btrfs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

What devices must be terminated in a SCSI chain?

A

The devices at the ends of the chain must be terminated. (One of these may be the SCSI host adapter.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

Where should you install GRUB on a BIOS-based computer if you want to be able to restore its functionality using DOS’s FDISK after installing DOS or Windows?

A

Install GRUB on a primary Linux partition’s boot sector (not the disk’s MBR).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

What does the modprobe command do?

A

It loads or removes one or more modules, including the module you specify and any on which it depends.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q

What is the function of the sticky bit?

A

It’s set on directories to alter Linux’s normal file deletion rules. With the sticky bit set, only the file’s owner may delete the files in a directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
Q

What command will show you the numeric value currently being subtracted from the default permissions of newly created files and directories?

A

The umask command will show you the numeric value currently being subtracted from the default permissions of newly created files and directories.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
52
Q

What utility can be used to locate files in common binary, documentation, and configuration directories?

A

The whereis utility locates files in common binary, documentation, and configuration directories.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
53
Q

What utility allows you to edit disk quota information?

A

The edquota utility allows you to edit disk quota information.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
54
Q

What character does Linux use to symbolize the root directory?

A

The root directory is Linux is represented by /.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
55
Q

What text-mode programs might you use to edit the partitions on an MBR disk?

A

fdisk or parted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
56
Q

What command would you type at a shell prompt to view the contents of the /usr/local/bin directory?

A

Type ls /usr/local/bin.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
57
Q

Where do most system configuration files normally reside?

A

Most system configuration files reside in /etc or its subdirectories.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
58
Q

What is the difference between a hard link and a symbolic link?

A

A hard link is two or more filenames that point to the same inode and hence the same file. A symbolic link is a file that points to another file by name; accessing the symbolic link accesses the linked-to file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
59
Q

An administrator wants to delete /home/baduser but mistakenly types rm -r /home /baduser as root (note the extra space). What will be the consequence?

A

This command recursively deletes all the files in the /home and /baduser directories, effectively destroying all user’s files (assuming they’re all in /home, as is common).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
60
Q

What does the mv command accomplish?

A

It moves or renames a file or directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
61
Q

Who may change the owner of a file?

A

root may change the owner of a file.

62
Q

Why are SUID root programs rare?

A

They’re a potential security risk because too-powerful programs or bugs could allow unscrupulous users to abuse the program.

63
Q

What does the cp command accomplish?

A

It copies one or more files.

64
Q

The user sneaky types chown sneaky sensitive.txt. What is the effect?

A

An error message results. Only root may use chown to change the ownership of a file.

65
Q

Broadly speaking, how do tar and dd differ?

A

The tar program archives files on a file-by-file basis. The dd program, by contrast, copies all of a file’s or partition’s contents, or at best provides crude controls over what may be copied.

66
Q

Where would you expect to find the executable file jed, a common Linux text-mode file editor that anybody may use?

A

As a common Linux program provided with many Linux distributions, the jed executable file is most often found in /usr/bin. This is the directory set aside in the FHS for such programs.

67
Q

Where on a hard disk does the BIOS look for code to continue the boot process after the BIOS has initialized the hardware?

A

The Master Boot Record (MBR), which is the first sector on the hard disk.

68
Q

What is the name of the GRUB Legacy configuration file?

A

grub.conf or menu.lst, either file in the /boot/grub directory. (On EFI-based systems, this file resides in the same directory as the grub.efi boot loader program.)

69
Q

What methods are most commonly used to shut down a Linux system?

A

The shutdown command at a command prompt or a shutdown option at a GUI login prompt is most commonly used to shut down a Linux system. The telinit (or init, poweroff, and halt commands can also be used to do this.

70
Q

How can you keep users informed about problems and likely uptimes when you need to shut down a computer on short notice (say, 10 minutes)?

A

Pass a warning message at the end of a shutdown command, as in shutdown -h +10 “computer needs new disk; up in an hour”.

71
Q

What modes does the Vi editor support, and what are they for?

A

The Vi editor supports command mode (to enter internal Vi commands), ex mode (to enter external and file-related commands), and insert (aka edit) mode (to edit text).

72
Q

What file directs the Linux boot process after the kernel has loaded on a SysV-based installation?

A

The boot process is directed by /etc/inittab on a SysV-based computer.

73
Q

What command can you use after Linux has booted to examine the kernel ring buffer?

A

Use the dmesg command after Linux has booted to examine the kernel ring buffer.

74
Q

What command reveals the computer’s current runlevel?

A

The runlevel command reveals the computer’s current runlevel.

75
Q

What runlevel is the standard one for a normally running Linux system?

A

There is no fully standard runlevel; however, runlevel 2 is common on Debian and derivative distributions, and runlevels 3 and 5 are common on Red Hat and related distributions.

76
Q

How would you write a file and exit from the Vi editor?

A

In command mode, type :wq. (The ZZ command is also equivalent to:wq.)

77
Q

After editing your GRUB Legacy configuration file, what command should you type to ensure your changes take effect?

A

None; GRUB Legacy reads its configuration file at boot time, so you don’t need to re-install it after editing the configuration file the way you must re-install LILO.

78
Q

How can you undo a change in Vi?

A

In command mode, type u.

79
Q

What option must you ensure is set in /etc/ssh/sshd config to enable X tunneling in SSH?

A

You must ensure the X11Forwarding yes option is set.

80
Q

What program does Linux use to convert PostScript into formats suitable for a wide range of non-PostScript printers?

A

Linux uses Ghostscript for this purpose.

81
Q

Describe the role of a filter in a Linux printing system.

A

A filter identifies the file type (plan text, PostScript, and so on) and passes the file through appropriate programs to convert it into something the printer can understand.

82
Q

What command-line program displays information about the jobs in a print queue?

A

The lpq program displays information about the jobs in a print queue.

83
Q

What does the mpage utility do?

A

It prints several input pages on one output PostScript page to save paper when printing files.

84
Q

When is it most appropriate to set the system clock to Coordinated Universal Time (UTC, aka GMT, Greenwich Mean Time)?

A

This is most appropriate when Linux is the only OS installed on the computer. Microsoft OSs assume the hardware clock is set to local time, but Linux can cope with local time or UTC.

85
Q

What types of network printers can you use via CUPS?

A

CUPS can print to printers using the Internet Printing Protocol (IPP), which CUPS uses natively; to systems using the BSD Line Printer Daemon (LPD) printing protocol; and to printers using the Server Message Block/Common Internet Filesystem (SMB/CIFS) protocol used by Windows and Samba.

86
Q

What command is used to submit a print job in Linux?

A

The lpr command is used to submit a print job in Linux.

87
Q

What command can you use to quickly test a new X configuration after performing a reconfiguration in text mode?

A

You can use the startx command to do this.

88
Q

Name several major XDMCP servers for Linux.

A

XDM, KDM, and GDM are some major XDMCP servers for Linux. These servers manage the Linux GUI login screen and can be configured to support network logins as well.

89
Q

What command removes a print job from a print queue?

A

The lprm command removes a print job from a print queue.

90
Q

How do you specify the printer to which you want to print with lpr?

A

You use the -P option, as in lpr -Plexmark test.ps, to print test.ps to the lexmark printer.

91
Q

What three factors does X use to compute the refresh rate you’ll see?

A

X uses the monitor’s maximum horizontal refresh rate, the monitor’s maximum vertical refresh rate, and the resolution to compute the refresh rate.

92
Q

How do you change the locale for a limited purpose (to run a single program, for instance)?

A

Set the LC ALL environment variable to the desired locale. For completeness, you should also set LANG.

93
Q

How can you set the master font for all X-based programs to a larger size?

A

You can’t. Although GNOME and KDE both provide means to set default fonts, not all applications honor these settings.

94
Q

You want to ensure that your computer’s clock is set to the correct time at all times. What software should you run?

A

The Network Time Protocol (NTP) will keep your computer’s clock synchronized with an accurate external source.

95
Q

The root user types passwd sandra. Assuming that the user sandra exists, what information will root then have to enter?

A

root must then enter a new password for sandra twice to be sure it was entered correctly. The root user does not need to enter the current password.

96
Q

How can you locate stray files belonging to a user when deleting that user’s account?

A

Use the find command with its -uid parameter, as in find / -uid 504, to find all files owned by the user whose UID is 504.

97
Q

Where do network servers typically record error messages?

A

Network servers typically record error messages in a log file, such as /var/log/messages, or a server-specific log file.

98
Q

What user ID (UID) numbers do ordinary user accounts use?

A

Depending on the distribution, ordinary user accounts receive UIDs starting at 100, 500, 1000, or higher.

99
Q

What is the importance of the /etc/skel directory?

A

It holds template configuration files that are copied to new users’ home directories when those directories are created.

100
Q

In what file is group membership recorded?

A

Group membership is recorded in the /etc/group file.

101
Q

How do you create a user cron job?

A

Use the crontab program.

102
Q

What are the most important general-purpose log files on most Linux system

A

/var/log/messages, /var/log/syslog, and /var/log/secure are the most important general-purpose log files on most Linux systems. (Not all distributions use all three of these, though.)

103
Q

What types of errors will leave traces in system log files?

A

Errors related to programs that log errors in system log files, such as many servers, the kernel (and hence some hardware problems), and user login processes, leave traces in system log files.

104
Q

How would you delete a user account (jlumic) without deleting the user’s files?

A

Type userdel jlumic; without the -r option, userdel doesn’t delete user files. Alternatively, you could edit /etc/passwd and /etc/shadow and delete jlumic ‘s lines in those files.

105
Q

How can you prevent a single user from using the cron utility?

A

Add that user’s name to /etc/cron.deny. That user will then be unable to create cron jobs, but other users will still be able to do so.

106
Q

What is the NTP server pool?

A

The NTP server pool is a collection of publicly accessible NTP servers that may be accessed via the pool.ntp.org domain name or numbered machines within that domain, such as 0.pool.ntp.org.

107
Q

What does klogd do?

A

It intercepts and logs kernel messages via the overall system log daemon.

108
Q

What utility can you use to send a single packet to a target system, which should reply, confirming the existence of a basic network connection?

A

The ping utility sends a single packet to a target system and can be used to confirm the existence of a basic network connection.

109
Q

If you’re using static routing, what command can you use to add an entry to the routing table?

A

The route add command is used to add an entry to the routing table.

110
Q

What program can help identify slow or unreliable routers between you and a target system on the Internet?

A

The traceroute or tracepath program can help identify slow or unreliable routers between you and a target system.

111
Q

What system associates IP addresses with hostnames?

A

The Domain Name System (DNS), which is a distributed set of name server computers, associates IP addresses with hostnames

112
Q

What’s the most common type of local wired network hardware today?

A

Ethernet is most common type of local wired network hardware.

113
Q

What is PPPoE?

A

PPPoE is a variant of the Point-to-Point Protocol (PPP) that’s used over Ethernet connections. It’s most often used in conjunction with digital subscriber line (DSL) Internet connections.

114
Q

When you configure a system to use a static IP address, what information do you enter manually?

A

You enter the IP address, the netmask (aka the network mask or subnet mask), the IP addresses of one to three DNS servers, and the gateway (router) address. The last two items are technically optional, but they’re usually a practical necessity.

115
Q

Name a common Linux Web server package.

A

Apache, Roxen, and thttpd are all Linux Web servers. (Of these, Apache is the most common.)

116
Q

What will happen if you enter the incorrect gateway (router) address when you’re configuring networking?

A

You’ll be able to access systems on your local network, but you won’t be able to access systems on other networks or the Internet.

117
Q

What conditions must be met to use DHCP?

A

Your network must include a DHCP server, and your computer must have appropriate hardware to connect to the network.

118
Q

You type ifconfig on a Linux system and see a report that includes the abbreviation wlan0, but you don’t see the abbreviation eth0 anywhere. What can you conclude about this system’s network interface(s)?

A

The system has a wireless network device that’s active, but there’s either no Ethernet device installed or it’s not currently active.

119
Q

A computer has a server running on port 53. Assuming a standard use of this port, what type of server is this?

A

It’s a Domain Name System (DNS) server, such as the Berkeley Internet Name Domain (BIND).

120
Q

What is a major advantage of UDP over TCP?

A

The User Datagram Protocol (UDP) is a simpler protocol than the Transmission Control Protocol (TCP). Because of this simplicity, UDP requires less overhead than TCP, which can result in better speed when simple transfers are involved.

121
Q

What tool can link computers on a private IPv4 network address space to the Internet?

A

Network Address Translation (NAT), aka IP masquerading, can do this. NAT is often implemented in broadband routers intended for homes and small offices. Proxy servers can function in a similar way.

122
Q

Why should you not run a Telnet server?

A

Telnet is an insecure login protocol that provides no encryption, which means that passwords and other data sent via Telnet are easily intercepted should a local network or intervening router be compromised.

123
Q

What file would you edit to have mail addressed to postmaster delivered to you?

A

You would edit the aliases file, which is usually located in /etc or /etc/mail.

124
Q

What is accomplished by the command chmod a+x scriptfile?

A

The command adds execute permissions for the owner, group, and world to scriptfile —the file is made executable.

125
Q

In what files can you set global bash options (that is, for all users)?

A

/etc/bashrc, /etc/bash.bashrc, /etc/profile, and files in /etc/profile.d are the most common locations.

126
Q

What symbol identifies variables when they’re used (but not when they’re assigned values) in a bash shell script?

A

$ (preceding the variable name) identifies variables when they’re used in a bash shell script.

127
Q

What does the TERM environment variable control?

A

TERM determines the types of codes sent to a terminal (either a local or remote login) to control such features as bold text, colors, and cursor positioning.

128
Q

What is the difference between a SQL database and a SQL table?

A

A database consists of one or more tables; each table holds a two-dimensional array of data.

129
Q

bash script includes an if clause. How is this clause terminated?

A

An if clause in bash is terminated by a line consisting of the keyword fi (if spelled backward).

130
Q

How can you check to see whether an SMTP email server has delivered a message you’ve just sent?

A

Type mailq to view the contents of the mail queue and see whether the message in question is still queued.

131
Q

What is the purpose of the newaliases command?

A

It forces certain mail servers to parse the text-mode /etc/aliases file into a binary form that the mail server uses in practice.

132
Q

How do you set an alias in bash?

A

The format is alias=’ commands ‘, where commands are the commands you want to alias. Such lines typically appear in bash startup scripts.

133
Q

What is the purpose of the while statement in a bash script?

A

The while statement begins a loop that continues for as long as its condition (enclosed in square braces, []) remains true.

134
Q

What SQL command would you use to delete an individual item from a table?

A

The DELETE command deletes an individual item from a table.

135
Q

How can you check your account for new email using the mail command?

A

Type mail with no options. (You can optionally add -u user to check user’s mail or use -f file to read the contents of a specific mail spool, assuming you have sufficient permissions.)

136
Q

How do the ∼/.profile and ∼/.bashrc files differ in purpose?

A

The ∼/.profile file is a bash login file; it’s executed only at login shells. The ∼/.bashrc file, by contrast, is a non-login file; it’s executed whenever bash is run, including when logging in or when bash is run in an xterm or for other reasons.

137
Q

How are functions identified in bash?

A

Function names end in parentheses, as in myfunction(), and they’re optionally preceded by the keyword function. Their bodies are surrounded by curly braces ({}). When called, all of these identifiers are omitted, and functions look like ordinary internal or external commands, as in myfunction.

138
Q

What option must you ensure is set in /etc/ssh/sshd config to enable X tunneling in SSH?

A

Be sure X11Forwarding yes is set.

139
Q

You’ve installed a server that includes a configuration file in /etc/xinetd.d and restarted the xinetd server, but the server you’ve just installed isn’t responding. What should you check first?

A

Look for a disable = yes line in the /etc/xinetd.d configuration file for the new server. If it’s present, remove it or change it to disable = no; then restart xinetd.

140
Q

What command can be used to execute a single program with alternative permission?

A

The sudo command can be used to execute a single program with alternative permission.

141
Q

What is the purpose of the /etc/nologin file?

A

If present, this file prevents logins via most text-mode methods, except by root. Most servers and login tools display the contents of the /etc/nologin file instead.

142
Q

What types of manipulations can you perform on a password base to make it more secure?

A

You can insert random numbers and letters into the base, vary the case of the base, reverse the order of the base or one of its component words, and add characters (even a repeating character) to make a longer password.

143
Q

What does the /etc/inetd.conf file control?

A

/etc/inetd.conf controls the inetd server, which launches other servers only when those servers are needed.

144
Q

When should you use shadow passwords?

A

You should almost always use shadow passwords; they substantially improve local security.

145
Q

What advantage does using SSH have over using Telnet for initiating a remote X session?

A

SSH can tunnel the X session, thus applying encryption to all X data, including the initial username and password and all data sent via X protocols. Telnet can’t do this.

146
Q

What type of software can block access to any or all network ports on a computer?

A

A firewall (typically implemented in Linux with iptables) can block access to any or all network ports on a computer.

147
Q

Describe the most important difference between inetd and xinetd.

A

The xinetd program includes security features that aren’t present in inetd; with inetd, TCP Wrappers must be used to achieve similar effects. There are also configuration file format differences.

148
Q

How should you treat the security of public versus private keys in GPG encryption?

A

GPG public keys are meant to be distributed widely, so you can give them to anybody. GPG private keys, on the other hand, should be carefully guarded to prevent others from impersonating you.

149
Q

You use Nmap to scan a computer on your local network for open ports and find none; yet you can log into that computer using SSH from a third computer. How do you explain this?

A

One of Nmap’s limitations is that it can only tell you what ports are open to the scanning system. Firewall rules, xinetd restrictions, and similar configurations can block ports from one computer but not from another one.

150
Q

What utility uses the /etc/hosts.allow and /etc/hosts.deny files?

A

TCP Wrappers uses thes files for access control. Typically, inetd is the main user of TCP Wrappers, but other servers may use its services independent of inetd.

151
Q

What utility manages SSH logins, enabling you to enter a single passphrase instead of typing a password or passphrase for each SSH connection?

A

The ssh-agent utility manages SSH logins.

152
Q

What file holds information about servers known to SSH for all users on a computer?

A

The ssh known hosts file, which is typically stored in /etc or /etc/ssh, holds information about servers known to SSH for all users on a computer.