Index

alias command, 57–58 Symbols alsamixer, 109–110 #! syntax, shells and, 64 AMD-V virtualization support ... (ellipses), omitted information in (svm), 298–299 code, 10 apropos command, 12–13 [ ] (brackets), testing shell scripts APT (Advanced Package Tool). See and, 65 also , managing with APT ~. (tilde and period), exiting ssh vs. aptitude, 25 sessions and, 262 basics of, 21 > (greater-than sign) commands for security, 295 appending files and, 55 apt-get command to direct output to files, 55 update command, 35, 37 . (dots), in PATH environment clean option, 29–30 variables, 65 installing packages and, 28–29 ! (exclamation points), negating KVMs and, 301 search criterion with, 85 remove option, 29 / (forward slash), IRC commands and, aptitude. See also software, managing 253 with aptitude ; (semicolons), vi and, 315 vs. APT, 25 basics of, 21 A Aptitude Survival Guide, 35 -a option, (debsums), 42 Aptitude User’s Manual, 35 adding apt-key command, 70 content to scripts, 65–68 archives. See also backups to files to archives, 160 compressed archives groups, 286 backing up with SSH, 161–162 passwords, 281 ARP (Address Resolution Protocol), software, virtualization hosts and, 301 checking, 229–230 software collections, 24–25 ASCII art, viewing movies and, 123 text, 91, 93 ASCII text, reading, 99 user accounts,COPYRIGHTED 280–281 at command, MATERIAL 186 Address Resolution Protocol (ARP), Atheros, 225 checking, 229–230 audio, 107–117 administration of remote systems. See adjusting levels, 109–110 remote systems administration encoding, 111–114 Advanced Sound Architecture files, converting, 116–117 (ALSA), 109 playing music, 107–109 Advanced Package Tool. See APT ripping CDs, 110–111 (Advanced Package Tool) streaming, 114–116 aumix audio mixing application

aumix audio mixing application, 110 brackets ([ ]), testing shell scripts authentication, public key, 264–267 and, 65 awk command, processing columns bridge-utils, adding software and, 301 and, 104 byobu command for remote shells, 270–272 bzflag, installing with APT, 27–28 B bzip2 command for compressing, backing up over networks, 161–165 157–158, 159 basics of, 161 OpenSSH, 161–162 rsync, 162–163 C unison, 164–165 –c option backing up to removable media, debsums, 42 165–170 mkswap command, 135 basics of, 165 cal command, 202–203 cdrecord command, 168–169 case command, 67 growisofs command, 170 cat command mkisofs command, 165–168 displaying file contents with, 94–95 backticks, executing command lines viewing /proc information with, with, 56 321–325 backups to compressed archives, cd commands, 77 155–160 cdparanoia tool, 110, 111 with compression tools, 157–160 cdrecord command, 168–169 tar archives, 160 CDs. See also backing up to removable with tar command, 155–157 media badblocks command, 141–142 ripping, 110–111 bash. See Bourne Again Shell (bash) chage command, 285 batch command, 186 chains, filter tables, 289 batches, converting images in, changing /proc information, 321–325 119–121 characters bcm43xx-fwcutter package, 225 in files and directories, meaning bg command, 171, 183–184 of, 73–74 binaries, finding text in, 99 shell special characters, 317–318 BIOS, enabling virtualization support translating or removing, 101 in, 299 charms, defined, 18 bits, virtualization capacity and, 300 chattr command, 81 block devices, 322 chgrp commands, 77 book contents, 1–2 chkrootkit, 295 boot images, mounting, 140 chmod command, 74–76 boot loaders, 205 chown (-R) option, 77 boot process, 205–207 chrt command, 188, 189 bouncers (IRC), 252 CIFS (Common Internet File Bourne Again Shell (bash) System), 248 Bash Guide for Beginners, 68 cleaning up bash history, 53–54 packages with APT, 29–30 Linux and, 49 packages with aptitude, 39 shell settings, 52 client for URLs application (curl special characters, 317–318 command), 241 variables, 318–320

