Download Linux Timesaving Techniques for Dummies (ISBN - 0764571737) PDF

TitleLinux Timesaving Techniques for Dummies (ISBN - 0764571737)
TagsFor Dummies
File Size11.8 MB
Total Pages514
Table of Contents
                            Linux Timesaving Techniques For Dummies
	About the Authors
	Authors’ Acknowledgments
	Contents at a Glance
	Table of Contents
		Saving Time with This Book
		What’s in This Book
		Foolish Assumptions
		Icons Used in This Book
	Part I: Making the Desktop Work for You
		Technique 1: Finding the Power in KDE Protocols
			Discovering Your Protocols
			Working with CD Audio Tracks Using audiocd:
			Managing Snapshots with the camera: Protocol
			Remote File Management with fish:
			Getting Help with help:, info:, and man:
			Viewing Your Local Network with the smb: Protocol
			Other KDE Protocols
		Technique 2: Getting GNOME Virtual File Systems to Do the Work for You
			Using GNOME VFS Modules
			Stacking VFS Modules
			Working with Packages: rpm and rpms
			Putting VFS to Work at the Command Line
			Burning CDs with a VFS
			Skinning Your Desktop with VFS
		Technique 3: Streamlining Your Work with File Associations
			Classifying Data with MIME
			Creating KDE File Associations
			Creating New MIME Types with GNOME
		Technique 4: Prompting Yourself with a Custom Prompt
			Making Basic Prompt Transformations
			Adding Dynamically Updated Data to Your Prompt
			Colorizing Your Prompt
			Seeing a Red Alert When You Have Superuser Privileges
			Saving Your Work
		Technique 5: Getting There Quick with Dynamic Shortcuts
			Completing Names Automatically
			Using the Escape Key to Your Advantage
			Customizing Completion for Maximum Speed
		Technique 6: Using cd Shortcuts for Rapid Transit
			Using cd and ls to Navigate through bash
			Setting Your CDPATH Variables to Find Directories Fast
			Remembering Where You’ve Been with pushd and popd
			Manipulating Your Stack with dirs
		Technique 7: Typing Less and Doing More with Handy Automagic Variables
			Show Me the $$: Giving Temporary Files Unique Names
			Streamlining Archive Searches
			Turning the Output of a Command into a Variable with $( )
			Using $UID and $EUID in Shell Scripts
			Getting Quick Access to Programs with $PATH
			Customizing Variables for Rapid Transit
		Technique 8: Logging In, Logging Out
			Finding the Right Shell Script
			Customizing Your Autostart File
		Technique 9: Making History ( Work for You)
			Navigating the History List
			Customizing the History List
			Executing Commands Quickly with History Variables
		Technique 10: Keeping Your Life Simple with Aliases and Functions
			Viewing Your Aliases
			Creating Simple Timesaving Aliases
			Using Aliases for Complex Commands
			Automating Tedious Tasks with Functions
			Monitoring Your System in a Snap
			Un-tarring the Easy Way
	Part II: Getting the Most from Your File System
		Technique 11: Sharing Files and Printers in a Windows World
			What Is Samba?
			Getting Up and Running with Samba
			Sharing Linux Resources with Other Computers ( SMB Clients)
			Hooking Everyone Up to the Printer
			Plugging In to Remote Data with Linux Programs Quickly
		Technique 12: Finding What You Need
			Finding Files with locate
			Finding Files with find
			Qualifying Your Search with the find Command
			Acting on What You Find
			Building Complex Commands with xargs
		Technique 13: Moving Made Easy with Archives
			Creating Archives with File Roller
			Inspecting and Extracting Archives with File Roller
			Adding Functionality to tar with Complex Commands
			Uprooting Entire Directory Trees with scp
			Splitting Big Files into Manageable Chunks
		Technique 14: Downloading and Uploading Files in a Snap
			Building Software from Downloaded tarballs
			Versatile Downloading with wget
			Downloading and Uploading with curl
		Technique 15: Building a Playpen with User Mode Linux
			Choosing the ADIOS Version of User Mode Linux
			Setting Up ADIOS
			Finding Your Way around UML
			Using a GUI with UML
			Installing Software into UML
			Connecting to the Internet from an ADIOS VM
			Merging Changes to Your Prototype
	Part III: Good Housekeeping with Linux
		Technique 16: Red-lining RPM Queries
			Querying RPM Packages for Content
			Digesting Information
			Creating a Package Index
			Querying for Prerequisites
			Don’t Put That in Your Drive; You Don’t Know Where That’s Been!
		Technique 17: Installing Made Easy with RPM
			Dissecting an RPM Package
			Using RPM at the Command Line
			Removing RPMs
			Flagging Down RPM
			Getting Graphic with RPM
		Technique 18: Getting Comfortable with RPM
			Saving Time with --upgrade
			Verifying Your System
			Reading the Tamper-Proof Seal
		Technique 19: Keeping Up-to-Date with apt and Synaptic
			Setting Up Synaptic and apt in a Snap
			Keeping Up-to-Date with apt and Synaptic: The Basics
			Upgrading Your Entire Computer
			Handy Hints about Synaptic
			Importing the Keys to the Repository
		Technique 20: Setting Up Automatic Services
			Letting Task Scheduler Work for You
		Technique 21: Making Your Inner System Administrator Happy (And Productive)
			Reining In Resources with Disk Quotas
			Using System Accounting to Keep Track of Users
		Technique 22: Spring Cleaning Essentials
			Running Down the Runlevels
			Disabling Unused Services
			Removing Unneeded Services
			Removing Old Users and Their Files
	Part IV: Tweaking the Kernel on Your Linux System
		Technique 23: Taking Good Care of Your Kernel
			Adding and Removing Kernel Modules
			Manipulating Boot Time Parameters
		Technique 24: Creating a Custom Kernel
			Reconfiguring Your Kernel — Ready, Set, Go!
			Step 1: Making an Emergency Plan, or Boot Disk
			Step 2: Finding the Source Code
			Step 3: Configuring a New Kernel
			Step 4: Customizing the Kernel
			Step 5: Building the Kernel
		Technique 25: Coping with the SELinux Security System
			Understanding the Principles of SELinux
			Disabling or Disarming SELinux
			Playing the Right Role
			Finding Out about Your SELinux Policy
		Technique 26: Finding Out about Your System with /proc
			Exploring the Process-Related Entries in /proc
			Surveying Your System from /proc
			Closing Down Security Gaps with /proc
			Popping the Cork: Speeding Up WINE with /proc
	Part V: Securing Your Workspace
		Technique 27: Closing Those Prying Eyes
			Reading and Understanding File Permissions
			Controlling Permissions at the Command Line
			Changing File Permissions from a Desktop
		Technique 28: Using Encryption for Extra Security
			Encryption Made Easy with kgpg and the KDE Desktop
			Encrypting Documents with gpg at the Command Line
			Encrypting E-Mail for Added Security
		Technique 29: Securing a Large Network with Custom Authentication
			Using Cross-Platform Authentication with Linux and Windows
			Using PAM and Kerberos to Serve Up Authentication
		Technique 30: Customizing Authentication with PAM
			Finding a Module and Customizing Its Rules
			Building Good Rules with PAM
			Understanding Modules and Configuration Files: The Basics of PAM Authentication
			Dissecting a Configuration File
			Skipping a Password with PAM
		Technique 31: Gaining Privileges
			Feeling the Power
			Gaining Superuser Privileges
			Pretending to Be Other Users
			Limiting Privileges with sudo
		Technique 32: sudo Pseudonyms
			Installing sudo
			Adding Up the Aliases
			Adding Aliases to the sudo Configuration File
			Defining the Alias
		Technique 33: Securing Your Connections with SSH
			Using SSH for Top-Speed Connections
			Setting Up Public-Key Authentication to Secure SSH
			Logging In with SSH and Key Authentication
			Creating Shortcuts to Your Favorite SSH Locations
			Copying Files with scp
			Secure (And Fast) Port Forwarding with SSH
	Part VI: Networking Like a Professional
		Technique 34: Protecting Yourself with a Firewall
			Finding Your Firewall
			Editing the Rules with Webmin
		Technique 35: Using VNC to Connect to Remote Desktops
			Sharing Desktops with VNC
			Inviting Your Friends to Use Your Desktop
			Serving Up a New Desktop with VNC Server
			Using tsclient to View Remote Desktops from Linux
			Making Cut and Paste Commands Work on a Remote Desktop
			Creating New VNC Desktops on Demand
		Technique 36: Streamlining Your Network Surveillance
			Exploring Your Network with lsof
			Discovering Network Connections
			Other Timesaving lsof Tricks
			Packet Sniffing with the Ethereal Network Analyzer
		Technique 37: Evaluating Your Network Security with Nessus
			Getting Up and Running with Nessus
			Using Nessus to Scan Your Network
			Keeping Your Plug-ins Up-to-Date
		Technique 38: Person-to-Person Networking with IRC
			Finding the Answers You Seek in a Linux Chat Room
			Chatting in the Fedora Chat Room
			Looking for Answers in the SuSE Chat Room
			Finding Fellow Mandrake Users in the Mandrake Chat Room
			Customizing KSirc — Who Do You Want to Be Today?
	Part VII: Monitoring Your System
		Technique 39: Controlling Troublesome Processes at the Command Line
			Processing Processes with procps
			Keeping Track of Process Status with ps, pstree, and pgrep
			Killing Processes with pkill
			Killing Processes with killall
			Closing Windows with xkill
			Getting Your Processes’ Priorities Straight
		Technique 40: Taking Care of New ( And Old) Users
			Managing Users and Groups with the Fedora/Mandrake User Manager
			Managing Users and Groups with the SuSE User Administrator
		Technique 41: Keeping an Eye on Your System
			Keeping an Eye on the System Logs
			Customizing Your Log Files
			Keeping an Eye on Resources with KDE System Guard
	Part VIII: Serving Up the Internet and More
		Technique 42: Keeping an Apache Server in Top Form
			Setting Up Apache — Quick!
			Starting the Apache Service
			Building a Quick Web Page with OpenOffice. org
			Taking Your Site Public with Dynamic DNS
			Keeping Your Apache Server Up-to-Date the Easy Way
		Technique 43: Keeping an Eye on Your Servers
			Watching Your Web Server Traffic with apachetop
			Monitoring MySQL Server with the MySQL Control Center
			Watching Your MySQL Traffic with mtop
		Technique 44: Making a MySQL Server Your SQL Server
			Building a MySQL Server
			Replicating MySQL Data
			Choosing a Method to Back Up MySQL Data
			Backing Up and Restoring with mysqldump
			Backing Up with File System Tools
			Making a mysqlhotcopy of Your Database
			Archiving a Replication Slave
			Taking Care of Business with MySQL Administrator
		Technique 45: Safeguarding Your Apache Server with SSL Certificates
			Understanding the Basics of How Certificates Work
			Choosing an SSL Certificate
			Creating a Certificate Signing Request
			Creating a Self-Signed Certificate
			Creating a Signing Authority with openssl
			Trusting in Trusted Certification Authorities
			Exploring Your Certificate Collection with Mozilla
		Technique 46: Retrieving HTTPMail Using hotway and Evolution
			Introducing hotway
			Setting Up Evolution to Read HTTPMail Accounts with hotway
			Getting Started with hotway
			Ringing the Bells and Blowing the Whistles: Your Evolution Summary Page
		Technique 47: Stopping Spam with SpamAssassin
			Installing SpamAssassin
			Fine-Tuning SpamAssassin to Separate the Ham from the Spam
			Adding a New Filter to Evolution
			Serving Up a Big Bowl of the RulesDuJour
		Technique 48: Using Webmin to Simplify Sendmail Configuration
			Registering Your Address
			Taming a Sendmail Server
			Tweaking Your Configuration Files with Webmin
	Part IX: Backing Up Means Never Having to Say You’re Sorry
		Technique 49: Getting Ready to Back Up Your Data
			Deciding What to Archive
			Choosing Archive Media
			Choosing an Archive Scheme
			Choosing an Archive Program
		Technique 50: Backing Up Your Data
			Estimating Your Media Needs
			Creating Data Archives with tar
			Starting a Differential Backup Cycle
			Starting an Incremental Backup Cycle
			Restoring from Backup with tar
			Backing Up to CD ( Or DVD) with cdbackup
		Technique 51: Quick Backup to Remote Storage
			Combining the Power of tar with ssh for Quick Remote Backups
			Backing Up to a Remote Computer with rdist and ssh
		Technique 52: Archiving Changes with CVS
			Creating a CVS Repository
			Getting Started with CVS
			Populating Your Repository with Files
			Checking Files In and Out (Or Playing in Your Sandbox)
			Simplifying CVS with cervisia
	Part X: Programming Tricks
		Technique 53: Using Open-Source APIs to Save Time
			Using the libcurl Library (C Programming)
			Uploading a File with a Simple Program Using libcurl
			Installing the Ming Library
			Building a Simple Flash Movie with Ming
			Building Interactive Movies with Ming
		Technique 54: Timesaving PHP Tricks
			Doing the curl E-shuffle with PHP
			Sending E-Mail from PHP When Problems Occur
		Technique 55: Using the DDD Graphical Debugger with Perl
			Debugging Perl Code with DDD
			Making Stop Signs: Using Breakpoints to Watch Code
			Tracking Variable Values in the Data Window
	Part XI: The Scary (Or Fun!) Stuff
		Technique 56: Burning CD-Rs without Getting Burned
			Making Fedora Distribution CDs
			Burning an ISO File to Disc at the Command Line
			Creating an ISO Image at the Command Line
			Burning CDs without Making an ISO First
		Technique 57: Search and Destroy setuid and setgid Programs
			Exploring How setuid and setgid Can Be Dangerous
			Identifying the Potential Troublemakers — Fast
			Deciding to Turn Off setuid or setgid
			Changing the setuid or setgid Bit
		Technique 58: Quarantining Suspicious Programs with UML
			Who Belongs in Jail?
			Using UML to Jail Programs
			Changing the Default Password to the Jail
			Installing New Software and Resolving Conflicts
		Technique 59: Troubleshooting Persnickety Programs
			Using lsof to Find Out Which Files Are Open
			Debugging Your Environment with strace
			Investigating Programs with ltrace
			Handy strace and ltrace Options
			Recording Program Errors with valgrind
		Technique 60: Securing the Fort with Bastille
			Hardening Your Hat with Bastille
			Keeping Abreast of Security Issues
		Technique 61: Creating a Second Line of Defense with LIDS
			Turning LIDS On and Off
			Testing LIDS before Applying It to Your System
			Understanding the LIDS Access Control List
			Controlling File Access with LIDS
			Hiding Processes with LIDS
			Running Down the Privilege List
		Technique 62: Getting Graphical with Shell Scripts
			Getting Graphical at the Command Line
