Recipe 13.5. Setting Up and Configuring a Telnet Server


Problem

You want to set up a Telnet server to allow Telnet access into a machine.

Solution

When you install XP Professional, it installs a Telnet server. The server is not part of IIS, though, and you don't administer it using IIS. Although the Telnet server is installed, by default it is not enabled. To enable the server:

  1. From the Control Panel, select Administrative Tools Services, to run the Services console.

  2. Find the Telnet service in the list and click the Start button on the toolbar. That will enable it, and you can now use it.

  3. At whatever point you restart your computer, the server won't restart by itself. You'll have to configure it to start whenever XP starts.

  4. To have the server automatically restart when XP starts, double-click on it in the Services console, and select Automatic from the Startup Type drop-down list. Then click OK.

  5. Starting the server won't by itself allow users to use Telnet on your system. To allow Telnet access, you have to create a group named TelnetClients, and then add users to the group who you want to be able to use Telnet. (For information on how to create groups, turn to Recipe 15.10.)

  6. Once you've created the group and started the Telnet server, users can Telnet into the system.

Discussion

Whenever someone logs into your Telnet server, a default logon script is run after the command console is opened. You can edit the script to change the welcome message and the home directory that the user logs into. To do that, use a text editor to open the file Login.cmd located in the C:\Windows\System32 folder. Following is a default script:

@echo off rem rem  Default global login script for the Telnet Server rem rem  In the default setup, this command script is executed when the rem  initial command shell is invoked.  It, in turn, will try to invoke rem  the individual user's login script. rem echo *=============================================================== echo Welcome to Microsoft Telnet Server. echo *=============================================================== cd /d %HOMEDRIVE%\%HOMEPATH%

The text to the right of each line next to echo is displayed to the user when she logs in, so change it to whatever welcome message you want, such as:

echo *=============================================================== echo Welcome to Preston's Telnet Server. You're welcome to use any of echo my resources, but please take care in what you do! echo *===============================================================

The bottom part of the default script places users in their home directories the script replaces the %HOMEDRIVE% and %HOMEPATH% with the variables of the home directory of the user logging in. The /d switch allows the drive to be changed if necessary.

If you want, you can force all Telnet users into the same directory by editing the last line of the file. For example, if you wanted all Telnet users to have their command consoles opened in the C:\Telnet directory, the last line of the script would be cd C:\Telnet.

Note: The Telnet server comes only with the XP Professional, not the Home Edition.

See Also

Recipe 13.6 for using the Telnet Administrator to manage a Telnet server



Windows XP Cookbook
Windows XP Cookbook (Cookbooks)
ISBN: 0596007256
EAN: 2147483647
Year: 2006
Pages: 408

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net