328 dash option (-) clients connecting to Windows desktop, VNC, starting, 277 272–274 X11, tunneling for, 262 connections. See network connections clocks connectivity to hosts, checking, hardware, 203–204 228–229 system, 202–203 content, adding to scripts, 65–68 system vs. hardware, 201 control keys cloud computing, Ubuntu and, 4 for editing in JOE, 91–92 Cloud Guest, 18 for editing in nano, 93–94 columns convert command, images and, 118, processing, 104 119, 120–121 selecting and viewing column output, converting 175–177 audio files, 116–117 command line completion, 54 images, 118–121 command not found message, 9 copying commands. See also specific files, 79–80, 244–245 commands partition tables, 129 APT, 25–26 remote files, 244 bash history, 53–54 cp command, 79 for checking users, 286–288 cPanel, 280 ex commands (vi), 315–316 CPU finding, 9–11 capacity for virtualization and, 298–299 for finding files, 82–85 usage, 194, 196–198 firewalls rules, 290–291 crontab files, 186–187 FTP, for transferring files, 241–243 crontab man pages, 14 Legacy, 260–261 cryptsetup package, 143–145 Linux, 7–11 Ctrl+c, in shell windows, 50 managing VMs with, 306–309 CUPS for manipulating audio files, 107 basics of, 6 manipulating text with, 89 printing remote administration, miscellaneous vi commands, 314–315 tunneling and, 262–263 modifying with numbers (vi), 315 curl command, 241 for web browsing, 237–239 current shell, running processes away Common Internet File System from, 185 (CIFS), 248 cut command, 104 compressed archives. See backups to Cygwin, 261, 275 compressed archives compression tools, backups with, 157–160 D computers' capacity for virtualization, –D flag command, 30 298–302 -d option concatenating tar files, 160 compressing with lzop and, 160 configuration, checking (Samba), 251 deleting from ARP cache with, 230 configuring removing keys from agents with, 267 built-in firewalls, 288–289 -D option network connections from the GUI, ssh, 263 215–216 useradd command, 280, 282 SSH, 261–262 dash option (-), su command and, 62

329 date

date /proc/sys directory, 325 changing with graphical tools, 201–202 using, 71 setting with NTP, 204–205 viewing file types in, 69–70 dd command disk labels, defined, 131 copying data and, 79, 80 disk partitions erasing data with, 144 changing with fdisk command, .deb 128–129 files, extracting from, 32–33 changing with parted command, 127, files, managing at installation, 21 130–131 packages, building, 44–47 copying partition tables, 129–130 querying packages, 33–35 creating filesystems on, 132–133 Debian. See also dpkg (Debian package); writing changes to, 128 software, managing with dpkg disk space. See also Logical Volume software packages, 20–24 Manager (LVM) Ubuntu and, 2–3 determining amount of, 147–148 debsums, verifying installed packages virtualization support and, 300–301 with, 39–44 diskstats output, 322 DeCSS, 121 dmesg command, 209–210 decrypting DVDs, 121 dmidecode command, 212 deleting dots (.), in PATH environment from ARP cache, 230 variables, 65 characters, 101 downloading files from archives, 160 files from remote servers. See files, routes, 232–233 transferring text with vi, 314 lftp command for, 242 user accounts, 283 packages with APT, 30 delimiters packages without installing, 38 awk command and, 104 Ubuntu, 17–18 sed command and, 100 dpkg (Debian package). See also desktops software, managing with dpkg remote Windows desktops, 272–274 basics of, 21 sharing with VNC, 275–276 commands for software management, X desktop and applications, 274–275 29–30 -detail option, mdadm command, dpkg command, installing software 146–147 and, 22 device drivers, defined, 72 dpkg-query -l command, 96–97 device files, 69, 72 –i command, 32 df command, checking disk space with, –L option, 35 147, 301 –r option, 32 DHCP server, 215 dstat command, 197 diff command, 101–104 du command, 147–148, 286 dig command, 227–228 dumpe2fs command, 133–134 dircproxy, 252 DVDs. See also backing up to directories. See also file/directory removable media permissions, setting; remote making and burning, 170 directories, sharing starting players, 123 information from /proc directory, 321–322

330 files

