Linux Transfer for Windows Network Admins: A Roadmap for Building a Linux File and Print Server Michael Jang Hentzenwerke Publishing Published by: Hentzenwerke Publishing 980 East Circle Drive Whitefish Bay WI 53217 USA Hentzenwerke Publishing books are available through booksellers and directly from the publisher. Contact Hentzenwerke Publishing at: 414.332.9876 414.332.9463 (fax) www.hentzenwerke.com [email protected] Linux Transfer for Windows Network Admins: A Roadmap for Building a Linux File and Print Server By Michael Jang Technical Editor: Elizabeth Zinkann Copy Editor: Jeana Frazier Cover Art: “Network” by Todd Gnacinski, Milwaukee, WI Copyright © 2003 by Michael Jang All other products and services identified throughout this book are trademarks or registered trademarks of their respective companies. They are used throughout this book in editorial fashion only and for the benefit of such companies. No such uses, or the use of any trade name, is intended to convey endorsement or other affiliation with this book. All rights reserved. No part of this book, or the ebook files available by download from Hentzenwerke Publishing, may be reproduced or transmitted in any form or by any means, electronic, mechanical photocopying, recording, or otherwise, without the prior written permission of the publisher, except that program listings and sample code files may be entered, stored and executed in a computer system. The information and material contained in this book are provided “as is,” without warranty of any kind, express or implied, including without limitation any warranty concerning the accuracy, adequacy, or completeness of such information or material or the results to be obtained from using such information or material. Neither Hentzenwerke Publishing nor the authors or editors shall be responsible for any claims attributable to errors, omissions, or other inaccuracies in the information or material contained in this book. In no event shall Hentzenwerke Publishing or the authors or editors be liable for direct, indirect, special, incidental, or consequential damages arising out of the use of such information or material. ISBN: 1-930919-46-8 Manufactured in the United States of America. iii Our Contract with You, The Reader In which we, the folks who make up Hentzenwerke Publishing, describe what you, the reader, can expect from this book and from us. Hi there! I’ve been writing professionally (in other words, eventually getting a paycheck for my scribbles) since 1974, and writing about software development since 1992. As an author, I’ve worked with a half-dozen different publishers and corresponded with thousands of readers over the years. As a software developer and all-around geek, I’ve also acquired a library of more than 100 computer and software-related books. Thus, when I donned the publisher’s cap five years ago to produce the 1997 Developer’s Guide, I had some pretty good ideas of what I liked (and didn’t like) from publishers, what readers liked and didn’t like, and what I, as a reader, liked and didn’t like. Now, with our new titles for 2003, we’re entering our sixth season. (For those who are keeping track, the ‘97 DevGuide was our first, albeit abbreviated, season, the batch of six “Essentials” for Visual FoxPro 6.0 in 1999 was our second, and, in keeping with the sports analogy, the books we published in 2000 through 2003 comprised our third and subsequent seasons.) John Wooden, the famed UCLA basketball coach, posited that teams aren’t consistent; they’re always getting better—or worse. We’d like to get better… One of my goals for this season is to build a closer relationship with you, the reader. In order for us to do this, you’ve got to know what you should expect from us. • You have the right to expect that your order will be processed quickly and correctly, and that your book will be delivered to you in new condition. • You have the right to expect that the content of your book is technically accurate and up-to-date, that the explanations are clear, and that the layout is easy to read and follow without a lot of fluff or nonsense. • You have the right to expect access to source code, errata, FAQs, and other information that’s relevant to the book via our Web site. • You have the right to expect an electronic version of your printed book to be available via our Web site. • You have the right to expect that, if you report errors to us, your report will be responded to promptly, and that the appropriate notice will be included in the errata and/or FAQs for the book. Naturally, there are some limits that we bump up against. There are humans involved, and they make mistakes. A book of 500 pages contains, on average, 150,000 words and several megabytes of source code. It’s not possible to edit and re-edit multiple times to catch every last iv misspelling and typo, nor is it possible to test the source code on every permutation of development environment and operating system—and still price the book affordably. Once printed, bindings break, ink gets smeared, signatures get missed during binding. On the delivery side, Web sites go down, packages get lost in the mail. Nonetheless, we’ll make our best effort to correct these problems—once you let us know about them. In return, when you have a question or run into a problem, we ask that you first consult the errata and/or FAQs for your book on our Web site. If you don’t find the answer there, please e-mail us at [email protected] with as much information and detail as possible, including 1) the steps to reproduce the problem, 2) what happened, and 3) what you expected to happen, together with 4) any other relevant information. I’d like to stress that we need you to communicate questions and problems clearly. For example… • “Your downloads don’t work” isn’t enough information for us to help you. “I get a 404 error when I click on the Download Source Code link on www.hentzenwerke.com/book/downloads.html” is something we can help you with. • “The code in Chapter 10 caused an error” again isn’t enough information. “I performed the following steps to run the source code program DisplayTest.PRG in Chapter 10, and I received an error that said ‘Variable m.liCounter not found’” is something we can help you with. We’ll do our best to get back to you within a couple of days, either with an answer or at least an acknowledgment that we’ve received your inquiry and that we’re working on it. On behalf of the authors, technical editors, copy editors, layout artists, graphical artists, indexers, and all the other folks who have worked to put this book in your hands, I’d like to thank you for purchasing this book, and I hope that it will prove to be a valuable addition to your technical library. Please let us know what you think about this book—we’re looking forward to hearing from you. As Groucho Marx once observed, “Outside of a dog, a book is a man’s best friend. Inside of a dog, it’s too dark to read.” Whil Hentzen Hentzenwerke Publishing September 2003 v List of Chapters Introduction xix Chapter 1: Basic Linux Installation 1 Chapter 2: Installing Linux as a File Server 29 Chapter 3: Setting Up Your Server File System 59 Chapter 4: Setting Up Your File Server’s Users 105 Chapter 5: Connecting Linux Workstations 135 Chapter 6: Connecting Windows Workstations 153 Chapter 7: Configuring Printers 199 Chapter 8: Administration and Management 229 Chapter 9: System Backup 265 Appendix A: Samba 3.0 Preview 287 Appendix B: Sample Samba Configuration Files 291 vi vii Table of Contents Our Contract with You, The Reader iii Acknowledgements xiii About the Authors xv How to Download the Files xvii Introduction xix Chapter 1: Basic Linux Installation 1 Basic file server functions 1 Selecting a distribution 1 Red Hat Linux 3 United Linux 3 Other Linux distributions 4 A brief guide to installing Linux 4 1. Checking hardware 5 2. Planning partitions 8 3. Understanding the Filesystem Hierarchy Standard 9 4. Selecting a filesystem format 11 5. Preparing partitions and hard drives for dual booting 15 6. Basic steps to installing Red Hat Linux 24 Conclusion 27 Chapter 2: Installing Linux as a File Server 29 Basic terms 29 The installation nitty-gritty 30 Remaining steps 30 Configuring a firewall 31 Configuring communication through the firewall 32 Authentication 33 Samba authentication 34 Installing what’s necessary 35 Basic components 35 Basic components plus 35 Options 35 Other network services 39 After installation 40 First Boot 40 The Red Hat Linux GUI 43 The Red Hat Network 44 viii Rawhide 48 Other updates 48 Package management 48 Installing and upgrading RPMs 48 Using the rpm command 50 rpm command details 51 Uninstalling what is not necessary 52 Checking installed services 53 Getting more information 55 Uninstalling a service 56 Deactivating a service 56 Conclusion 58 Chapter 3: Setting Up Your Server File System 59 The Microsoft CIFS 60 Background 60 Basic look and feel 61 The NFS alternative—an overview 63 Basic administration 63 Process management 64 User categories 65 Configuring a Samba server 66 Getting Samba 66 Samba configuration files 67 Samba and firewalls 68 The Red Hat Samba Configurator 70 Samba Web Administration Tool 75 Configuring Samba in detail 84 Opening smb.conf in a GUI 85 Global settings 86 Defining shared directories and printers 94 Conclusion 102 Chapter 4: Setting Up Your File Server’s Users 105 Users and accounts 106 Linux user and group accounts 106 Configuring Samba users 111 Users on a Domain 114 Using the Microsoft user database 114 Setting up a Samba PDC database 118 File and directory management 121 Linux permissions 121 Default permissions 122 Linux file ownership 123 Limited support for Access Control Lists 123 ix Linux groups 123 Red Hat Linux’s private groups 123 Creating a special group 124 Quotas 127 The boot process 127 Configuring quota configuration files 128 Configuring quotas for a user 129 Configuring quotas for a group 131 Setting a grace period 132 Activating quotas 132 Conclusion 133 Chapter 5: Connecting Linux Workstations 135 Configuring the workstation 136 Samba client packages 136 Connecting to a Domain 137 Finding shared directories 137 Mounting directories 139 Linux login batch files 143 Peer-to-peer Workgroups 147 Setting up accounts 149 A PDC and a Windows Domain member server 149 Windows PDC and Linux Domain member server 150 Linux PDC and Linux Domain member server 151 Conclusion 152 Chapter 6: Connecting Windows Workstations 153 Preparing accounts 153 Logon scripts 154 Profiles 154 Configuring the Microsoft workstation 155 Connecting a Windows 95/98/ME workstation to a Domain 156 Creating a Windows 95/98/ME Workgroup share 167 Windows NT 4 Workstation 168 Windows 2000 Professional 177 Windows XP Professional 186 Text-mode network commands 193 Troubleshooting 195 Samba syntax 195 Samba logs 196 Conclusion 197
Description: