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.
4.5.1. The /usr/hosts Directory
The program
rsh has an interesting feature called
hostname links. [Section 2.7.3, "Hostname Links"] If you
rename the executable from "rsh" to something else, the
program treats its new name as a hostname and connects to it by
default. For example, if you rename
rsh as
"petunia," on invocation it executes
rsh
petunia. The renaming may be done literally or by creating
a hard link or symbolic link to
rsh:
$ 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.
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 /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
...
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:
#!/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