-F option E mii-tool and, 220 –e option (debsums), 42 processing columns and, 104 e2label command, 131 fc command, bash history, 54 editing fdisk command bash history commands, 53 disk partitions, creating with, 150 shell scripts, 64 disk partitions, changing with, 127, text files, 90–94 128–129 editors. See text editors fg command, 171, 183–184 Edubuntu, 2 fields,/etc/fstab file, 137 egrep command, 298 file command, 69–70 elinks browsers, 237–238 file extensions ellipses (...), omitted information in mkisofs command and, 166 code, 10 tar command, 156 Emacs vs. vi (vim) text editor, 311 file/directory permissions, setting, e-mail, text-based e-mail clients, 73–78 254–257 basics of, 73–74 encoding music, 111–114 chmod command, changing permissions encrypting USB drives, 143–145 with, 74–76 encrypted filesystems, creating, ownership, changing, 76–77 143–145 umask, setting, 76 Ensim, 280 files entertainment devices (Ubuntu), 4 adding to archives, 160 environment variables, shells and, 62–63 attributes, changing, 80–81 error messages, locale, 23 audio, converting, 116–117 /etc/fstab file, 136–137 backing up with rsync, 162–163 Ethernet connections compressing, 157–160 starting and stopping, 221–223 copying, 79–80 viewing information, 223–224 creating blank, 70 ethtool (ethtool package) device files, 72 ethtool command, 216–218 differences between, checking, installing, 216 101–104 NICs and, 216–219 directories, 71 ethX interface, 225 extracting from .deb files, 32–33 ex commands (vi), 315–316 File formats and conventions (man exclamation points (!), negating search pages), 13 criterion with, 85 file/directory permissions, setting. See exec option, find command, 84–85 file/directory permissions, setting Executable programs or shell joining, 160 commands, 13 listing, 86, 160 expiration dates, user accounts, 281 regular, 69–70 exportfs command, 246 searching for, 82–85 ext4 filesystem type, 126 symbolic and hard links, 71–72 types, 69–73 F uncompressing, 157, 158 -f option verifying, 86–88 creating archives and, 156 video, 121–123 name changing and, 283

331 files, transferring

files, transferring, 239–246 finding processes with curl command, 241 with fuser command, 180–181 with FTP commands, 241–243 with pgrep command, 179–180 with SSH tools, 243–246 firestarter package, 288 wget command for downloading files, firewalls 239–241 basics of, 288 with Windows tools, 246 built-in, configuring, 288–289 filesystems iptables firewalls, 289–291 in Linux, 69, 80–81 tool, 110, 111, 113 maneuvering in, 77–78 flash drives (USB), saving private keys named pipes and sockets and, 73 to use from, 266–267 searching, 83–85 Fluendo DVD Player, 122 traversing, 77–78 folders, directories as, 71 types excluded by PRUNEFS line, 83 formats verifying parts of, 88 converting images and, 118 filesystems, administering, 125–154 converting text files and, 105 attributes, viewing and changing, File formats and conventions (man 133–135 pages), 13 basics of, 125–127 for playing music, 107 checking, 141–143 formatting filesystems, 132–133 disk space and, 147–148 free command, 192–193 encrypted, creating, 143–145 fsck command, 142 formatting, 132–133 fstab file, mounting and unmounting hard disks, partitioning, 127–131 filesystems from, 136–137 labels, 131–132 FTP commands, transferring files with, LVM basics, 149 241–243 LVM logical volumes and groups, function keys, shell windows and, removing, 153–154 270–271 LVM volume, growing, 152–153 fuser command LVM volume, shrinking, 153 checking on users and, 286 LVM volumes, creating, 150–152 finding processes with, 180–181 mounting and unmounting. See fusermount command, 252 filesystems, mounting and FWBuilder, 289 unmounting RAID disks, checking, 146–147 swap partitions, 135–136 G types of, 126–127 genisoimage command, 166 filesystems, mounting and unmounting, getty processes, virtual consoles 136–141 and, 51–52 from fstab file, 136–137 The GIMP, 119 with mount command, 138–140 GNOME with umount command, 140–141 GNOME text editor, 94 FileZilla, 246 gnome-terminal window, shells and, filter tables, 289 49–51 find command, finding files with, gparted partitioning tool, 127 83–85, 286 gpasswd command, 77 finding Grand Unified Boot Loader (GRUB), packages with APT, 27 205–207 text in binaries and strings, 99 graphical text editors, 94 332 iwconfig command graphical tools, changing time/date icecast2 package, 114 with, 201–202 identify command, 117 greater-than sign (>) ifconfig command, 221 appending files and, 55 ImageMagick package, 117 to direct output to files, 55 images grep command, 97–99 backing up, 168–169 groups, adding, 286 files creating, 306–307 growisofs command, 170 transforming, 117–121 GRUB boot loader, 205–207 info command, 15 GStreamer project, 121, 122 info documents, 15 GUIs (graphical user interfaces) init process, run levels and, 207 configuring network connections from, initialization file (bash), 52 215–216 input, directing standard to security and, 281 commands, 55 gunzip command, 157 installing gvimdiff command, 102–103 OpenSSH servers, 261 gzip command, 157, 158–159 packages with APT, 27–28 packages with aptitude, 38 packages with dpkg, 32 H software. See software, installing -h or -help arguments, 12 Ubuntu, 4, 17–20 hard disks, partitioning, 127–131 virt-manager graphical software, 301 hard links, 69, 71–72 VMs, 307–308 hardware clock, displaying and setting, Intel VT technology (vmx), 298–299 203–204 Internet, tunneling to services, 263 hardware information, 211–212 Internet Relay Chat (IRC), 252–253 hdparm command, 212 iostat command, 196–197, 199 help messages, 12 IP addresses (MAC), viewing, 223 hierarchy of processes, viewing, 174 ip commands hostname command, 228 adding and deleting routes with, hosts 232–233 connectivity to, checking, 228–229 Ethernet connections and, 223–224 scanning, 234 host connectivity and, 228 tracing routes to, 231–233 network connections and, 221 hwclock command, 203 ipcalc command, 224 iptables firewalls, 289–291 I rules, listing, 291–292 -i command (dpkg), 32 IpTables HowTo document for -i option Ubuntu, 289 checking inode utilization with, 147 IRC, chatting friends with, 252–253 ethtool command, 217–218 irssi, 252–253 funding files and, 82 ISO9660 standard grep command, 98 cdrecord command and, 168–169 sed command, 100 growisofs command and, 170 tune2fs command, 134–135 mkisofs command and, 165–168 –I option (dpkg) iwconfig command, 226 getting information about .deb files, 33 getting new package information, 46

333 JOE editor

links, symbolic and hard, 71–72 J links browsers, 237 J OE editor, 91–92 Linux joining archives, 160 basics of, 89 Joliet directory records, 166 commands, 7–11 Juju, 18 filesystems, 69. See also files Linux User’s Groups (LUGs), 6 K remote Linux desktop and applications, the kernel, 192, 209–211 274–275 kernel slab, 195 shells. See shells (shell command Kernel-based Virtual Machines (KVMs). interpreters) See VMs Ubuntu and, 2–3 key sequences for controlling Terminal Linux distributions windows, 50 based on Ubuntu, 2 keywords vs. Ubuntu, 3–5 searches for, 25 listing searches with, 37 aliases, 57–58 kill and killall commands, 171 bash history, 53 killing running processes, 184–185 environment variables, 63–64 Kubuntu, 2 files, 86 kvm-ok command, 298 files to archives, 160 KVMs. See VMs text files, 94–95 ln command, 72 locale error messages, 23 L locate command, 82–83 –l option, 33, 43, 47, 138 locking user accounts, 284 –L option logging, central, 295 dpkg, 35 Logical Volume Manager (LVM) iptables rules and, 291 basics of, 149 mkfs command, 132 logical volumes and groups, removing, to pwd and cd commands, 78 153–154 labels, filesystems, 131–132 LVM2, 149 lame tool, 110, 111, 113 volume, growing, 152–153 lazy unmounts, 141 volume, shrinking, 153 leafpad text editor, 94 volumes, creating, 149–151 legacy communications tools, 260–261 volumes, using, 151–152 less command login help messages and, 12 FTP servers, 239 paging through text and, 95–96 public key, 265–266 user privileges and, 60 public key authentication and, 264–267 lftp command remote, with SSH, 259–260. See also files, transferring with, 241–243 ssh command, remote login with remote files, copying with, 245–246 Long Term Support (LTS) releases, 3 libdvdcss decryption software, 121 loopbacks, mounting files in, 140 libdvdcss2 package, 122 ls command libvirtd, adding software and, 301 command line output and, 55–57 libvirtd group, adding accounts to, 302 file information and, 86, 109

334 navigating

finding files and, 86 memory help messages and, 12 monitoring usage, 192–196 info documents and, 15 VM support and, 300–301 locating files and, 85 mii-tool (net-tools package), NICs and, packages and, 39 216, 219–220 lsattr command, 81 mkdir command, 71 lsmod command, 210 mkfifo command, 73 lsof command, 200–201 mkfs command, 132 lspci command, 211–212 mkisofs command, 165–168 LUGs (Linux User’s Groups), 6 mknod command, 72 lurking, defined, 252 modprobe command, 211 LVM. See Logical Volume Manager (LVM) modules (OSS), 109 LVM2, 149 more command lvremove command, 153 Linux and and, 12 lvresize command, 152–153 paging through text and, 95–96 lzop command, 157–158, 159–160 mount command filesystems, mounting and unmounting with, 138–140 M virtual filesystems and, 133 -m command line option, JOE editor mounting filesystems. See filesystems, and, 93 mounting and unmounting MAC addresses, viewing, 223 moving among bash history mail command, 254–255 commands, 53 mailboxes, navigating, 256–257 MP3 format, converting to, 113–114 MAKEDEV command, 72 mpg321 command, 107, 108, 109 man pages mpg321 package, 108, 114 Linux and UNIX documentation and, 11 Mplayer movie player, 121 reference information and, 11–12 multimedia. See also audio tools for working with, 1 images, transforming, 117–121 using, 12–14 video, 121–123 managing software multiverse software, 22, 23 with APT. See software, managing music with APT encoding, 111–114 with aptitude. See software, managing playing, 107–109 with aptitude streaming, 114–116 basics of, 20 mutt command, 256–257 Debian packages, 22–23 with dpkg. See software, managing with dpkg N matchers, defined, 38 name resolution, checking, 226–228 md5sum command, 87–88 named pipes, 73 MD5SUM files, 18 naming screen sessions, 269–270 mdadm command, 146–147 nat tables, 292 media. See backing up to removable navigating media elinks browsers, 238–239 media access control (MAC) addresses, mailboxes with mutt, 256–257 viewing, 223 vi, 313

