John Kuiper wrote:
> I have to copy file as root from one server to another. This should only
> be doing once. I did everything the man pages and the kwowledge database
> of sco tells, but still won't work.
> If I'm using rlogin, it asks for a password and when using rcmd or rcp I
> get "permission denied". The /etc/hosts.equiv is empty.
> Do I forget something. I'm running SCO6.
First, I don't run SCO6 so this is specific to Open server and should work
on SCO6 unless they have some permission setting that I am not aware of.
Usually when rcp fails the permissions on /.rhosts is not correct. It should
# ls -lta /.rhosts
-r-------- 1 root sys 68 Aug 25 15:22 /.rhosts
# cat /.rhosts
unix root <-- local machine
unix2 root <-- remote machine
Use the same .rhosts file on each machine, adjust as necessary for
Be sure that you can ping each machine from the other machine by
the name listed in /.rhosts and the ping lists the machine name
as well as the ip address.
# ping unix2
PING unix2 (192.168.110.239): 56 data bytes
64 bytes from unix2 (192.168.110.239): icmp_seq=0 ttl=64 time=1.422 ms
Rcp/rcmd/rlogin must be able to match the incoming ip address with a
host name it can resolve to a name listed in /.rhosts. Rlogin from
one machine to the other (supply password if prompted) and use who -x:
# who -x
root ttyp0 Oct 5 11:16 unix
If you get an IP address instead of the hostname of the remote machine
your DNS, /etc/hosts, or /etc/resolv.conf is not configured correctly.
If pinging one or the other machine results in a foreign IP address,
flush the ARP cache on both machines and try again.
The above makes root on one machine equivalent to root on the second
machine. Some people may complain about security issues (large
organization, separate machine in accounting, engineering, HR,
etc.) but in a small company with one system admin: Not a problem.
Rcp will not preserve owner, permissions, modification time, etc.,
to keep them use a cpio pipeline:
find /target_directory_from root -depth -print | cpio -oca | rcmd machine_two cpio -icvmd
If you have enough disk space, and if the resulting cpio archive is less
then 2G you can use cpio to create a transfer file, rcp the transfer file
and then use cpio to extract the files.
find . -depth -print | cpio -ocv -O /tmp/transfer.cpio
rcp /tmp/transfer.cpio machine_two:/tmp
cd to /where_ever_you_need_to_put_the_files
cpio -icvmd[u] -I /tmp/transfer.cpio
Make a list of the specific files needed to be moved and use
the list to create /tmp/transfer.cpio:
ls -lt > /tmp/cpio.list
delete lines (file names) not required
delete all but the last column of the ls -l listing to have
only the file names.
cat /tmp/cpio.list | cpio -oca -O /tmp/transfer.cpio
There are many ways to skin this cat, and reasons to do it one
way or the other. Only you know what's right for you.
S.M. Fabac & Associates