Serving Remote Shells With Telnet


Code listing 5.5. Activating Telnet support under Fedora Core.
 [chrish@dhcppc1 ~]$ cd /etc/xinetd.d [chrish@dhcppc1 xinetd.d]$ sudo vi krb5-  telnet . . . [chrish@dhcppc1 xinetd.d]$ ps -ax | egrep  xinetd Warning: bad syntax, perhaps a bogus '-'?  See /usr/share/doc/procps-3.2.3/FAQm  2032 ?        Ss     0:00 xinetd -stayalive  -pidfile /var/run/xinetd.pid 20162 pts/2    S+     0:00 egrep xinetd [chrish@dhcppc1 xinetd.d]$ sudo kill HUP  2032 

The Telnet protocol is the default for insecure remote access. Using the Telnet command, users of almost any system can connect to Unix systems and run interactive shells.

However, Telnet is insecure because it's not encrypted. Everything you type in a Telnet session is sent across the wire exactly as you type it, including your password. Later we'll look at a secure replacement for Telnet.

When someone accesses a computer through Telnet, he or she logs in using his or her normal user ID and password for that system. If you don't have a user ID and password there, you can't log in.

Code listing 5.6. Activating Telnet support under Mac OS X.
 bender:~ chrish$ cd /etc/xinetd.d bender:/etc/xinetd.d chrish$ sudo vi telnet Password: . . . bender:/etc/xinetd.d chrish$ sudo kill -HUP  $(cat /var/run/xinetd.pid) 

To enable Telnet access (xinetd)

Fedora Core and Mac OS X use the xinetd super-server to control Telnet access.

1.

cd /etc/xinetd.d

Change to the xinetd configuration directory.

2.

If you're using Fedora Core (Code Listing 5.5), Kerberos (a secure authentication service) is installed, and it handles normal Telnet connections. Edit the krb5-telnet file using your favorite editor.

If you're using Mac OS X (Code Listing 5.6), the standard BSD Telnet daemon handles your Telnet connections. Edit the telnet file using your favorite text editor.

3.

Change the disable=yes line to disable=no, then save the file.

4.

kill -HUP xinetd_pid

Restart xinetd by sending it the HUP signal.

To enable Telnet access (inetd)

FreeBSD and Cygwin use the inetd super-server to control Telnet access.

1.

cd /etc

Change to the inetd configuration directory.

2.

Use your favorite text editor to edit the inetd.conf file.

3.

Remove the # character(s) at the start of the telnet line, then save the file.

4.

kill -HUP inetd_pid

Restart inetd by sending it the HUP signal.

Tip

  • You may have noticed that xinetd has a -pidfile option that takes a full path as an argument (specified as /var/run/xinetd.pid on both Fedora Core and Mac OS X). As a shortcut for doing ps -ax | grep to find the process ID, you could use the contents of the xinetd.pid file (Code Listing 5.6):

 sudo kill -HUP  $(cat /var/run/xinetd.pid) 




    Unix Advanced. Visual QuickPro Guide
    Unix Advanced: Visual QuickPro Guide
    ISBN: 0321205499
    EAN: 2147483647
    Year: 2003
    Pages: 116

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