Document Text Contents
Page 1




by Susan Douglas and Korry Douglas

01a_571737ffirs.qxd 7/2/04 7:55 PM Page i

Page 2

01a_571737ffirs.qxd 7/2/04 7:55 PM Page i

Page 257

Using VNC to
Connect to Remote

NC (an acronym for virtual network computing) is a client/server
utility that lets you share graphical desktops across a local net-
work or across the Internet. Before VNC server came along, you

could use the KDE or GNOME desktop environments only if you were
actually sitting in front of the computer. With VNC server, you can create
a separate desktop (KDE, GNOME, or whatever environment you prefer)
for use from a different computer — located in the next room or in
another country.

In this technique, we show you how to set up and use remote viewers
and servers. VNC makes it easy. VNC is friendly, intuitive, fast, and free
(all in all, some of our favorite software features). You can

� Combine the best of different platforms on one monitor.

� Share a desktop with another user to get help or collaborate on a

� Share Linux machines without sharing desktops — each user has his
own work environment, complete with privacy. You can even stream-
line the setup of private remote desktops by creating new VNC desk-
tops on demand.

The time you can save by using other desktops without taking a step is

Sharing Desktops with VNC
When you run a VNC (virtual network computing) server on your Linux
computer, you create a new graphical desktop that you can use from a
VNC viewer. Linux is a multi-user operating system: Many users can log
into your computer at the same time.


Save Time By
� Sharing your desktop

with VNC

� Extending personal invita-
tions to your desktop

� Exposing your desktop for

� Using tsclient for remote

� Turbo charging cut and

� Creating desktops on
demand with gdm

43_571737c35.qxd 7/2/04 9:14 PM Page 239

Page 258

Technique 35: Using VNC to Connect to Remote Desktops240

• Figure 35-1: Multiple remote desktops.

Inviting Your Friends
to Use Your Desktop
If you’ve installed the KDE Networking package, you
can share your desktop with another user (if you
haven’t installed the kdenetwork package, flip back to
Technique 17 for a quick refresher). Sharing your
desktop is a great way to get help from another user,
or to collaborate on a project. When you share your
desktop, the other user connects to your desktop
using a VNC viewer (such as vncviewer or rdesktop).

To invite another user to share your desktop, follow
these steps:

1. Open the KDE menu.
2. If you’re running Fedora Linux, choose System

Tools➪More System Tools➪Desktop Sharing.

If you’re running SuSE Linux, choose System➪
Remote Access➪Desktop Sharing.

Mandrake users choose Internet➪Remote
Access➪Desktop Sharing.

The KDE Desktop Sharing window appears.

When you run a VNC viewer, you see a remote desk-
top within a window on your local desktop. If you
click the Full Screen option, it feels like you’re sitting
in front of the VNC server. When you move your
mouse, the cursor follows. When you type at the
keyboard, the characters are sent to the remote
desktop. Open Konqueror on the remote desktop
and you can drag files around your remote desktop.

VNC is portable:

� You can run the VNC server on a Linux computer,
a Windows computer, a Macintosh, or on a num-
ber of different UNIX distributions.

� You can run the VNC viewer on a Linux com-
puter, a Windows computer, a variety of UNIX
workstations, a Macintosh, or even within a Web

You can run a VNC server on one platform and the
VNC viewer on a different platform. For example, if
you have a nice big screen on a Windows computer,
run a VNC viewer on Windows connected to your
Linux VNC server. You may like to keep your e-mail
on a Windows-based computer, while using your
favorite graphics program on a Mac, but use your
Linux desktop for everything else.

With just a few mouse clicks, you can have a window
open for each desktop, with each desktop running
the programs you like to use on that system. For
example, in Figure 35-1, you can see three desktops:
in the background you see our workstation (Fedora
Core running KDE), in the upper-left you see a
Windows desktop, and in the foreground is a remote
session waiting for us to log into another Fedora

Because each remote desktop appears within its
own window on your local desktop, you can work
with multiple desktops at the same time.

Desktop sharing makes it easy to get a second
opinion about a problem on your desktop —
just let your most technically adept friend log
in and help.

43_571737c35.qxd 7/2/04 9:14 PM Page 240

Page 513

Index 495

user accounts
modifying, with user administra-

