You are on page 1of 41

RHCSA/RHCE Red Hat Linux

certification study guide : (exams


EX200 & EX300) - eBook PDF
Visit to download the full and correct content document:
https://ebooksecure.com/download/rhcsa-rhce-red-hat-linux-certification-study-guide-
exams-ex200-ex300-ebook-pdf/
RHCSA/RHCE
®

Red Hat Linux Certification


® ®

Study Guide, Seventh Edition


(Exams EX200 & EX300)

Michael Jang
Alessandro Orsaria

This study/training guide and/or material is not sponsored by, endorsed by, or
affiliated with Red Hat, Inc. in any manner. Red Hat®, Red Hat® Enterprise Linux®,
RHCE™, RHCSA™, and the Red Hat logo and Red Hat “Shadowman” logo are
trademarks or registered trademarks of Red Hat, Inc. in the United States and certain
other countries. All other trademarks are trademarks of their respective owners.
This publication and DVD-ROM may be used in assisting students to prepare for a Red New York Chicago San Francisco
Hat RHCSA or RHCE certification exam. Neither Red Hat nor McGraw-Hill warrants that Athens London Madrid Mexico City
use of this publication and DVD-ROM will ensure passing any exam. Milan New Delhi Singapore Sydney Toronto
Cataloging-in-Publication Data is on file with the Library of Congress

McGraw-Hill Education books are available at special quantity discounts to use as premiums and sales
promotions, or for use in corporate training programs. To contact a representative, please visit the Contact Us
pages at www.mhprofessional.com.

RHCSA/RHCE® Red Hat® Linux® Certification Study Guide, Seventh Edition (Exams EX200 & EX300)

Copyright © 2016 by McGraw-Hill Education. All rights reserved. Printed in the United States of America.
Except as permitted under the Copyright Act of 1976, no part of this publication may be reproduced or
distributed in any form or by any means, or stored in a database or retrieval system, without the prior written
permission of publisher, with the exception that the program listings may be entered, stored, and executed in a
computer system, but they may not be reproduced for publication.
All trademarks or copyrights mentioned herein are the possession of their respective owners and McGraw-Hill
Education makes no claim of ownership by the mention of products that contain these marks.
1234567890 DOC DOC 1 0 9 8 7 6
ISBN: Book p/n 978-0-07-184193-1 and DVD p/n 978-0-07-184195-5
of set 978-0-07-184196-2
MHID: Book p/n 0-07-184193-8 and DVD p/n 0-07-184195-4
of set 0-07-184196-2

Sponsoring Editor Copy Editor Illustration


Timothy Green Bart Reed Cenveo Publisher Services

Editorial Supervisor Proofreader Art Director, Cover


Jody McKenzie Lisa McCoy Jeff Weeks

Project Editor Indexer Cover Designer


LeeAnn Pickrell Rebecca Plunkett Jeff Weeks

Acquisitions Coordinator Production Supervisor


Amy Stonebraker James Kussow

Technical Editor Composition


Alex Davies Cenveo® Publisher Services

Information has been obtained by McGraw-Hill Education from sources believed to be reliable. However,
because of the possibility of human or mechanical error by our sources, McGraw-Hill Education, or others,
McGraw-Hill Education does not guarantee the accuracy, adequacy, or completeness of any information and is
not responsible for any errors or omissions or the results obtained from the use of such information.
For the young widows and widowers:
may they find the courage to face their fears,
to navigate their way through the pain,
and to find hope for a brighter future.
ABOUT THE AUTHORS

Michael Jang (RHCE, LPIC-2, UCP, LCP, Linux+, MCP) is currently a Senior Technical
Writer for ForgeRock. His experience with computers goes back to the days of jumbled
punch cards. He has written other books on Linux certification, including LPIC-1 in
Depth, Mike Meyers’ Linux+ Certification Passport, and Sair GNU/Linux Installation and
Configuration Exam Cram. His other Linux books include Linux Annoyances for Geeks,
Linux Patch Management, and Mastering Fedora Core Linux 5. He has also written or
contributed to books on Microsoft operating systems, including MCSE Guide to Microsoft
Windows 98 and Mastering Windows XP Professional, Second Edition.
Alessandro Orsaria (RHCE, RHCA, CCIE x 2) is an IT professional with more than 15
years’ experience in the industry. He has authored articles for technical Linux magazines
and is currently employed by a global equity hedge fund as an IT Infrastructure Architect.
Alessandro is Red Hat RHCE and RHCA certified and has achieved two Cisco CCIE
certifications in Routing & Switching and Datacenter. He holds an MBA from Imperial
College of London and a degree in physics.

About the Technical Editor


Alex Davies works for a proprietary trading firm, where he is responsible for Linux systems
and manages a team of Linux engineers across Chicago, New York, London, and Singapore.
Alex is the author of MySQL Clustering and MySQL High Availability Cookbook. Earlier
in his career he was both RHCE and RHCA certified and received the RHCE of the Year
award in 2009 from Red Hat. Alex also holds a degree in economics from the University of
Durham.
CONTENTS AT A GLANCE

1 Prepare for Red Hat Hands-on Certifications .................................. 1

2 Virtual Machines and Automated Installations ................................ 55

3 Fundamental Command-Line Skills .............................................. 115

4 RHCSA-Level Security Options ................................................... 175

5 The Boot Process ..................................................................... 241

6 Linux Filesystem Administration ................................................. 285

7 Package Management ............................................................... 343

8 User Administration ................................................................. 395

9 RHCSA-Level System Administration Tasks ................................... 443

10 A Security Primer . ................................................................... 479

11 System Services and SELinux ...................................................... 537

12 RHCE Administrative Tasks ....................................................... 579

13 Network Services: DNS, SMTP, iSCSI, and NTP . ............................. 631

14 The Apache Web Server ............................................................ 679

15 The Samba File Server ............................................................... 733

16 NFS Secured with Kerberos ........................................................ 773

17 The MariaDB Server ................................................................. 807

A Prepare a System for the Sample Exams ......................................... 843

B Sample Exam 1: RHCSA ............................................................ 847

C Sample Exam 2: RHCSA ............................................................ 851

v
vi RHCSA/RHCE Red Hat Linux Certification Study Guide

D Sample Exam 3: RHCE Sample Exam 1 .......................................... 855

E Sample Exam 4: RHCE Sample Exam 2 .......................................... 861

F About the DVD . ...................................................................... 865

Glossary ................................................................................ 867

Index .................................................................................... 883


CONTENTS

Acknowledgments ...................................................................... xxv


Preface .......... .......................................................................... xxvii
Introduction ... .......................................................................... xxxviii

1 Prepare for Red Hat Hands-on Certifications .................. 1


The RHCSA and RHCE Exams .................................................... 4
The Exam Experience . ................................................... 5
The RHCSA Exam ........................................................ 5
The RHCE Exam .......................................................... 6
If You’re Studying “Just” for the RHCSA Exam ...................... 6
Evolving Requirements ................................................... 6
Basic Hardware Requirements . ................................................... 7
Hardware Compatibility ................................................. 7
Architectures ............................................................... 8
RAM Requirements ...................................................... 8
Hard Drive Options ....................................................... 9
Networking ................................................................. 9
Virtual Machine Options ................................................ 10
Get Red Hat Enterprise Linux ..................................................... 11
Purchase a Subscription ................................................. 11
Get an Evaluation Copy . . ................................................ 12
Third-party Rebuilds ..................................................... 12
Check the Download . .................................................... 13
Installation Requirements .......................................................... 13
You Won’t Start from Scratch ........................................... 14
The Advantages of Network Installation ............................. 14
Red Hat and Virtual Machines ......................................... 15
Virtual and Physical Systems ............................................ 15
A Pre-installed Environment for Practice Labs ..................... 15
System Roles ............................................................... 16
Installation Options ................................................................. 18
Boot Media ................................................................. 18
CD/DVD or Boot USB Starts Installation . ........................... 19
Basic Installation Steps .. ................................................. 20

vii
viii RHCSA/RHCE Red Hat Linux Certification Study Guide

The Installation Perspective on Partitions ........................... 25


Partition Creation Exercise .............................................. 28
Exercise 1-1: Partitioning During Installation . ................... 30
Wow, Look at All That Software! ...................................... 32
Baseline Packages ......................................................... 34
Package Groups ........................................................... 34
During the Installation ................................................... 35
System Setup Options ............................................................... 36
Initial Setup and Firstboot ............................................... 37
Default Security Settings ................................................ 37
Special Setup Options for Virtual Machines . . ....................... 38
Configure Default File Sharing Services ......................................... 39
Mount and Copy the Installation DVD ............................... 40
Set Up a Default Configuration Apache Server ..................... 40
Exercise 1-2: Configure Apache as an Installation Server ...... 42
Share Copied Files via FTP Server . .................................... 43
Certification Summary . . ................................................. 45
✓ Two-Minute Drill ......................................................... 46
Q&A Self Test ..................................................................... 48
Lab Questions ............................................................. 49
Self Test Answers .......................................................... 52
Lab Answers ............................................................... 53

2 Virtual Machines and Automated Installations ............... 55


Configure KVM for Red Hat ....................................................... 56
Why Virtual Machines ................................................... 57
If You Have to Install KVM ............................................. 58
The Right KVM Modules ................................................ 59
Configure the Virtual Machine Manager . . ........................... 60
Configuration by Hypervisor . .......................................... 61
Virtual Networks on a Hypervisor ..................................... 62
Exercise 2-1: Create a Second Virtual Network .................. 63
Configure a Virtual Machine on KVM ........................................... 68
Configure a Virtual Machine on KVM ................................ 68
Exercise 2-2: Add Virtual Hard Drives ............................. 73
KVM Configuration Files ................................................ 75
Control Virtual Machines from the Command Line . .............. 76
Automated Installation Options .................................................. 80
Kickstart Concepts ........................................................ 81
Set Up Local Access to Kickstart ....................................... 81
Set Up Network Access to Kickstart .................................. 83
Contents ix

Sample Kickstart File ..................................................... 83


Exercise 2-3: Create and Use a Sample Kickstart File ........... 89
The Kickstart Configurator . ............................................ 90
Administration with the Secure Shell and Secure Copy ...................... 95
Configure an SSH Client ................................................. 95
Command-Line Access .................................................. 96
More SSH Command-Line Tools ...................................... 97
Graphical Secure Shell Access .......................................... 97
Consider Adding These Command-Line Tools ................................ 98
Checking Ports with telnet .............................................. 99
Checking Ports with nmap .............................................. 100
Configure an E-mail Client .............................................. 100
The Use of Text and Graphical Browsers . . ........................... 102
Using lftp to Access URLs . .............................................. 103
Certification Summary . . ................................................. 105
✓ Two-Minute Drill ......................................................... 105
Q&A Self Test ..................................................................... 107
Lab Questions ............................................................. 108
Self Test Answers .......................................................... 110
Lab Answers ............................................................... 111

3 Fundamental Command-Line Skills ............................. 115


Shells ................................................................................... 118
Other Shells ................................................................ 119
Virtual Terminals .......................................................... 119
GUI Shell Interfaces ...................................................... 120
Differences Between Regular and Administrative Users .......... 121
Text Streams and Command Redirection . ........................... 121
Standard Command-Line Tools . . ................................................. 122
File and Directory Concepts ............................................ 123
File Lists and ls ............................................................. 126
File-Creation Commands ................................................ 127
Wildcards ................................................................... 130
File Searches . .............................................................. 130
The Management of Text Files . ................................................... 131
Commands to Read Text Streams ...................................... 132
Commands to Process Text Streams .................................. 134
Edit Text Files at the Console . .......................................... 137
Exercise 3-1: Using vi to Create a New User ...................... 139
If You Don’t Like vi ....................................................... 141
Edit Text Files in the GUI . . .............................................. 141
x RHCSA/RHCE Red Hat Linux Certification Study Guide

Local Online Documentation ...................................................... 142


When You Need Help . ................................................... 142
A Variety of man Pages .................................................. 143
The info Manuals ......................................................... 145
Detailed Documentation in /usr/share/doc .......................... 146
A Networking Primer ............................................................... 146
IPv4 Networks ............................................................. 146
Networks and Routing ................................................... 147
Tools and Commands . ................................................... 148
Network Configuration and Troubleshooting .................................. 154
Network Configuration Files .. .......................................... 155
Network Configuration Tools .......................................... 158
Exercise 3-2: Configure a Network Card .......................... 161
Configure Name Resolution ............................................ 164
Hostname Configuration Files .......................................... 165
Hostname Configuration Options . .................................... 166
Certification Summary . . ................................................. 167
✓ Two-Minute Drill ......................................................... 168
Q&A Self Test ..................................................................... 170
Lab Questions ............................................................. 171
Self Test Answers .......................................................... 172
Lab Answers ............................................................... 173

4 RHCSA-Level Security Options . . ................................. 175


Basic File Permissions ............................................................... 178
File Permissions and Ownership ....................................... 178
Commands to Change Permissions and Ownership ............... 181
Basic User and Group Concepts ....................................... 184
Access Control Lists and More .................................................... 186
The getfacl Command ................................................... 186
Make a Filesystem ACL Friendly ....................................... 187
Manage ACLs on a File .................................................. 188
Configure a Directory for ACLs ........................................ 190
Configure Default ACLs ................................................. 191
ACLs and Masks .......................................................... 192
Exercise 4-1: Use ACLs to Deny a User ............................ 192
NFS Shares and ACLs .................................................... 193
Basic Firewall Control ............................................................... 195
Standard Ports ............................................................. 196
A Focus on iptables ....................................................... 196
Keep That Firewall in Operation . . ..................................... 198
Contents xi

The iptables Service ...................................................... 199


The firewalld Service . .................................................... 201
Exercise 4-2: Adjust Firewall Settings .............................. 206
Securing SSH with Key-Based Authentication ................................. 207
SSH Configuration Commands ........................................ 208
SSH Client Configuration Files ......................................... 208
Basic Encrypted Communication ...................................... 209
Set Up a Private/Public Pair for Key-Based Authentication ...... 210
A Security-Enhanced Linux Primer .............................................. 213
Basic Features of SELinux ............................................... 213
SELinux Status ............................................................. 213
SELinux Configuration at the Command Line ...................... 215
Configure Basic SELinux Settings ..................................... 215
Configure Regular Users for SELinux ................................. 216
Manage SELinux Boolean Settings .................................... 218
List and Identify SELinux File Contexts .............................. 219
Restore SELinux File Contexts ......................................... 220
Identify SELinux Process Contexts .................................... 222
Diagnose and Address SELinux Policy Violations . ................. 223
The GUI SELinux Administration Tool .............................. 225
The SELinux Troubleshoot Browser .................................. 229
Exercise 4-3: Test a SELinux User Type ........................... 230
Certification Summary . . ................................................. 232
✓ Two-Minute Drill ......................................................... 232
Q&A Self Test ..................................................................... 234
Lab Questions ............................................................. 236
Self Test Answers .......................................................... 236
Lab Answers ............................................................... 238

5 The Boot Process ................................................... 241


The BIOS and the UEFI ............................................................. 243
Basic System Configuration ............................................. 243
Startup Menus ............................................................. 244
Access to Linux Bootloaders ............................................ 244
Bootloaders and GRUB 2 ........................................................... 245
GRUB, the GRand Unified Bootloader ............................... 246
Exercise 5-1: Boot into a Different Target ......................... 248
Exercise 5-2: Recover the Root Password ......................... 249
Modify the System Bootloader ......................................... 250
How to Update GRUB .................................................... 253
The GRUB 2 Command Line . .......................................... 253
xii RHCSA/RHCE Red Hat Linux Certification Study Guide

Exercise 5-3: Using the GRUB 2 Command Line ................ 255


Reinstall GRUB 2 . . ........................................................ 256
An Option for Booting from GRUB 2: Rescue Mode .............. 256
Between GRUB 2 and Login . ...................................................... 259
Kernels and the Initial RAM Disk ..................................... 260
The First Process, Targets, and Units ................................. 261
Switch Between Targets .................................................. 263
Reboot and Shut Down a System Normally .. ........................ 264
systemd Replaces Upstart and SysVinit ............................... 264
systemd Units .............................................................. 267
Virtual Terminals and Login Screens .................................. 270
Control by Target .................................................................... 270
Functionality by Target .................................................. 271
The Innards of systemd Units .......................................... 271
Service Configuration . ................................................... 273
Time Synchronization ............................................................... 274
Time Zone Configuration . .............................................. 275
Sync the Time with chronyd ............................................ 276
Sync the Time with ntpd ................................................. 276
Certification Summary . . ................................................. 277
✓ Two-Minute Drill ......................................................... 278
Q&A Self Test ..................................................................... 279
Lab Questions ............................................................. 281
Self Test Answers .......................................................... 281
Lab Answers ............................................................... 282

6 Linux Filesystem Administration ................................ 285


Storage Management and Partitions ............................................. 287
Current System State . .................................................... 287
The fdisk Utility ........................................................... 288
The gdisk Utility ........................................................... 296
The parted Utility . ........................................................ 297
Using parted: Starting, Getting Help, and Quitting ................ 298
Graphical Options ........................................................ 302
Exercise 6-1: Work with fdisk and parted ......................... 304
Filesystem Formats .................................................................. 305
Standard Formatting Filesystems ...................................... 306
Journaling Filesystems ................................................... 307
Filesystem Format Commands ......................................... 307
Swap Volumes ............................................................. 308
Filesystem Check Commands .......................................... 309
Contents xiii

Exercise 6-2: Format, Check, and Mount Different


