Table of Contents for
Linux in a Windows World

Version ebook / Retour

Cover image for bash Cookbook, 2nd Edition Linux in a Windows World by Roderick W Smith Published by O'Reilly Media, Inc., 2005
  1. Cover
  2. Linux in a Windows World
  3. Dedication
  4. Preface
  5. Contents of This Book
  6. Conventions Used in This Book
  7. Using Code Examples
  8. Comments and Questions
  9. Safari Enabled
  10. Acknowledgments
  11. I. Linux’s Place in a Windows Network
  12. 1. Linux’s Features
  13. Linux as a Server
  14. Linux on the Desktop
  15. Comparing Linux and Windows Features
  16. Summary
  17. 2. Linux Deployment Strategies
  18. Linux Desktop Migration
  19. Linux and Thin Clients
  20. Summary
  21. II. Sharing Files and Printers
  22. 3. Basic Samba Configuration
  23. The Samba Configuration File Format
  24. Identifying the Server
  25. Setting Master Browser Options
  26. Setting Password Options
  27. Summary
  28. 4. File and Printer Shares
  29. Printing with CUPS
  30. Creating a Printer Share
  31. Delivering Printer Drivers to Windows Clients
  32. Example Shares
  33. Summary
  34. 5. Managing a NetBIOS Network with Samba
  35. Enabling NBNS Functions
  36. Assuming Master Browser Duties
  37. Summary
  38. 6. Linux as an SMB/CIFS Client
  39. Accessing File Shares
  40. Printing to Printer Shares
  41. Configuring GUI Workgroup Browsers
  42. Summary
  43. III. Centralized Authentication Tools
  44. 7. Using NT Domains for Linux Authentication
  45. Samba Winbind Configuration
  46. PAM and NSS Winbind Options
  47. Winbind in Action
  48. Summary
  49. 8. Using LDAP
  50. Configuring an OpenLDAP Server
  51. Creating a User Directory
  52. Configuring Linux to Use LDAP for Login Authentication
  53. Configuring Windows to Use LDAPfor Login Authentication
  54. Summary
  55. 9. Kerberos Configuration and Use
  56. Linux Kerberos Server Configuration
  57. Kerberos Application Server Configuration
  58. Linux Kerberos Client Configuration
  59. Windows Kerberos Tools
  60. Summary
  61. IV. Remote Login Tools
  62. 10. Remote Text-Mode Administration and Use
  63. SSH Server Configuration
  64. Telnet Server Configuration
  65. Windows Remote-Login Tools
  66. Summary
  67. 11. Running GUI Programs Remotely
  68. Using Remote X Access
  69. Encrypting X by SSH Tunneling
  70. VNC Configuration and Use
  71. Running Windows Programs from Linux
  72. Summary
  73. 12. Linux Thin Client Configurations
  74. Hardware Requirements
  75. Linux as a Server for Thin Clients
  76. Linux as a Thin Client
  77. Summary
  78. V. Additional Server Programs
  79. 13. Configuring Mail Servers
  80. Configuring Sendmail
  81. Configuring Postfix
  82. Configuring POP and IMAP Servers
  83. Scanning for Spam, Worms, and Viruses
  84. Supplementing a Microsoft Exchange Server
  85. Using Fetchmail
  86. Summary
  87. 14. Network Backups
  88. Backing Up the Linux System
  89. Backing Up with Samba
  90. Backing Up with AMANDA
  91. Summary
  92. 15. Managing a Network with Linux
  93. Delivering Names with DNS
  94. Keeping Clocks Synchronized with NTP
  95. Summary
  96. VI. Appendixes
  97. A. Configuring PAM
  98. The PAM Configuration File Format
  99. PAM Modules
  100. Sample PAM Configurations
  101. Summary
  102. B. Linux on the Desktop
  103. Configuring Applications and Environments
  104. Running Windows Programs in Linux
  105. File and Filesystem Compatibility
  106. Font Handling
  107. Summary
  108. Index
  109. Colophon

Chapter 6. Linux as an SMB/CIFS Client

Linux often functions as a tool for running Samba as a server on a network that’s otherwise dominated by Windows systems. Sometimes, though, you might need to reverse this role and have Linux function as the client in an SMB/CIFS environment. Perhaps a few Linux desktop systems must access Windows servers; maybe a Linux system that works as a server for other protocols must do so. Whatever the details, the Samba package includes client tools, and the Linux kernel also supports accessing SMB/CIFS file shares. Thus, Linux can function in the client role, using Windows, Samba, or other SMB/CIFS servers on other computers.

