Why not just rename? Well, the two sets of programs are incompatible in some ways. For example, not all versions of ssh support the "hostname link" feature of rsh [Section 2.7.3, "Hostname Links"], and some old versions of rcp use a different syntax for specifying remote filenames. In the following sections, we discuss some common Unix programs that invoke the r-commands and how to adapt them to use SSH instead.$ rsh -l jones remote.example.com $ ssh -l jones remote.example.com $ rcp myfile remote.example.com: $ scp myfile remote.example.com:
Some Unix machines have a directory, commonly /usr/hosts, that contains symbolic links to rsh representing various hosts on the local network (or beyond):$ ls -l petunia lrwxrwxrwx 1 root 12 Jan 31 1996 petunia -> /usr/ucb/rsh $ petunia Welcome to petunia! Last login was Wed Oct 6 21:38:14 from rhododendron You have mail.
If you eliminate /usr/ucb/rsh from such a machine, obviously these links become orphaned. Delete them and replace them with links to ssh, perhaps with a shell script like this:$ ls -l /usr/hosts lrwxrwxrwx 1 root 12 Jan 31 1996 lily -> /usr/ucb/rsh lrwxrwxrwx 1 root 12 Jan 31 1996 petunia -> /usr/ucb/rsh lrwxrwxrwx 1 root 12 Jan 31 1996 rhododendron -> /usr/ucb/rsh ...
#!/bin/sh SSH=/usr/local/bin/ssh cd /usr/hosts for file in * do rm -f $file ln -s $SSH $file echo "Linked $file to $SSH" done
if the repository is located on a remote machine, CVS may invoke rsh to access the remote repository. For a more secure solution, CVS can run ssh instead of rsh. Of course, the remote machine must be running an SSH server, and if you use public-key authentication, your remote account must contain your key in the appropriate place.[54]$ cvs commit myfile
[54]CVS also has a remote-access method involving its own server, called pserver. This mechanism can be secured using SSH port forwarding instead; see Chapter 9, "Port Forwarding and X Forwarding".To make CVS use ssh, simply set the environment variable CVS_RSH to contain the path to your ssh client:
This approach has one problem: each time you check in a file, the logger's name is the remote account owner, which might not be your own. The problem is solved by manually setting the remote LOGNAME variable using the "environment=" option in your remote authorized_keys file. [Section 8.2.6.1, "Example: CVS and $LOGNAME "]# Bourne shell family # Put in ~/.profile to make permanent. CVS_RSH=/usr/local/bin/ssh export CVS_RSH # C shell family # Put in ~/.login to make permanent. setenv CVS_RSH /usr/local/bin/ssh
A second variable, rsh-command, constructs the actual command string to be executed for the remote mail server. The value is a pattern in the style of the C function printf( ). Most likely, you won't need to change the value because both rsh and ssh fit the default pattern, which is:# Set in a Pine configuration file rsh-path=/usr/local/bin/ssh
The first three "%s" pattern substitutions refer to the rsh-path value, the remote hostname, and the remote username. (The fourth forms the remote mail daemon name, which doesn't concern us.) So by default, if your username is alice and the remote mail server is mail.example.com, rsh-command evaluates to:"%s %s -l %s exec /etc/r%sd"
By changing the rsh-path, it becomes instead:/usr/ucb/rsh mail.example.com -l alice ...
As we said, you probably don't need to do anything with rsh-command, but just in case, we've included it for reference. We present a detailed case study of integrating Pine and SSH1 later. [Section 11.3, "Pine, IMAP, and SSH"]/usr/local/bin/ssh mail.example.com -l alice ...
4.4. Software Inventory | 4.6. Summary |
Copyright © 2002 O'Reilly & Associates. All rights reserved.