Filesystems .............................................................. 309
Basic Linux Filesystems and Directories ........................................ 310
Separate Linux Filesystems .............................................. 310
Directories That Can Be Mounted Separately ....................... 312
Logical Volume Management (LVM) ............................................ 313
Definitions in LVM ....................................................... 313
Create a Physical Volume ................................................ 314
Create a Volume Group .................................................. 314
Create a Logical Volume ................................................. 315
Make Use of a Logical Volume ......................................... 315
More LVM Commands .................................................. 315
Remove a Logical Volume . .............................................. 318
Resize Logical Volumes .................................................. 319
Filesystem Management ............................................................ 320
The /etc/fstab File ......................................................... 320
Universally Unique Identifiers in /etc/fstab . . ........................ 322
The mount Command ................................................... 323
More Filesystem Mount Options ...................................... 324
Virtual Filesystems ........................................................ 325
Add Your Own Filesystems to /etc/fstab ............................. 325
Removable Media and /etc/fstab ....................................... 326
Networked Filesystems .................................................. 327
The Automounter .................................................................... 328
Mounting via the Automounter ........................................ 328
Exercise 6-3: Configure the Automounter ........................ 332
Certification Summary . . ................................................. 334
✓ Two-Minute Drill ......................................................... 334
Q&A Self Test ..................................................................... 336
Lab Questions ............................................................. 337
Self Test Answers .......................................................... 338
Lab Answers ............................................................... 339

7 Package Management ............................................ 343


The Red Hat Package Manager .................................................... 344
What Is a Package? .. ...................................................... 345
What Is the RPM Database? ............................................ 345
What Is a Repository? .................................................... 346
Install an RPM Package . ................................................. 347
Uninstall an RPM Package .............................................. 348
Install RPMs from Remote Systems ................................... 349
xiv RHCSA/RHCE Red Hat Linux Certification Study Guide

RPM Installation Security ............................................... 350


Special RPM Procedures with the Kernel . ........................... 350
More RPM Commands ............................................................. 353
Package Queries . .......................................................... 353
Package Signatures . . ...................................................... 354
File Verification . . .......................................................... 355
Dependencies and the yum Command .......................................... 357
An Example of Dependency Hell ...................................... 357
Relief from Dependency Hell ........................................... 359
Basic yum Configuration ................................................ 360
The Basic yum Configuration File: yum.conf . . ...................... 361
Configuration Files in the /etc/yum/pluginconf.d Directory ..... 362
Configuration Files in the /etc/yum.repos.d Directory . ........... 363
Create Your Own /etc/yum.repos.d Configuration File ........... 365
Exercise 7-1: Create a yum Repository
from the RHEL 7 DVD ............................................... 368
Third-party Repositories ................................................ 369
Basic yum Commands ................................................... 370
Installation Mode . ........................................................ 371
Security and yum .......................................................... 372
Updates and Security Fixes .............................................. 373
Package Groups and yum ................................................ 373
More yum Commands ................................................... 376
More Package Management Tools ................................................ 379
The GNOME Software Update Tool . ................................. 380
Automated Updates ...................................................... 381
GNOME Software Tool .................................................. 381
Exercise 7-2: Installing More with yum
and the GNOME Software Tool .................................... 382
Red Hat Subscription Manager .. ....................................... 383
Certification Summary . . ................................................. 385
✓ Two-Minute Drill ......................................................... 386
Q&A Self Test ..................................................................... 387
Lab Questions ............................................................. 389
Self Test Answers .......................................................... 389
Lab Answers ............................................................... 391

8 User Administration ............................................... 395


User Account Management ........................................................ 397
Different Kinds of Users ................................................. 397
The Shadow Password Suite ............................................ 398
Contents xv

Command-Line Tools . ................................................... 403


Exercise 8-1 ................................................................ 406
Add a User with the Red Hat User Manager ......................... 406
Exercise 8-2: Real and Fake Shells .................................. 407
Modify an Account ....................................................... 407
More User and Group Management Commands ................... 409
Administrative Control ............................................................. 411
The Ability to Log In as root ............................................ 411
Exercise 8-3: Limit root Logins . . .................................... 412
The Ability to Log In ..................................................... 413
The Proper Use of the su Command .................................. 413
Limit Access to su ......................................................... 414
The Proper Use of the sg Command .................................. 414
Custom Administrators with the sudo Command .................. 415
Other Administrative Users ............................................. 416
User and Shell Configuration ...................................................... 416
Home Directories and /etc/skel ........................................ 417
Exercise 8-4: Another Way to Secure a System .................. 419
Shell Configuration Files in User Home Directories ............... 420
Login, Logout, and User Switching .................................... 420
Users and Network Authentication .............................................. 421
LDAP Client Configuration . ............................................ 423
The Name Service Switch File .......................................... 425
The System Security Service Daemon ................................ 425
Red Hat Network Authentication Tools .............................. 426
Special Groups ........................................................................ 432
Standard and Red Hat Groups . . ........................................ 432
Shared Directories ........................................................ 432
Exercise 8-5: Control Group Ownership
with the SGID Bit ...................................................... 433
Certification Summary . . ................................................. 435
✓ Two-Minute Drill ......................................................... 436
Q&A Self Test ..................................................................... 437
Lab Questions ............................................................. 439
Self Test Answers .......................................................... 439
Lab Answers ............................................................... 440

9 RHCSA-Level System Administration Tasks .................... 443


Elementary System Administration Commands ............................... 444
System Resource Management Commands .. ........................ 445
Archives and Compression .............................................. 454
xvi RHCSA/RHCE Red Hat Linux Certification Study Guide

Automate System Administration: cron and at ................................ 456


The System crontab and Components ................................ 456
Hourly cron Jobs .......................................................... 458
Regular Anacron Jobs .................................................... 459
Setting Up cron for Users .. .............................................. 460
Exercise 9-1: Create a cron Job ...................................... 461
Running a Job with the at System ...................................... 461
Secure cron and at ........................................................ 462
Local Log File Analysis .............................................................. 464
System Log Configuration File ......................................... 464
Log File Management . ................................................... 465
A Variety of Log Files ..................................................... 466
Service-Specific Logs ..................................................... 468
Exercise 9-2: Learn the Log Files .................................... 468
View systemd Journal Log Entries ..................................... 468
Certification Summary . . ................................................. 471
✓ Two-Minute Drill ......................................................... 471
Q&A Self Test ..................................................................... 472
Lab Questions ............................................................. 474
Self Test Answers .......................................................... 474
Lab Answers ............................................................... 475

10 A Security Primer .................................................. 479


The Layers of Linux Security ...................................................... 480
Bastion Systems ........................................................... 481
Best Defenses with Security Updates ................................. 481
Service-Specific Security ................................................ 482
Host-Based Security ...................................................... 484
User-Based Security ...................................................... 484
Console Security .......................................................... 485
Recommendations from the U.S. National Security Agency ..... 485
The PolicyKit .............................................................. 486
Firewalls and Network Address Translation .................................... 487
Definitions .................................................................. 488
The Structure of firewalld ............................................... 489
Exercise 10-1: Configure Rich Rules ............................... 496
Further Recommendations from the NSA . .......................... 498
Make Sure That firewalld Is Running ................................. 499
IP Masquerading .......................................................... 500
IP Forwarding .............................................................. 501
The Red Hat Firewall Configuration Tool ............................ 502
Contents xvii

TCP Wrappers ........................................................................ 508


Is a Service Protected by TCP Wrappers? ............................ 508
TCP Wrappers Configuration Files . . .................................. 509
Exercise 10-2: Configure TCP Wrappers . . ........................ 511
Pluggable Authentication Modules . .............................................. 512
Configuration Files ....................................................... 512
Control Flags ............................................................... 513
The Format of a PAM File ............................................... 515
Exercise 10-3: Configure PAM to Limit root Access ............ 519
PAM and User-Based Security ......................................... 519
Exercise 10-4: Use PAM to Limit User Access ................... 521
Secure Files and More with GPG2 ................................................ 522
GPG2 Commands ......................................................... 522
Current GPG2 Configuration ........................................... 523
GPG2 Encryption Options .............................................. 523
Generate a GPG2 Key .................................................... 523
Use a GPG2 Key to Encrypt a File . .................................... 525
Certification Summary . . ................................................. 527
✓ Two-Minute Drill ......................................................... 527
Q&A Self Test ..................................................................... 529
Lab Questions ............................................................. 531
Self Test Answers .......................................................... 531
Lab Answers ............................................................... 532

11 System Services and SELinux .................................... 537


Red Hat System Configuration . ................................................... 539
Service Management . .................................................... 539
System Services . . .......................................................... 539
Bigger Picture Configuration Process ................................. 540
Available Configuration Tools .......................................... 540
Security-Enhanced Linux .......................................................... 541
Options in the SELinux Booleans Directory ......................... 542
Service Categories of SELinux Booleans ............................. 543
Boolean Configuration with the SELinux Management Tool .... 543
Boolean Settings ........................................................... 544
SELinux File Contexts .................................................... 548
SELinux Port Labeling ................................................... 550
Exercise 11-1: Configure a New Directory
with Appropriate SELinux Contexts . . ............................. 550
xviii RHCSA/RHCE Red Hat Linux Certification Study Guide

The Secure Shell Server ............................................................. 552


SSH Server Configuration Files ........................................ 552
Configure an SSH Server ................................................ 553
Exercise 11-2: Run an SSH Server on a Nonstandard Port .... 560
User-Based Security for SSH .. .......................................... 560
Host-Based Security for SSH . .......................................... 561
A Security and Configuration Checklist . . ....................................... 562
Installation of Server Services .......................................... 562
Basic Configuration ....................................................... 566
Make Sure the Service Survives a Reboot ............................ 566
Review Access Through Layers of Security .......................... 566
Exercise 11-3: Practice Troubleshooting Network
Connectivity Issues ................................................... 568
Exercise 11-4: Review the Different Effects
of firewalld and TCP Wrappers ..................................... 569
Certification Summary . . ................................................. 571
✓ Two-Minute Drill ......................................................... 572
Q&A Self Test ..................................................................... 573
Lab Questions ............................................................. 574
Self Test Answers .......................................................... 575
Lab Answers ............................................................... 576

