With the adoption of Samba and the availability of mature file sharing utilities such as FTP and NFS, the lines have blurred where files are located on a computer network. Windows Server 2003 also exposes many command line tools for management that can be accessed via telnet from Unix-based clients . Windows Server 2003 Must Be Run in Mixed Mode For interoperation with utilities such as Samba, Windows Server 2003 must be run in Mixed mode. With the updated version of Samba (3.0.0 RC2 as of this writing), Windows Server 2003 can be run in Windows 2000 mode. Accessing Windows with TelnetUnix system administration is predominantly command-line driven, with Telnet being one of the main tools of choice for this purpose. Windows Server 2003 has come a long way in providing command-line utilities, all of which are available through the Telnet server both natively and with Windows SFU. An administrator telnetting to a Windows Server 2003 session can, for example, run command line scripting utilities such as adsutil .vbs, as shown in Figure 16.16. Figure 16.16. adsutil.vbs command line usage via Telnet.
Telnet Server on Windows 2003 The Telnet Server on Windows 2003 is disabled by default. You need to set the startup to Automatic and start the service. Accessing Windows File ServicesOn a Unix-based system Samba uses the smbclient to access Windows-based shares. This is a command-line interface-based tool that has many functions besides just connecting to Windows shares. It can also be used for testing configurations, debugging, and automating administrative tasks when used in shell scripts. There are many combinations of variables and command line options with the smbclient. The following are a few examples: To list the resources in the domain (rtds is the domain controller and master browser): $ smblicent -L rtds To list the services on a single computer (rtws01), run this command: $ smbclient -L rtws01 To connect to a share using username/password authentication: $ smbclient //rtws01/shared -U username%password These are just a few examples of the smbclient command. The Samba documentation concerning smbclient contains a complete reference. Accessing Windows Print ServicesSamba allows the Unix/Linux user to print to a printer shared on a Windows system. This makes it convenient for you because you only have to set file and print sharing for Unix. Many Unix variants, including Linux, use what is called the BSD printing system. With this system all the printers that will be used have an entry in the /etc/printcap file. This file describes printer capabilities used by the line printer daemon (lpd) and other programs that assist with printing. Listing 16.1 shows a sample printcap.local file that shows a Hewlett-Packard LaserJet 4050 being shared on a Windows Server 2003 system named rtfnp. Listing 16.1 /etc/printcap.locallprtfnp-hplj4050:\ :cm=HP 4050 on rtfnp:\ :sd=/var/spool/lpd/rtfnp:\ :af=/var/spool/lpd/rtfnp/acct:\ :if=/user/local/samba/bin/smbprint:\ :mx=0:\ lp:=/dev/null: The Red Hat Linux /etc/printcap File In Red Hat Linux the /etc/printcap file is generated automatically and should not be edited. Any manual entries should be placed in the /etc/printcap.local file which is read by the /etc/printcap file. This entry describes the server and printer as follows :
This example can be used to create as many printers as desired on the client's Unix-based system. To set up Samba printing on the Unix client, perform the following steps:
Following this procedure you have created a default printer on the local system that will print to the hp 4050 share on the Windows Server 2003 system named rtfnp. To print a test page (/etc/ hosts file) to the default printer you can use the following command: # lpr /etc/hosts Using LPD/LPRTo print to a Windows-based printer from Unix using the LPR command, you must first set up Print Services for Unix on the Windows Server 2003 machine. This is accomplished by performing the following steps:
This procedure sets up what looks like a Unix server running the LPD service. The Unix system prints to this resource using the BSD printing system. |