335 nedit text editor

nedit text editor, 94 , 107, 108 netstat command, 220, 233 ogg123 command, 107 network connections, 215–235 oggenc (Ogg Vorbis) tool, 110, 111–112 configuring from the GUI, 215–216 Open Source Sound System (OSS), 109 managing, 221–224 OpenSSH, backing up archives with, name resolution, 226–228 161–162 NICs, managing, 216–220 operators for test expressions, 66–67 troubleshooting. See troubleshooting ownership of files or directories, networks changing, 76–77 useful tools, 234 wireless, 225–226 network interface cards (NICs) P managing, 216–220 -P option, to pwd and cd commands, 78 settings, changing, 218–219 packet-level traffic, investigating, 234 taking offline, 222 paginating text with pr command, viewing MAC addresses, 223 96–97 network resources, accessing, paging through text, 95–96 237–258 parted command chatting, with IRC, 252–253 disk partitions, changing with, 129–130 remote directories, sharing. See remote partitioning hard disks and, 127, directories, sharing 130–131 text-based e-mail clients, 253–257 partition labels, defined, 131 transferring files. See files, transferring partitioning hard disks, 127–131 web browsing commands, 237–239 partitions, types of, 125–126 network shared filesystems, 127 password command, 283–284 Network Time Protocol (NTP), 201, passwords 204–205, 208 adding, 281 networks. See also backing up over FTP servers, 239 networks managing, 283–285 untrusted, using VNC on, 277 security and, 279–280 virtual, 302–303 pasting text (vi), 314 newgrp command, 77 path completion, with lftp NFS, remote directories, sharing with, command, 246 246–248 permissions. See file/directory nice command, 171, 182 permissions, setting NICs. See network interface cards pgrep command, 179–180 (NICs) Pico text editor, 92–94 nmap command, 234 ping command, 229, 230 nohup command, 185 pipe (|), 73 ntfsresize command, 131 pipes, stdin and stdout, redirecting NTP (Network Time Protocol), 201, and, 55–56 204–205, 208 play command for music, 107 ntpd service, 204 popd command, 78 port forwarding iptables rules and, 293 O X11, 262–263 objects on networks, defined, 224 ports, accessing SSH and, 262 od command, 105 pr command, 96–97

336 removable media

Precise Pangolin release, 3 NICs and, 220 private keys, saving, 266–267 recursive file copying and, 244 /proc filesystem, 321–325 tar archives and, 160 /proc/cpuinfo file, 198 RAID disks, checking, 146–147 processes. See running processes RAM processors memory monitoring and, 192–193 policies, 188 virtualization support and, 300–301 priority, adjusting, 182 RAR format, 158 /proc/mdstat file, 324 rdesktop command, 272, 274 procps package, 192 reconnecting to screen sessions, 269 /proc/stat file, 325 reference information (Ubuntu), 11–12 /proc/sys directory, changing values regex. See regular expressions in, 325 regular expressions PRUNEPATHS variable, 83 matching text with, 89–90 ps command searches with, 83–84 checking on users and, 286 releases of Ubuntu, 3 column output and, 175–177 reloading firewall rules, 294 viewing active processes with, remmina tool (Remmina Remote 172–174 Desktop), 272–273 viewing running processes with, 171 remote directories, sharing, 246–252 PSCP, 246 with NFS, 246–248 PSFTP, 246 with Samba, 248–251 public key authentication, ssh with sshfs, 251–252 command and, 264–267 remote Linux desktop and applications, pushd command, 78 274–275 PuTTY, 261 remote systems administration, 259–278 byobu command, 270–272 Q commands for remote shells, 267 -q option, diff command, 103 desktops, sharing with VNC, 275–276 qcow2 images, 307 legacy communications tools, 260–261 qemu, adding software and, 301 rdesktop command, 274 qemu-img command, 306–307 remmina tool, 272–273 querying remote Windows desktops and, 273 .deb packages, 33–35 screen command, 268–270 package information with aptitude, 37 SSH, configuring, 261–262 quitting vi, 311–312 SSH, login and tunneling with, 259–260 SSH, remote login with. See ssh R command, remote login with “r” commands, 260–261 VNC, using with SSH, 277 -R option VNC clients, starting, 277 changing directory attributes and, 81 VNC servers, setting up, 276 chmod command, 76 X desktop and applications, 274–275 copying directory structure and, 79 remote X applications, 274–275 –r option removable media. See backing up to diff command, 103 removable media dpkg, 32

337 removing

removing characters, 101 S –s option packages with APT, 29 aptitude, 39–40 packages with aptitude, 38 debsums, 43 packages with dpkg, 32 Samba remote directories, sharing renice command, 171, 179, 181–182 with, 248–251 replacing characters in text, 101 saving repositories, enabling for apt, 23–24 firewall rules, 294 reset command, 63 private keys, 266–267 resident size, defined, 193 scanning resize2fs command, 152, 153 for bad blocks, 141, 142 resizing images, 118, 120 hosts and networks, 234 resources, monitoring scheduling basics of, 191–192 realtime processes, 188–189 CPU usage, 196–198 running processes, 186–187 memory usage, 192–196 scp command, 244 storage devices, 198–201 screen command for remote shells resources for Ubuntu, 5–6 basics of, 267 ripping CDs, 110–111 managing with, 268–270 root users, super user power and, 59 screens, splitting, vi and, 312 rotating images, 118 Scribes text editor, 94 routes to hosts, tracing, 231–233 script-based e-mails, 254 rsync command, 162–163, 244–245 scripts, shell scripts, creating, 64–68 rules, iptables firewalls sdiff command, 102 firewall basics and, 289–291 searching listing, 291–294 for files, 82–85 setting up, 288 for keywords, 25 run levels, shell scripts, 207–209 with keywords, 37 running processes, 171–189 negating search criterion, 85 away from current shell, 185 text with grep command, 97–99 in background and foreground, Secure Shell (SSH) service. See SSH 183–184 security, 279–295 basics of, 171 advanced features, 294–295 basics of changing, 181 built-in firewall configuration, 288–289 finding withfuser command, 180–181 firewall rules, changing, 293–294 finding with pgrep command, 179–180 firewall rules, saving and reloading, 294 killing and signaling, 184–185 groups, adding, 286 processor priority, adjusting, 182 GUIs and, 281 realtime processes, scheduling, iptables firewalls, 289–291 188–189 iptables rules, listing, 291–292 scheduling, 186–187 overview, 279 viewing with ps command, 172–177 password management, 283–285 watching with top command, 177–179 Security Enhanced Linux (SELinux), running shell scripts, 64–65 294–295 rw option (NFS), 248 user accounts, adding, 280–281 user accounts, deleting, 283 user accounts, modifying, 282–283 useradd defaults, changing, 281–282

338 SSH

users, checking on, 286–288 Ubuntu, 7 users' security basics, 279–280 verifying installed with debsums, 39–44 sed command, replacing text with, for virtualization, adding, 301 99–101 software, installing SELinux feature, 294–295 apt and, 23 semicolons (;), vi and, 315 APT and, 25, 26, 27–29, 35–36 sending e-mails, 257 with aptitude, 38 servers (VNC), setting up, 276 dpkg command and, 22, 32 service command to start and stop packaging systems and, 22, 23 services, 208 repositories, enabling for apt, 23–24 set command, 63 Synaptic Package Manager, 20 sfdisk command with tasksel, 24–25 backing up partition tables with, 129 video, 122–123 viewing partitioning with, 150 software, managing with APT, 25–30 sftp command, 245–246 basics of, 25–26 sha1sum command, 87–88 packages, cleaning up, 29–30 sharing, 269 packages, downloading, 30 remote directories. See remote packages, finding, 27 directories, sharing packages, installing, 27–28 screen sessions, 270 packages, removing, 29 shells (shell command interpreters), packages, upgrading, 28–29 49–68 software, managing with aptitude, basics of, 49 35–40 environment variables, 62–63 basics of, 35–36 power, delegating with sudo command, combinations of options, 39–40 59–61 packages, cleaning up, 39 shell scripts, creating, 64–68 packages, installing, 38 su command, 61–62 packages, removing, 38 super user power, 58–59 packages, upgrading, 37 Terminal windows for accessing. See software, managing with dpkg, 30–35 Terminal windows, shell access and basics of, 30–31 Shorewall, 289 files, extracting from .deb files, 32–33 showmount command, 246, 247 packages, installing, 32 signaling running processes, 184–185 packages, removing, 32 slab memory cache information, 195 querying .deb packages, 33–35 slabtop command, 192, 195–196 sort command, 99 smbpasswd command, 249 Source Network Address Translation SNAT (Source Network Address (SNAT), 293 Translation), 293 sox package, 107, 108, 116–117 sockets, 73 spell command, 93 SOCKS proxy feature, 263–264 Splunk, 295 soft links, 69, 71–72 SSH software basics of, 259, 261 .deb, building, 44–47 configuring, 261–262 Debian software packages, 20–24 files, transferring with, 243–246 decryption software, 121 remote login with, 259–260. See also management of, 4 ssh command, remote login with managing with aptitude, 35–36 using as SOCKS proxy, 263–264 querying package information, 37 using VNC with, 277 339 ssh command