tor, 289
modifying, with user manager,

security, 458–459

user administrator. See also SuSE
adding groups with, 289
adding users with, 287–289
filtering with, 290
illustrated, 287
management with, 286–290
starting, 286
user account modification, 289

User and Group Administration
tool, 144, 290

user IDs (UIDs)
defined, 437
effective (EUIDs), 438

user manager
account modification with,

adding groups, with, 285–286
adding users with, 283–284
Fedora/Mandrake, 282, 283–286
filtering with, 286
illustrated, 283
opening, 283
Search Filter, 286

User Mode Linux. See UML

creating, 215
defined, 214

adding, to Nessus, 257–258
adding, with user administrator,

adding, with user manager,

creating, 167
disk space allotment, exceeding,

disk usage by, 79–81
filtering, with user administrator,

filtering, with user manager, 286
identity, 167
local, 290
login hours, viewing, 135
managing, with Fedora/

Mandrake, 283–286
managing, with SuSE, 286–290

name auto-completion, 31, 33
old, removing, 144–147
pretending to be, 210–211
substitute, 210–211
system, 290
tracking, 134–136


defined, 453
messages, 454
package, 453
use example, 454

automagic, 38–44
customizing, 43–44
environment, 31
history, 53–54
names, 53

virtual machines (VMs)
defined, 94
Internet access, 98
multiple, running, 99
UML, 443, 445

VNC desktops
creating, 245–246
gdm connection, 246

VNC server
for OSX, 241
portability, 240
running, 239, 240
running, first time, 241
tsclient with, 243

VNC viewer
for OSX, 241
portability, 240
running, 240

weather conditions

display, 415–419
in HTML, 419
with PHP, 416–419

Web pages, creating with, 312–313

webdav: protocol, 11

Add Rule window, 237–238
defined, 99, 365

downloading, 109
Edit Rule window, 236–237
firewall rules, adding, 237–238
firewall rules, displaying, 235
firewall rules, editing, 233–238
installing, 109–110
login window, 234
main menu, 365
main window, 234
Networking tools page, 234
reading rules with, 234–236
Sendmail configuration, 365–368
sessions, starting, 234
Shorewall Firewall module, 234
SpamAssassin and, 359
for system administration, 109
Web site, 234

wget command
defined, 91
documentation, 452
downloading with, 88, 91–93
mirroring sites with, 91–92
optional flags, 92–93
proxy servers and, 93
running, 450
unpacking with, 92
using, 88
verifying bookmarks with, 92

wildcards, shell, 75
winbindd: service, 143
windows, closing, 280–281
Windows computers

home directory access, 68–69
printer sharing, 70–71

Windows domain, 195
WINE, 175
workgroup name, adjusting, 67–68
write permissions, 180

xargs command, 81
xclock command, 222
Ximian Evolution

e-mail account setup, 350–353
encrypting with, 191–192
filters, adding, 361–363
opening, 191
opening documents with,

summary page, 353–355

76_571737bindex.qxd 7/2/04 9:44 PM Page 495

Page 514

Linux Timesaving Techniques For Dummies496

xkill command, 280–281

parser, 414
self-identifying data, 415

Xnest, 97

YaST. See also SuSE

Add a New Local Group dialog,

Add a New Local User dialog,

adding packages with, 113

defined, 112
illustrated, 112, 114
panels, 112–113
Password Settings dialog,

steps, 112
User and Group Administration

tool, 144, 287, 290

zenity graphical toolkit, 475–477
Zip drives, 373

76_571737bindex.qxd 7/2/04 9:44 PM Page 496

Similer Documents