12 RHCE Administrative Tasks ....................................... 579


Automate System Maintenance ................................................... 581
Standard Administrative Scripts ....................................... 581
Bash Variables ............................................................. 583
Bash Commands .......................................................... 584
Exercise 12-1: Create a Script ....................................... 588
Set Up System Utilization Reports ................................................ 590
System Utilization Commands ......................................... 591
The System Activity Report Tool ...................................... 591
Collect System Status into Logs . ....................................... 592
Prepare a System Status Report ........................................ 593
Kernel Run-time Parameters ...................................................... 595
How sysctl Works with /etc/sysctl.conf ............................... 595
Settings in the /etc/sysctl.conf File .................................... 596
Exercise 12-2: Disable Responses to the ping Command ...... 597
IP Routes ............................................................................... 598
Configure a Default Route ............................................... 598
Configure a Static Route ................................................. 599
Exercise 12-3: Practice with Static Routes ........................ 600
Contents xix

An Introduction to IPv6 ............................................................ 602


Basic IPv6 Addressing .................................................... 602
Troubleshooting Tools ................................................... 604
Configure IPv6 Addresses . .............................................. 604
Network Interface Bonding and Teaming ....................................... 606
Configure Interface Bonding ........................................... 608
Exercise 12-4: Test Bonding Failover ............................... 611
Configure Interface Teaming . .......................................... 612
Authentication with Kerberos . .................................................... 613
A Kerberos Primer ........................................................ 613
Prerequisites for Kerberos Servers and Clients ..................... 614
Exercise 12-5: Install a Kerberos KDC ............................. 615
Set Up a Kerberos Client ................................................ 617
Exercise 12-6: Configure Kerberos Authentication ............. 620
Certification Summary . . ................................................. 621
✓ Two-Minute Drill ......................................................... 622
Q&A Self Test ..................................................................... 623
Lab Questions ............................................................. 625
Self Test Answers .......................................................... 625
Lab Answers ............................................................... 626

13 Network Services: DNS, SMTP, iSCSI, and NTP . . ............... 631


An Introduction to Domain Name Services .................................... 633
The BIND Name Server ................................................. 633
Different Types of DNS Servers ........................................ 634
Minimal DNS Server Configurations ............................................ 634
BIND Configuration Files . .............................................. 634
A BIND Caching-Only Name Server .................................. 636
Unbound as a Caching-Only Name Server .......................... 641
DNS Client Troubleshooting ........................................... 642
Exercise 13-1: Set Up Your Own BIND DNS Server . ........... 644
Exercise 13-2: Set Up Your Own Unbound DNS Server . ...... 645
A Variety of E-Mail Agents ......................................................... 645
Definitions and Protocols ............................................... 646
Relevant Mail Server Packages ......................................... 646
Use the alternatives Command to Select an E-Mail System ...... 647
General User Security . ................................................... 648
Mail Logging ............................................................... 649
Common Security Issues ................................................ 649
Testing an E-Mail Server ................................................ 649
Exercise 13-3: Create Users Just for E-Mail ....................... 649
Another random document with
no related content on Scribd:
of Culloden to his neglect or inefficiency in provisioning the
army, a duty which Murray had always performed well. Hay
held a colonel’s commission in the Jacobite army. He attached
himself to Prince Charles after leaving Scotland, became
major-domo of his household when he went to Rome after his
father’s death in 1766; created a Jacobite baronet in that year;
dismissed in 1768; returned to Scotland 1771; died 1784.
[452] Alexander Macleod, an Edinburgh advocate, was
aide-de-camp to the Prince throughout the campaign. His
father, John, also an advocate, was a grandson of Sir Norman
Macleod of Bernera, and was a first cousin of Lady
Clanranald. He had purchased Muiravonside in Stirlingshire,
two miles from Linlithgow. Alexander was sent from Edinburgh
in September to summon to the Prince’s standard Sir
Alexander Macdonald of Sleat and Macleod of Macleod, both
his near kinsmen. This mission, in which he failed owing to the
stronger influence of Duncan Forbes, brought on him the
special anger of the Government. He was attainted, and for
thirty-two years he wandered in the wildest regions of the
Western Highlands and Islands. He received a pardon in 1778,
and died in 1784. He was in Raasay when Dr. Johnson and
Boswell visited that island in September 1773. He was
generally known as Sandie Macleod in the Islands, and had
also acquired the nickname of M‘Cruslick, signifying a cross
between Proteus and Don Quixote. He possessed the most
boisterous spirits, which delighted Johnson and irritated
Boswell.
[453] See post, p. 230, n. 2.
[454] Allan Macdowell is a mistake for Macdonell or rather
Macdonald, as his name is afterwards correctly spelled. He
was a ‘native of the Isles’ and a clansman of Clanranald’s; he
went out with the clan as chaplain when the standard was
raised, and continued with the army until the end of the
campaign. He also acted as confessor to the Prince. He and
Æneas M‘Gillis, the chaplain of Glengarry’s men, were the only
priests that accompanied the Highlanders to Prestonpans.
They wore the Highland dress, with sword and pistol, and were
styled captains. At the battle of Falkirk Mr. Macdonald rode
along the line and gave his blessing, which the Catholics
received kneeling. From Culloden he accompanied the Prince
in his flight and in the earlier part of his wanderings, leaving
him at Scalpa. Later on he was apprehended in South Uist,
and sent with some other priests to London in Ferguson’s ship
the Furness. He and four other clergymen were examined by
the Duke of Newcastle, who informed them that they might
leave the country on finding bail for £1000 each not to return.
They pointed out that the bail was quite beyond their power, on
which the Duke smilingly replied that they were honest men
and he would take each man’s bail for the other. Macdonald
went to Paris, and in 1748 to Rome, where he lived for many
years. (Bishop Geddes’s MS.) I do not know if he ever
returned.
[455] Sic in N. M. Mag. Most likely an error caused by
careless transcription and meant to read, ‘to Gortlick’s house
[not horge] a gentleman of the name of Thomas Fraser.’
Gortlick, more generally spelt Gortuleg, belonged to Thomas
Fraser, a cadet of Lovat’s. It was in this house and on this
occasion that Prince Charles had his memorable meeting with
Lord Lovat which is dramatically described by Mrs. Grant of
Laggan. (See Wariston’s Diary and Other Papers, p. 265,
Scot. Hist. Soc., vol. xxvi.)
[456] Stratherrick.
[457] Neil, who at this period is writing from hearsay, is
quite wrong here. Glengarry was not at home and the house
was ‘without meat, drink, fire or candle, except some firr-
sticks!’ Had Ned Bourke not netted a couple of salmon, there
would have been nothing to eat. (L. in M., i. 89, 191.)
[458] Angus MacEachain (or Macdonald) was a son-in-law
of Angus Macdonald of Borradale. He had served in the
campaign as a surgeon in Glengarry’s regiment.
The family of MacEachain-Macdonald of Drimindarach,
Arisaig, was a branch of the Clanranalds, descended from
Eachain (or Hector), a younger son of Roderick, 2nd
Clanranald. Neil MacEachain was of the MacEachains of
Howbeg, a junior branch of the sept. Both families have long
since resumed their earlier name, Macdonald, dropping the
name MacEachain.
[459] This was the Prince’s second visit to Borradale
House on Lochnanuagh. It was here he stayed on his first
landing in July 1745. He came again to Borradale in July 1746,
after his wanderings in the Hebrides, by which time the house
had been burned down by Cumberland’s soldiers; he finally
returned to Borradale on 19th September, whence he sailed
for France the following day. Angus Macdonald, the tacksman
of Borradale, was a son of the 5th laird of Glenaladale, a cadet
of Clanranald’s, and was a first cousin of Flora Macdonald.
Borradale’s descendant, Colonel John Andrew Macdonald, is
to-day laird of Glenaladale.
[460] Captain Felix O’Neille, born at Rome, son of a
brigadier in the Spanish service. He served in the Spanish
army until 1744, when he joined Lally’s French-Irish regiment
as captain. Was sent to Scotland with despatches from the
Duc de Richelieu in March 1746. After Culloden he
accompanied Prince Charles during the first two months of his
wanderings and shared his discomforts. He was captured in
Benbecula by Captain John Ferguson of the Furness. He was
confined in Edinburgh Castle until February 1747, when he
was released on parole and subsequently exchanged (Scots
Mag., ix. 92). He wrote a journal of his wanderings, which is
printed in The Lyon, i. 102, 365.
[461] John William O’Sullivan; b. in Co. Kerry, 1700;
educated in France and Rome for the priesthood, and, it is
said (Fielding’s True Patriot), took orders. Entered the family of
Maréchal de Maillebois as tutor, afterwards secretary. Joined
the French army and served under Maillebois in Corsica;
afterwards in Italy and on the Rhine. Recommended to
D’Argenson as an officer ‘who understood the irregular art of
war better than any other man in Europe, nor was his
knowledge in the regular much inferior to that of the best
general living.’ Entered the household of Prince Charles about
1744; accompanied him to Scotland and acted as adjutant-
general, as well as private adviser, during the campaign. Was
with the Prince in his wanderings until 20th June. Escaped to
France in a French cutter. Knighted by the Chevalier about
Christmas 1746, and created by him a baronet of Ireland 1753.
Date of death not ascertained.
[462] Donald Macleod of Gualtergil, on Dunvegan Loch,
Skye, the faithful ‘Palinurus’ of Prince Charles from 21st April
to 20th June. He was captured in Benbecula in July, and taken
to London in Ferguson’s ship; released June ’47; died at
Gualtergil in May ’49, aged 72. His wife was a sister of
Macdonald of Borradale and a first cousin of Flora Macdonald.
[463] It seems absurd to write of seizing the boat and
stealing away. In addition to the Prince’s five attendants,
O’Sullivan, O’Neil, Allan Macdonald, Ned Bourke, and Donald
Macleod, there was a crew of seven boatmen, probably the
servants of Borradale who must have known. It is true,
however, that the Prince’s intended departure was concealed
from most of the Jacobite officers assembled in Arisaig.
[464] Neil is right as to the day of the week, but wrong as to
the day of the month. It should be Sunday, 27th April. See
Itinerary.
[465] Rev. John Macaulay, son of the Rev. Aulay Macaulay,
minister of Harris, was ordained parish minister of South Uist
in May 1745. He was subsequently minister of Lismore and
Appin 1755; Inverary 1765, and finally of Cardross 1775. He
died 1789. At Inveraray he had a good deal of intercourse with
Dr. Johnson in 1773, duly recorded by Boswell in the Tour to
the Hebrides. John Macaulay was the father of Zachary
Macaulay, and grandfather of Lord Macaulay.
[466] i.e. Neil MacEachain.
[467] Rev. Aulay Macaulay, formerly of Tyree; appointed to
Harris 1712; died 1758; aged about eighty-five.
[468] Rev. Colin Mackenzie was not minister of Stornoway
but of Lochs, the parish to the south of Stornoway.
[469] Should be 30th April.
[470] Donald Campbell was the brother-in-law of Hugh
Macdonald of Baleshare and of Donald Roy Macdonald, the
former of whom is mentioned later on; the latter, though of the
family of Sleat, had served in Glengarry’s regiment. Donald
Roy took over charge of the Prince when he said farewell to
Flora Macdonald at Portree in Skye. (L. in M., ii. 21.) An
anecdote of Campbell’s fidelity to the Prince when he
protected him against a party headed by Aulay Macaulay the
minister is given in the Itinerary. Neil MacEachain does not
love Donald Campbell, but Ned Bourke, who was one of the
party, calls him ‘one of the best, honestest fellows that ever
drew breath.’ (L. in M., i. 191.)
[471] Lady Kildin should be spelt Kildun. This lady was the
wife of Colin Mackenzie of Kildun, a grandson of the 2nd Earl
of Seaforth. Mackenzie’s sister was the second wife of Donald,
16th Clanranald, the mother of Macdonald of Boisdale, and
stepmother of old Clanranald of the ’45. From private letters
belonging to Frances, Lady Muir Mackenzie, I find that Colin
Mackenzie was then in London.
[472] Neil MacEachain is all wrong here in the sequence of
events and in his dates. He was writing from hearsay only. The
true sequence will be found with authorities for the same in the
Itinerary, pp. 48-50.
[473] A quarter of a peck of oatmeal not threshed, but burnt
out of the ear.
[474] This was strictly in accordance with Hebridean
honesty, continued to this day. The Prince desired to leave
money on the rocks to pay for the fish, but O’Sullivan and
O’Neille (not the islanders) dissuaded him. Cf. L. in M., i. 172.
[475] Prince Charles landed in Benbecula, Clanranald’s
island, on 11th May, and from this time onward Neil writes from
knowledge, not hearsay.
[476] South Uist.
[477] Ranald was afterwards taken prisoner and sent to
London.
[478] Corradale is a picturesque valley situated in the
mountainous part of South Uist, which occupies the middle of
the east side of the island, whose northern, western, and
southern confines are wonderfully flat. Corradale lies about the
middle of this district, running north-west from the sea,
between the mountains Hekla and Benmore, each about 2000
feet high. If approached by sea it was easy for a fugitive to get
away to inaccessible hiding-places in the mountains, while if
attacked from the land he could escape by sea. Prince
Charles’s lodging was a forester’s house not far from the
shore. On the north side of the glen, close to the sea, there is
a fairly commodious cave, traditionally but erroneously the
dwelling-place of the Prince. This cave was probably the rock
under which Neil left the Prince while he looked for strangers.
Considering the weather to be expected in this island, there
can be little doubt that the Prince often sat there for shelter
while he looked out for passing ships, as the cave commands
an excellent view of the offing to the south-east.
[479] The actual stay at Corradale was from 14th May to
5th June, although the Prince was in South Uist until 24th
June. For details, see the Itinerary.
[480] See ante, p. 213, and Introduction.
[481] Moidart.
[482] In Ordnance Survey Glen Quoich, to the west of Loch
Garry. I have no knowledge of the actions here referred to.
[483] Donald Macdonald, second son of Clanranald, served
as captain in his brother ‘Young Clanranald’s’ regiment
throughout the campaign. His mother was Margaret, d. of
William Macleod of Luskintyre, son of Sir Norman Macleod of
Bernera, and Catherine, d. of Sir James ‘Mor’ Macdonald of
Sleat, 2nd bart. Donald’s uncle, Alexander Macleod, was at
this time laird of Luskintyre in Harris. Donald was afterwards
captured and imprisoned in Edinburgh Castle, but discharged
without trial. In 1756 he joined Fraser’s Highlanders (the
Master of Lovat’s); fought with Wolfe at Quebec and was killed
in a subsequent action.
[484] i.e. Boisdale.
[485] Hugh Macdonald of Baleshare, an island to the
south-west of North Uist, was of the Sleat family, his father
being a natural son of Sir James ‘Mor,’ 2nd bart., and his
mother a daughter of the 13th Clanranald. As Sir Alexander of
Sleat and Lady Clanranald were both great-grandchildren of
Sir James ‘Mor,’ they were nearly related to Baleshare, being
in the Scots phrase ‘first-cousins once removed.’ Baleshare’s
sister was the wife of Donald Campbell, the Prince’s host in
Scalpa. Hugh of Baleshare had been sent to South Uist by
Lady Margaret Macdonald, the wife of Sir Alexander of Sleat
then in attendance on Cumberland at Fort Augustus, while his
men were out against the broken Jacobites. Lady Margaret
had sent Baleshare secretly with money and little luxuries to
relieve the Prince’s discomfort and to help him generally. At
one time it was proposed that Baleshare should conceal
Prince Charles in his own island, but the scheme was
abandoned as it might compromise his chief, Sir Alexander.
[486] This power of drinking seems to have made a great
impression. Baleshare told Bishop Forbes that the Prince ‘still
had the better of us, and even of Boystill [Boysdale] himself,
notwithstanding his being as able a boulman as any in
Scotland.’ It is generally assumed that Prince Charles acquired
his drinking habits as a result of his hardships in Scotland, yet
his anxious father had detected symptoms of an over-
fondness for wine even before he left Rome in 1744. In a letter
to Colonel O’Bryen (Lord Lismore), his envoy at the French
Court, in August 1745, the Old Chevalier writes: ‘La grande
vivacité du Prince, son penchant pour toutes sortes de
divertissements, et un peu trop de goût qu’il sembloit alors
avoir pour le vin, leur ont faire croire faussement qu’ils avoient
gagné quelque chose sur son esprit et il devint bientôt par là
leur Héros.’ (Stuart Papers, Browne, Hist. of the High., iii. 445.)
[487] See post, p. 249, n. 3.
[488] Should be Ulinish. He was a first cousin of Sir
Alexander Macdonald, whose mother was a Macleod of
Greshornish. Alexander Macleod was made sheriff-substitute
in Skye in 1773. In 1791 he was alive and in his 100th year.
[489] Captain John Ferguson was the fourth son of George
Ferguson, one of six brothers, members of a family long
resident at Inverurie. The eldest was the celebrated or
notorious ‘Ferguson the Plotter’ of the late seventeenth and
early eighteenth centuries; other brothers founded the families
of Pitfour and Kinmundy. George lived and died at Old
Meldrum near Inverurie, so it may be supposed that his son,
John, was born there. Nothing is known of his early career, but
in 1746 John Ferguson was in command of H.M.S. Furness,
(which is always spelt Furnace in the Scottish journals and
narratives of the time), and was employed in hunting fugitive
Jacobites. He was the ‘black captain’ of the ’45, one of the
most active and ruthless of the Government officers. His
cruelties are a constant theme in Jacobite annals (see the
Lyon from the index). Captain O’Neille, who was one of his
prisoners, states that Ferguson used him with the barbarity of
a pirate, stripped him, and ordered him to be put into a rack
and whipped by his hangman because he would not confess
where he thought the Prince was. (L. in M., i. 374.) Ferguson
was promoted in the same year, by the express interference
and recommendation of the Duke of Cumberland, to be
captain of the Nightingale, a new frigate just launched. He died
in 1767. (Records of Clan Ferguson, p. 280.) Ferguson’s
greatest exploit was the capture of Lord Lovat, which was
effected with skill. Lovat had taken refuge in an island on Loch
Morar, a fresh-water lake, and had removed all the boats on
the loch to the island. Ferguson landed a party, who saw the
fugitives, whom they could not reach, and by whom they were
greeted with cries of derision. He then sent a boat ashore from
his ship, carried it over a mile or so of rugged country, and
launched it on Loch Morar. Lovat’s party rowed rapidly up the
loch, and got on shore, but after three days’ concealment, the
old lord, unable from infirmities to continue the struggle,
determined to give himself up, sent word to his pursuers and
surrendered to Captain Dugald Campbell of Achacrossan of
the Argyll Militia.
[490] Fuyia, which I have corrected from Fugia in the N. M.
Maga., as it is a manifest error of the copyist or printer. Fuyia
gives the local pronunciation of the name of the island, which
is generally spelt Ouia in the Lyon, and Wiay in the Ordnance
Survey maps. It is spelt Fouay on p. 253.
[491] Alexander Macdonald of Boisdale (Clanranald’s step-
brother) was carried prisoner to London, and kept there until
July 1747, when he was released.
[492] This was Boisdale’s third wife, Anne, daughter of
Macneil of Barra.
[493] Captain Carolina Frederick Scott shares with
Ferguson and Lockhart eternal infamy for his superlative
cruelty to the hunted Jacobites of the Western Highlands. I
found his name and that of Ferguson still perfectly
remembered in the Outer Hebrides, and received with
execrations. He was an officer of Guise’s regiment, the 6th
(now the Royal Warwickshire). His satanic zeal, like
Ferguson’s, was rewarded with promotion. In November 1746
he was appointed major in his regiment in the room of Major
Wentworth, who was cashiered for surrendering Fort Augustus
to the Jacobites (March 5th), when three companies of Guise’s
regiment were made prisoners of war.
[494] Meaning Captain O’Neille.
[495] This is the Beinchillkoinnich of the Lyon (i. 329), the
Beinn Ruigh Choinnich of the Ordnance Survey; a hill on the
north side of Loch Boisdale, 900 feet high, from whence the
low-lying country of South Uist can be viewed from sea to sea.
On the northern spur there is a cave accessible only by a
precipitous narrow ledge, where shelter from the weather
could be had and an outlook to the Minch. Local tradition
associates this cave with the Prince. He possibly took shelter
there on this momentous day. South Uist, even in summer, is a
very rainy island.
[496] Hugh Macdonald of Armadale, in Skye, was Flora
Macdonald’s step-father. He was a grandson of Sir James
‘Mor’ Macdonald of Sleat, and was thus a first cousin of Sir
Alexander’s father, and of Lady Clanranald’s father, as well as
of Baleshare and Mrs. Campbell of Scalpa. He was a captain
in one of Sir Alexander Macdonald’s independent companies
out against Prince Charles. He had formerly been an officer in
the French army. (Henderson’s Life of Cumberland, p. 299.)
[497] Daughter of Alexander (Montgomerie), 9th Earl of
Eglinton. Married as his second wife to Sir Alexander
Macdonald of Sleat; d. 1799.
[498] At Alisary, on the slopes of Sheaval, a hill to the south
of Loch Eynort, and rising to the north-east from Flora’s old
home of Milton (or Arrivoulin) on the low ground near the
ocean. This was the hill pasture of her brother’s farm to which
the cattle were driven in summer, while the owners occupied
‘shielings’ or temporary huts in the neighbourhood. It was an
excellent place to meet. The western side of the island is a
wide belt of dead level links formed by the sand thrown up by
the swell of the Atlantic, and known as ‘the Machar.’ No
wayfarer on the Machar could easily escape detection even if
he were miles away, and it was the night of the full moon.
Flora’s shieling was near the western end of the hill region of
South Uist, and just about as far west as the Prince could have
dared to go without losing the shelter of the hills.
[499] Benbecula, that part of the ‘Long Island’ lying
between North and South Uist, and joined to these islands by
sea-fords passable only at low tide and thus easily guarded.
[500] I found that the custom of nick-naming local
notabilities after distinguished statesmen still exists. When I
was visiting these islands fifteen years ago I met a crofter
known as ‘Gladstone’ on account of his financial ability and his
persuasive powers of (Gaelic) oratory, and there were others
whose nick-names I have forgotten.
[501] I obtained a very interesting confirmation of this story
from an aged cailliach when in the islands. She told me that a
family of Campbells, who lived near Loch Eynort or Loch
Skipport, had rowed the Prince and Neil MacEachain to
Benbecula, and that the Prince was furiously angry with them;
but her explanation of his anger was that the boatmen were
Campbells, a name not beloved in the Outer Hebrides: no one
had ever thought of the terrifying effect of a tidal island on a
stranger. Cf. R. L. Stevenson’s Kidnapped, ch. xiv.
[502] A tenant who takes stock from the landlord and
shares with him in the increase.
[503] Clanranald’s residence in Benbecula.
[504] A hill named Rueval, 400 feet above sea level, the
only high ground on a very flat island. A projecting rock, on the
south side of the hill, which gives considerable shelter and
affords a wonderful view of the country, is probably the spot
where the Prince lay waiting for Flora.
[505] John Campbell of Mamore; b. about 1693; d. 1770;
suc. as Duke of Argyll on the death of his cousin, the 3rd duke,
in 1761. He had command of the troops in the west of
Scotland in 1745, with headquarters at Dumbarton. He
pursued Prince Charles through the islands, hunting for him as
far away as St. Kilda. He was on his way back from that island
when he nearly captured the Prince at Benbecula. Many of the
Jacobite prisoners passed through his hands, and, as a rule,
he was kind to them, contrasting favourably with such men as
Scott and Ferguson.
[506] Spelt Loch Uskavagh in the Ordnance Survey.
[507] i.e. Neil MacEachain.
[508] The home of Sir Alexander of Sleat at this time was
Monkstat House (also spelt Mongstat, Mougstot and other
variations), in the parish of Kilmuir, Trotternish. It was built on
the site of an ancient monastic foundation near the shores of a
lake named Columbkill, since then drained and parcelled into
crofts. The ancient home of the family was Duntulm Castle,
about five miles north of Monkstat, but during the troubles of
the Revolution it is said to have been burnt by a party landed
from a warship. Local legendary lore gives various other
versions of the reason for abandoning Duntulm. By one
account the family was driven from the castle by the ghost of
Donald Gorm, a sixteenth-century ancestor. By another, it was
owing to the death of a child of the family, who was killed by a
fall from a window of the castle, which is built on the edge of a
precipitous rock overhanging the sea. Monkstat was built in its
stead.
[509] Alexander Macdonald of Kingsburgh, a senior cadet
of the Sleat family, was the 6th in descent from James, a
younger son of Donald Gruamach, 6th in descent from John,
Lord of the Isles and the Princess Margaret. Kingsburgh was
Sir Alexander’s factor in 1746. His house was on Loch Snizort,
about eight miles south of Monkstat.
[510] The garrison belonged to the Macleod Militia, and the
officer in command was Alexander, son of Donald Macleod of
Balmeanach.
[511] Robert Craigie of Glendoick, Perthshire; b. 1685;
advocate 1710; Lord Advocate 1742-46; Lord President 1754;
d. 1760.
[512] App. 1. Printed in Chiefs of Grant, ii. 144. From
Edinburgh, telling of rumours of the Pretender’s eldest son
who had sailed from France. Requesting intelligence for
government and expressing his belief that Grant will do all in
his power to support government.
[513] App. 2. C. of G., ii. 146. Of Grant’s zeal for H. M. and
the government he never doubted. First intelligence
ridiculously exaggerated, and had delayed military advance,
but now Cope will be soon in your neighbourhood which ‘with
the assistance of H. M. friends it’s hoped will restore quiet to
the country.’
[514] Near Aberfeldy; Cope reached it when marching to
the Highlands from Stirling on 23rd Aug. He reached Trinifuir
the 24th; Dalnacardoch 25th; Dalwhinny 26th.
[515] App. 3. Mr. Grant to Sir John Cope, dated 25th Aug.
—Upon the first Information I had of the Pretender’s son
landing in the north west Highlands I came to this part of the
Country, and conveened all the Gentlemen of my name, and
gave them Directions to prepare as well as they could to keep
the Peace of the Country. I and my Friends have had great
vengeance denounced against us by those Clans, who are in
arms, for the appearance we made for the Government at the
Revolution, and in the year 1715. We have been preparing to
defend ourselves the best we could; But now all my Fears are
dissipate, as I am informed you are marching to attack those
Rebells, when I think of your abilitys and experience, no doubt
can remain with me, but that the Highlanders will run before
you. I wish you from my heart all Success. I have sent the
Bearer a cousin of mine who has served several years in the
army, to give you all the Information he can, and to assure you
of my zeal for the Support of his Majestys Service and
Government, I am with esteem, Sir, etc.
[516] This date is wrong; Cope reached Ruthven 27th
August; Dalrachny’s (Carrbridge) 28th August; Inverness 29th
August. (See Itinerary and authorities there quoted.)
[517] All this is disingenuous and quite anachronic. The
Duke of Perth, it is true, had fled from Drummond Castle on
24th July, and taken refuge in Braemar, but he had left long
before this, for he was back at Machany in Perthshire on 9th
August. (Jac. Lairds of Gask, pp. 103, 104.) Cluny
Macpherson at this time had declared openly for government,
had accepted a commission as captain in Lord Loudoun’s
Highland regiment, and was now actually raising his men for
King George. He was seized by Lochiel on 28th August,
carried prisoner to Perth, and not released until the 9th or 10th
September, when he undertook to join the Prince. He returned
to Badenoch, and not until then raised his men for the Stuart
Cause. The Mackintoshes at this time were arming for King
George, under their chief, who was a captain in the Highland
regiment (Black Watch); it was not until considerably later that
they deserted their chief to join Prince Charles under Lady
Mackintosh.
[518] Alexander Brodie of Brodie, Morayshire; M.P.
Inverness Burghs; appointed Lyon-King-of-Arms 1727; d.
1754. His daughter married John, eldest son of Macleod of the
’45.
[519] App. 4. C. of G., ii. 149. A letter of indignant
remonstrance. Cope cannot attack highlanders in their passes
or strongholds without highlanders to flank the regular troops.
If the king’s highland friends fail him we are undone, and all of
us must be at the mercy of the rebels. The writer is told that
Grant’s people refuse to join him (Grant) if he joins Cope or
marches out of his own country. Let him beware of counsels
that will lead to his ruin. Grant should not give himself the airs
of having a clan that can support and serve the government if
when it comes to the push they tell him they won’t go along
with him. Grant had written to Cope expressing his readiness
to join and assist him, but he would neither join him nor assist
him with one man, nor go near him, although Cope stopped at
Aviemore and spent the night at Dalrachny’s (Carrbridge)
within ten miles of Grant. Rose of Kilravock, Lord Moray,
General Cope and President Forbes are all disappointed with
him. Grant’s uncle, the major (governor of Fort George,
Inverness Castle) is very angry. It would have been far better if
Grant had given no assurances if he were not sure he could
fulfil them. The writer is distressed about what people are
saying of Grant at Inverness. How glorious it would have been
if he had been the first man in the country to join the king’s
forces. The President has got two hundred stand of arms for
the laird of Mackintosh, who is to join Cope with two hundred
men. Munro, Mackays, Sutherland, Seaforth and others are
raising their men for government. The writer is to meet Cope
and President Forbes on Tuesday (3rd September), what is he
to say of or for Grant at that interview?
A separate piece of paper contains this rider, ‘I would not
have been so strong if it had not been with a design, that you
might show it to those of your own people that I am told are
not for leaving your own countrey; so hope you’ll forgive any
strong expressions, as my meaning is to serve you.’
[520] Ludovick Grant’s uncle.
[521] App. 5. C. of G., ii. 152. Duke of Gordon claims a right
to the superiority over Morange, and Glenbucket (the Duke’s
former commissioner) was threatening the people if they did
not join him.
[522] App. 6. C. of G., ii. 155. Grant’s situation had made it
absolutely impossible to wait on Cope when in his
neighbourhood; tells of Glenbucket’s movements; also that
very few have joined the Pretender’s son north of Badenoch;
Glenbucket only got 130 men from Strathdoune (Strathavon)
and Glenlivet.
[523] James Ogilvy, eldest son of the 5th Earl of Findlater
and 2nd Earl of Seafield; b. 1715; suc. as 6th Earl 1764; d.
1770. He was a brother-in-law of Lord George Murray, being
married to his step-sister Lady Mary. He was also brother-in-
law to Ludovick Grant, who married (1735) Deskford’s sister,
Lady Margaret, a union which two generations later (1811)
brought the Earldom of Seafield (but not of Findlater) to the
Grant family.
[524] App. 7. C. of G., ii. 160. Protests against the granting
of one company only, but Lord Deskford has explained and he
acquiesces; he names as officers for the independent
company—Capt., Grant of Rothiemurchus; Lieut., Robert
Grant, son of Easter Duthill; Ensign, William Grant, yr., of
Dellachapple.
[525] App. 8. C. of G., ii. 160. (From Culloden.)
[526] App. 9. C. of G., ii. 162. (From Culloden.)
[527] The Macphersons under Cluny joined the Prince at
Edinburgh (nine or ten marches distant) on 31st October. The
Mackintoshes joined the reserves at Perth (five marches) on
30th October.
[528] Accidentally shot at Falkirk the day after the battle.
[529] App. 10. Angus MacDonell, second son to Glengerry,
to the Baillie of Urquhart, dated Delchannie, 30th Sept.—This
serves to give you notice, that I am this far on my way to
Glengerry, and being clad with the Princes orders to burn and
harrass all People that does not immediately join the Standart
and as I have particular orders to raise your Country, I do by
these begg the Favour of you on receipt of this to have at least
100 men ready in 5 days after receipt of this to join my
Standart at Invergarry, and tho contrary to my Inclinations, in
case of not due Obedience to this my demand, I shall march to
your Country with the Gentlemen here in Company, Keppoch’s
Brother and Tirnadrish,[659] etc. and shall put my orders in
Execution with all Rigour. And as I have the Greatest Regard
for Grant and all his Concerns, I begg you’ll neither give your
Country nor me any Trouble, I do not chuse to give, and your
ready Compliance with this will much oblige him, who is
sincerely, Dr. Sir, your most humble servant.
P.S.—Let me have your answer p bearer, which will
determine me how to behave.
App. 11. Mr. Grant to the Gentlemen of Urquhart, dated
Castle Grant, 6th Oct.—Auchmony has communicate to me
the Subject you have had lately under your deliberation. All the
Return I will give you, considering what I formerly wrote to my
Chamberlain, and which he communicate to you is this, That
whoever among you dont comply with my directions in this
present conjuncture, which is to remain peaceable at home,
and to be ready to receive my Directions as your Superior, and
as Master of my own Estate, must resolve to obey me at your
own Peril. And as I have firmly determined that whosoever
shall insult me or disturb any part of my Estate shall meet with
the Returns such an Insult shall merite. I am hopefull none of
my neighbours will act a part by me, which I could not nor
cannot allow myself to think them capable of. I cannot
conceive the least title any man can have to command any of
my vassals or Tenants, but myself, therefore whoever deserts
me to follow any other at this Time, I must look upon it as a
disobedience to me, which I will never forgive or forget to them
and theirs. I am perfectly persuaded all the tenants will adhere
and keep firm to me, if they are not led astray by bad advice,
which I hope they will not follow.—I am, Gentlemen, your
Friend and will continue so, if not your own Fault.
App. 12. The Baillie of Urquhart to Mr. Grant, dated
Bellmackaen, 8th Oct.—In obedience to your orders I
convened all the Tenents of this Country this day, in order to
March them to Strathspey, and there was only 60 or 70 of the
Tenents, that agreed to go with me. Dell and I came with all
the men that joined us the length of Drumbuie, so far on our
way to Strathspey, and Coll MacDonald and all the Gentlemen
of this Country came up with us there, and one and all of the
Gentlemen but Sheuglie and his son swore publickly to the
Tenents, if they did not return immediately or two nights
thereafter, that all their Corns would be burnt and destroyed,
and all their Cattle carried away. And when the Tenents were
so much threatned by the Gentlemen as well as by Mr.
MacDonald, they would not follow me one foot further. And
upon the Tenents returning Mr. MacDonald assured me, that
this Country would be quite safe from any hurt from him and
not only so; but as some of the Gentlemen that came north
with him, had the same orders as he had to destroy this
Country, if we did not join them, he sincerely assured me, he
would do all he could to prevent these Gentlemen from
coming. And if he could not prevail upon them to keep back,
that he would run me an Express in a few days to put me on
my guard, and acquaint me of their coming; but one thing I
assure you of e’er ten days that this Country will be ruined.
Lord Lovat has not appointed a day for his marching as yet; for
I am told that he has the Meal to make that he carrys along
with him for his Men’s subsistance. There is a Report here this
day that there is 2000 French landed at Cromarty last
Saturday with Prince Charles Brother. You’ll please let me
have your advice how to behave; for I am in a very bad
situation. Please excuse this confused Letter, being in haste
and ever am, Honourable sir, Your most faithfull hubl sert.
P. Auchmony[660] did not act a right part.
App. 13. Mr. Grant to the Chamberlain of Urquhart, dated
Castle Grant, 10th Oct.—I received yours of the 8th this day
about Dinner Time. I am not at all surprised at the Conduct of
the Gentlemen of Urquhart; for as they seem determined to
disobey my repeated Orders, they want to prevail with my
Tenents to do so likeways. However now that they must have
heard, that General Legonier with at least 18,000 of our troops
that have come from Flanders and the Dutch, and that there is
12,000 Danes, and the Remainder of the British Troops dayly
expected, and that nobody even at Edinburgh pretended to
say, that the French can spare any of their troops, I fancy they
will soon see their Folly, and they must be satisfied in a little
Time, I will make them repent their Conduct, and they will see
the numbers they believed would join the Rebells, dwindle to a
very few, if any at all. Whenever you hear any Motions among
your neighbours make the best of your way for this Place and
see to bring these men with you, who were coming last day
and as many more as you can, and assure them I will see
what Losses they sustain repaid. And shall do all in my power
afterwards to save them when others must fly the country.
Dont let any of the Gentlemen know the day you design to
march over with the men, other ways they might bring a Possy
to stop you, which will not be in their Power if you be upon
your Guard. I think you ought to have Spyes in the
neighbouring Countries. See that you get money from the
Tenents, who are due, that we may clear when you come over.
[530] App. 14. C. of G., ii. 170. (From Inverness.) Claims
Grant as a relation and friend whom he finds, with great
satisfaction, acting so distinguished a part. The king has
appointed Loudoun to command the troops in this country; it
gives him the greatest pleasure to know that he has so
powerful and faithful a friend to support him in time of need.
[531] App. 15. C. of G., ii. 171. (From Culloden.) Urging
Grant to press forward his company; any expense after his
men are brought together shall be made good. Believes that
‘the thing will blow over without much harm,’ but Grant should
have his eye on as many of his people as he can arm, to be
ready for any emergency; ‘ways and means shall be fallen on
to subsist them.’
[532] App. 16. C. of G., ii. 175. Mr. Grant’s heart is full of
zeal for the preservation of our religion and liberties, and will
exert himself to do everything in his power for H. M. service,
and is perfectly happy ‘that we who are the friends of
government’ have Loudoun to advise and direct us. The delay
in his company’s joining Loudoun is caused by all his clan
vassals being ready, and he wishes the company to be all
volunteers. He foresees that there will be occasion to convene
all his men and he wants Rothiemurchus with him, and asks
for certain alterations in the commissions to his officers. All the
men of his company will have swords and most of them pistols
and dirks. Hopes to capture Capt. Gordon, who is levying cess
on his party as their arms will be useful. He is determined to let
none of the clans now in motion enter his county.
[533] App. 17. John Grant in Urquhart to Mr. Grant, dated
21st Oct.—The MacDonalds and Glenmoristones came into
this Country Saturdays night late, and Sundays morning. And
this day we expected the Master of Lovat with 200 men to join
the MacDonalds, who were in number six score, in order to
spreath [ravage] the Country, if the whole people did not join
them. The countrymen were all acquainted to meet this day at
Milntown, but few of them attended. And as the Master did not
come this day, as he appointed, sent word that he would be
here tomorrow morning, so that I am made to understand, that
they design to raise all their Cattle, and by that method are of
opinion, that the men will come present, and condescend to
march directly to the army before their Effects are carried off,
but I made the Bearer, who is the only one I could trust in,
advise the People to keep at a distance and allow them to
carry off their cattle, as I assured them that you would repay
them in what damage they might suffer that way. I cannot
acquaint you at this Time of the Gentlemens Disposition, but
tomorrow I shall send an Express, and give you a full account
of our Fate. Belintombs house was attacked; but I procured a
party from the Colonel to guard it this night. Is all on haste but
that I remain as becometh, Honble Sir your most ob. humble
servant.
I am informed they design to march by Inverlaidnan.
Barrisdale came this day from the north to this country; but did
not bring any men alongst with him.
App. 18. John Grant in Urquhart to Mr. Grant, dated 22nd
Oct.—The most of the Countrymen met this day at Bellymore
where Barrisdale came with a Commission from his Colonel to
them, assuring if they did not join him, that he was fully
resolved to spreath the whole Country. They all unanimously
replyed that in any Event, they would not disobey their masters
orders and his positive commands to them to sit peaceable at
home, and swore that while there was a drop of Blood in their
Bodys, they would not allow the Macdonalds to carry off their
Cattle. In a short Time thereafter the Master of Lovat
accompanied with all the Stratherrick Gentlemen came to
Milntown, and after a long Conference with Mr. MacDonald of
Barrisdale, he agreed that the MacDonalds in the Country
might be compelled to join the Colonel, as he was not in
readiness to march his men this week, but in the Event that
this did not satisfy Mr. MacDonald, he was to come in person
with 200 men tomorrow, to prevent their carrying off the Cattle,
and secure the rest of the men for his own use, as he believed
he had a better Title to them than any MacDonald in life. As
they could not agree upon the above terms, Barrisdale went
with the Master to Castle Downie to know my Lord’s
sentiments, and act accordingly. As this happens to be the
case we are as yet uncertain of our Fate, but shall to the
outmost of our Power, resist the MacDonalds if not assisted by
the Frasers Is all but that I remain as becometh, Honourable
Sir, Your most obedt humble servt.
[534] App. 19. C. of G., ii. 179. (From Culloden.) A letter to
Lord Deskford from the Lord President countersigned by Lord
Loudoun. In addition to what Grant quotes, they cannot
understand the unaccountable folly of his people that they
deliberate in entering the company and hope that they may be
persuaded to form it forthwith.
[535] App. 20. Lord Lewis Gordon to Mr. Grant, dated St.
Bridget,[661] 3rd Nov.—I take this opportunity to assure you of
the Esteem and Regard I have for yourself and all your Family,
and that I shall be always glad to do all in my Power to
maintain the good Correspondence that has so long subsisted
between the Familys of Grant and Gordon. And as you are
very sensible of the Situation of Scotland at present, I shall
take this occasion of delivering you the Prince Regents
Complements, and how much he would be obliged to you for
your aid at this important Time; and if you dont appear active
yourself, that you would not oppose the rising of your Clan,
which is so capable of Serving the King and Country. I hope
you will be so good, as to consider this seriously, and to
excuse this Liberty from a Friend, who does it with a pure
Intention of Serving his Country. I begg my Complements to
Lady Margaret and all your Family, as also to Lord and Lady
Findlater and Lord Deskfoord, to whom please tell, that what I
am to do for the Princes Cause in Banffshire, shall be
executed in the mildest and easiest manner in my Power.
Glenbucket will deliver this to you, and believe me to be, Dr.
Sir, with great Sincerity Your most affectionate ffriend and
Servant.
[536] This was the ancestral home of the family of John
Roy Stewart, the Jacobite soldier-poet.
[537] App. 21. C. of G., ii. 184. (From Inverness.) Grant’s
company had arrived the previous day, was a very good one,
the best clothed Loudoun had seen. Was sorry that Lord Lewis
Gordon had risen, but the Duke (of Gordon) had given orders
to his people not to join him. Few had done so. If Grant were
attacked his own power should make Lord Lewis repent; if not
strong enough Loudoun would do what he could for him.
[538] App. 22. C. of G., ii. 183. (From Culloden.)
[539] App. 23. C. of G., ii. 186. (From Castle Grant.)
[540] App. 24. C. of G., ii. 187. (From Inverness.) Lord
Loudoun declines to send the company back to Mr. Grant, as
he proposes to march through Stratherrick to Fort Augustus.
[541] Thomas Grant of Achoynanie, Keith, afterwards of
Arndilly, a cadet of Grant of Grant, best known as the early
patron of James Ferguson the astronomer. (Henderson, Life of
Ferguson, p. 18.)
[542] Alexander Grant of Tochineal, near Cullen.
[543] App. 25. Lord Lewis Gordon to Thomas Grant of
Auchynany, dated Huntly Castle, 6th Dec.—As Lord
Lieutenant of the Countys of Aberdeen and Banff, I am to raise
a man for each £100 of valued Rent within the same, and
where Fractions happen the same is to yield a Man. I hope,
therefore, you will be so good as to send to Keith Tuesday
next such a number of ablebodied men, as will answer to the
Valuation of your estate well cloathed in short cloaths, Plaid,
new Shoes, and three pair of hose and accoutred with
shoulder belt, gun, pistol and sword. I have appointed a proper
officer to attend at Keith the above day for receiving the men. I
need not tell a man of your good sense and knowledge the
hazard of not complying with the demand. Your Prudence will
no doubt direct you to avoid hardships of military execution,
wherein you’ll extremely oblige, Sir, your most humble servant.
App. 26. C. of G., ii. 190. Thomas Grant of Auchynanie to
Mr. Grant, 11th Dec. (From Arndillie.) Lord Lewis Gordon has
only 300 men, and of these only 100 have joined: mostly herds
and hire-men from about Strathbogie and unacquainted with
the use of arms; many of them are pressed and intend to
desert; 100 or 150 of Grant’s men would drive them to the
devil, and capture Lord Lewis and his prime minister Abbachy
(Gordon of Avochie). Lord Findlater’s tenants and the people
of Keith are being ruined by Abbachy and look to Grant as
their only saviour. If Lord Loudoun would take possession of
old Balveny Castle it would spoil Lord Lewis’s recruiting.
App. 27. Lord Findlater’s Steward[542] to his Lordship,
dated 11th Dec.—I had a Letter from John Saunders in Keith
upon Sabbath day night, informing me that there had 60 of
Lord Lewis men come to that place upon Saturdays night,
under command of one White and that he and others in that
place much wanted advice what to do. To whom I wrote for

You might also like