ssh command, remote login with sysctl command, 211 public key authentication and, 264–267 sysstat package, 192 SSH, accessing on different ports, 262 system clock, displaying and setting, SSH as SOCKS proxies, 263–264 202–203 tunneling with SSH, 262–263 System Use Sharing Protocol (SUSP) ssh-copy-id command, 265 extensions, 166 sshfs, remote directories, sharing with, 251–252 standard loop constructs, shell scripts T and, 68 -t option starting archive contents and, 160 DVD players, 123 command line output and, 56–57 Ethernet connections, 221–223 filesystems, creating and, 132 realtime processes, 189 mount command, 138 services, 208 -T option, filesystems and, 147 vi, 311–312 tables, partition, copying with sfdisk virt-manager, 302 command, 129 VMs, 305–306, 308–309 tail command, 95 VNC clients, 277 tape archiver. See tar command startup tar command file (bash), 52 creating backup archives with, levels, 207–209 155–157 stdin and stdout, redirecting, 54–57 deleting files from archives, 160 sticky programs, 76 file extensions, 156 stopping listing, joining, adding files to Ethernet connections, 221–223 archives, 160 iptables rules, 292 tasksel, software collections, adding Linux, 208–209 with, 24–25 services, 208 tcpdump command, 234 VMs, 305–306, 308–309 telnet command, 260–261 storage Terminal windows, shell access creating with qemu-img command, and, 49–58 306–307 alias command, 57–58 devices, monitoring, 198–201 bash history, 53–54 VMs and, 303 basics of, 49 streaming music, 114–116 command line completion, 54 strings, finding text in, 99 shells, using and, 52–53 su command, 61–62 stdin and stdout, redirecting, 55–57 sudo command, 59–61 using, 49–51 super user power, shells and, 58–59 virtual consoles, 51–52 SUSP extensions, 166 watch command, 58 svm (A MD-V virtualization support), testing shell scripts, 65–67 298–299 testparm command, 251 swap partitions, 135–136 text, manipulating, 89–105 swapfs command, 133 basics of, 89 SWAT tool, 248 changing with vi, 314 symbolic links, 71–72 characters, translating or removing, 101 Synaptic Package Manager, 21 columns, processing, 104

340 universe software

deleting with vi, 314 Totem player, 121 differences between files, checking, tr command, 101 101–104 traceroute and tracepath commands, editing, 90–94 231–232 formats, converting, 105 tracing routes to hosts, 231–233 listing text files, 94–95 transferring files. See files, transferring paginating, 96–97 translating characters, 101 paging through, 95–96 tripwire package, 295 regular expressions and, 89–90 troubleshooting networks, 228–233 replacing, 99–101 ARP, checking, 229–230 searches, 97–99 connections, 216 text editors. See also vi (vim) text editor connectivity to hosts, checking, graphical, 94 228–229 JOE editor, 91–92 netstat connections and statistics, leafpad, 94 displaying, 233 Linux, 89 tracing routes to hosts, 231–233 nedit, 94 tsclient, 272 Pico and nano, 92–94 tty1 through tty6, 51 scribes, 94 tune2fs command, 133–135 Vim (Vi IMproved) editor, 311 tunneling text-based e-mail clients, 254–257 to Internet services, 263 thumbnails, creating, 118–119 remote, with SSH, 259–260, 262–263 time -type d option, finding directories basics of, 201 with, 84 changing, 201–202 hardware clock, 203–204 intervals, filesystem checks based U on, 134 Ubiquity, 17 setting with NTP, 204–205 Ubuntu basics system clock, 202–203 Debian and, 2–3 timestamps, finding files and, 84 help messages, 12 tools info database, 15 bcm43xx-fwcutter package, 225 installing, 17–20 for installing software, 7 Linux and, 2–3 legacy communications tools, 260–261 Linux commands, 7–11 for name resolution, 226–228 man pages, 11, 12–14 network connections, 234 vs. other Linux distributions, 3–5 for ripping CDs, 110 reference information, 11–12 SSH, 259 resources, 5–6 UNIX remote, 259–260 software, 7 VNC, 259 Ubuntu releases, 3 wireless-tools, 225 Ubuntu Linux Toolbox, Second Edition, 1 top command umask, setting, 76 checking on users and, 286 umount command, 140–141 memory usage and, 193 uncompressing files, 157, 158, 159 processing time and, 197–198 unified format, 102 viewing running processes with, 171 unison, backing up with, 164–165 watching active processes with, Unity desktop, 4 177–179 universe software, 22, 23 341 UNIX remote tools

UNIX remote tools, 259–260 ex commands, 315–316 unlocked keys, 266–267 miscellaneous commands, 314–315 unlocking user accounts, 284–285 moving around in, 313 unmounting starting and quitting, 311–312 directories of documents, 252 text, changing and deleting in, 314 filesystems, 140–141 visual mode, 316 update-rc.d command, 208 video files, 121–123 upgrading viewing packages with APT, 28–29 /proc information, 321–325 packages with aptitude, 37 running processes, 172–177 uploading, lftp command for, 243 Vim (Vi IMproved) editor. See also vi USB drives (vim) text editor encrypting, 143–145 features not in vi, 311 saving private keys to use from, vimdiff command, 102 266–267 virsh command, 306, 308–309 useradd command virt-install command, 306–308 accounts, adding, 280 virt-manager, 302–306 defaults, changing, 281–282 virtual consoles, 51–52 userdel command, 283 virtual filesystems, creating, 132–133 usermod command, 282 virtual machines (VMs) users creating in virt-manager, 304–305 account expiration dates, 281 managing with commands, 306–309 accounts, adding, 280–281 virtualization hosts and, 297 accounts, deleting, 283 Virtual Network Computing (VNC) accounts, modifying, 282–283 basics of, 259 checking for security, 286–288 clients, starting, 277 desktops, sharing with, 275–276 servers, setting up, 276 V using with SSH, 277 –v and –vv options virtualization hosts, 297–309 aptitude, 39–40 commands for managing VMs, mii-tool, 219–220 306–309 variables computers' capacity for, 298–302 environment variables, 62–63 reasons for, 297–298 shell, 318–320 software, adding, 301 verifying user accounts, adding, 302 files, 86–88 virt-manager, 302–306 installed packages with debsums, 39–44 VMs and, 297 versions of Ubuntu, 3 visual mode (vi), 316 vgremove command, 154 VLC media player, 122 vi (vim) text editor. See also Vim (Vi VMs. See virtual machines (VMs) IMproved) editor vmstat command advantages of, 311 monitoring CPU usage and, 196 basics of, 90–91 monitoring memory usage and, 192, commands with numbers, 194–195 modifying, 315 monitoring storage devices and, vs. Emacs, 311 199–200

342 –y option

VNC. See Virtual Network nfs ssh, 248 Computing (VNC) PuTTY, 261 volume. See also Logical Volume SELinux feature, 295 Manager (LVM) SWAT tool, 248 volume ID (images), 167 Ubuntu packages, 7 Ubuntu releases, 3 Ubuntu resources, 5–6 W Webmin, 280 watch command, 58 wget command, 239–241 WAV files whatis command, 14 converting audio files and, 116–117 whereis command, 85 encoding music and, 112, 113 which command, 85 ripping CDs and, 110 Windows file transfer tools, 246 wc command, 98 Windows Remote Desktop, 272–274 web automation GUIs, 280 WinSCP, 246 web browsing commands, 237–239 wireless connections Webmin, 280 managing, 225–226 websites for downloading using, 225–226 chkrootkit, 295 wireshark, 234 Debian Tutorial, 21 wlanX interface, 225 MD5SUM files, 18 wodim command, 168 tools for wireless connections, 225 Ubuntu, 17 Windows file transfer tools, 246 X websites for further information X desktop and applications, 274–275 Bash Guide for Beginners, 68 X Window System (X), remote package, 166 machines and, 274 cPanel, 280 X11 port forwarding (Tunneling), 261, curses interface of aptitude, 35 262–263 Debian, 2 xargs command, 84–85 DVDs, playing, 122 xchat utility, 252 Ensim, 280 -xdev option, 85 Fluendo DVD Player, 122 xhost command, 274–275 GNU General Public License, 2 project, 122 GStreamer project, 122 Xubuntu, 2 iptables facility, 288 Long Term Support (LTS) releases, 3 LVM HOWTO, 154 Y –y option, aptitude, 40

343