This chapter covers several specific client roles for Linux on an SMB/CIFS network: using NetBIOS name resolution, accessing file and printer shares, and using GUI network browsers for Linux.

Using NetBIOS Name Resolution

As described in Chapter 3 and Chapter 5, NetBIOS provides a computer-naming system that’s independent of DNS, which is used by most TCP/IP protocols. In fact, Windows enables its clients to use these NetBIOS names in place of DNS names for most protocols, at least for local computers. For this reason, some LANs rely heavily on these names, and if you want to refer to computers by name rather than by IP address from Linux, you may need to know how to configure Linux utilities to use these addresses. For the most part, this task can be handled with a setting or two in smb.conf. If your LAN doesn’t use DNS hostnames for its local computers, though, you may want to expand this configuration to enable Linux to use NetBIOS names in non-SMB/CIFS tools, such as web browsers and email clients.

Setting Name Resolution Options in smb.conf

Most SMB/CIFS client tools in Linux support the use of NetBIOS names. These tools rely on libraries that ship with Samba and that are configured in the [global] section of your smb.conf file. In particular, you should review the name resolve order, wins server, and hostname lookups parameters, all of which are described in Chapter 3. For the most part, the default settings work well on small LANs that are configured to use broadcast name resolution. You might want to set hostname lookups = Yes if you want to specify computers by their DNS hostnames in smb.conf, though. If your network hosts an NBNS system, you may also want to point Linux systems to it with wins server.

Warning

If a computer functions as an NBNS system, do not set wins server. Even pointing the server to itself with this parameter can result in odd behavior.

The parameter that requires the most attention is name resolve order. This parameter takes one to four of several values: lmhosts, hosts, wins, and bcast. The default lookup order is lmhosts host wins bcast, which minimizes the use of network resources. You can change this order if you like, though, or even omit options entirely. For instance, suppose you know your lmhosts file is empty, and suppose you don’t want to use DNS except as a last resort because of possible name conflicts. You might then include these lines in smb.conf:

name resolve order = wins bcast hosts
wins server = 192.168.24.1

Using NetBIOS Name Resolution in Non-Samba Programs

In most cases, the NetBIOS name-resolution methods you set with name resolve order and other options in smb.conf apply only to Samba and related tools. These name-resolution methods have been split off into a library, though, and it’s possible to splice this library into Linux’s normal name-resolution system. When you configure Linux this way, you can use NetBIOS names in any Linux program that employs the normal name-resolution system, such as web browsers, mail clients, FTP clients, and so on. This can be a handy way to get name resolution working on a small network that doesn’t have its own DNS server. (You’d presumably use your ISP’s DNS server for handling names on the Internet, but it might not have entries for your local computers.)

Using NetBIOS names for non-SMB/CIFS tools can be convenient, but it can also cause problems. NetBIOS names lack Internet domain names, and so a few programs that rely on Internet domain names can choke if they’re fed NetBIOS names. If DNS and NetBIOS names don’t match, you can also cause problems when reverse lookups don’t match forward lookups or when one name masks another one. These problems aren’t always serious, but if you see strange error messages about failed lookups, you might want to consider using local /etc/hosts files or running your own DNS server for local use, as described in Chapter 15.

The first step to using NetBIOS name resolution in non-Samba programs is to check for the presence of the necessary support libraries. These appear under the name libnss_wins.so (typically with a symbolic link called libnss_wins.so.2), usually in /lib. If you can’t find these files, you may need to install additional or newer Samba packages for your distribution. If you compiled Samba from source code, try typing make nsswitch from the Samba source directory, copying the resulting nsswitch/libnss_wins.so file to /lib, and creating a symbolic link called libnss_wins.so.2. Usually, you will need to type ldconfig to have the system recognize the new library.

Once the library is installed, you must configure Linux to use it. This task can be accomplished by editing /etc/nsswitch.conf. Look for the hosts line in this file. It probably contains entries for files, dns, and perhaps other name-resolution methods. Add wins to this list:

hosts: files dns wins

Linux tries name lookups in the order specified, so this example uses NetBIOS name lookups as the last resort. You might want to move wins earlier in the list, but doing so increases the odds for problems should a name be resolved in multiple ways and a program needs an Internet domain name.

Tip

Although the option in /etc/nsswitch.conf is called wins, the name-resolution system it enables works with both NBNS systems and broadcast name lookups. The libnss_wins.so library uses the NBNS computer specified by the wins server parameter in smb.conf, but it ignores the name resolve order parameter.