f



rcmd fails to connect; permission denied

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.

Regards,
John
0
jkuiper (27)
10/5/2009 2:24:57 PM
comp.unix.sco.misc 3925 articles. 0 followers. Post Follow

4 Replies
3536 Views

Similar Articles

[PageSpeed] 1

On Oct 5, 10:24=A0am, John Kuiper <jkui...@thematec.nl> 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". =A0The /etc/hosts.equiv is empty.
>
> Do I forget something. I'm running SCO6.
>
> Regards,
> John

Well, first things first, why in the name of all the seven heavens are
you using rcp or rsh? Why aren't you using SSH, which SCO 6 supports?

That said, 'rcp' is a nasty tool because it mis-handles symlinks and
hardlinks. scp has the same problem, although it far safer handling of
remote access due to the availability off SSH keys. But instead, if
possible, install rsync and use 'rsync -e ssh -avH' to do the
transfers: that will preserve not only ownership, but other file
characteristics such as hard-links, and is often vastly more efficient.
0
Nico
10/5/2009 2:35:19 PM
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
be 400.

# ls -lta /.rhosts
-r--------   1 root     sys           68 Aug 25 15:22 /.rhosts

# cat /.rhosts
unix    root   <-- local machine
unix2   root   <-- remote machine
unix586 root
#

Use the same .rhosts file on each machine, adjust as necessary for
your site.

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.

arp -F

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.

cd /source_directory
find . -depth -print | cpio -ocv -O /tmp/transfer.cpio
rcp /tmp/transfer.cpio machine_two:/tmp

rlogin machine_two

cd to /where_ever_you_need_to_put_the_files

cpio -icvmd[u] -I /tmp/transfer.cpio

OR

Make a list of the specific files needed to be moved and use
the list to create /tmp/transfer.cpio:

cd /source_directory
ls -lt > /tmp/cpio.list
vi /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.

> 
> Regards,
> John
> 
> 


-- 
                                      Steve Fabac
                                       S.M. Fabac & Associates
                                        816/765-1670
1
Steve
10/5/2009 4:37:35 PM
I'm sorry for the very late response.
You're absolutely right on using SSH communication.
It's a only one copy issue. I have to create an backup server and the 
samba data file have to be copied. When all files are copied, only the 
new files will be moved te the backupserver (with find).

Regards,
John


Nico Kadel-Garcia schreef:
> 
> Well, first things first, why in the name of all the seven heavens are
> you using rcp or rsh? Why aren't you using SSH, which SCO 6 supports?
> 
> That said, 'rcp' is a nasty tool because it mis-handles symlinks and
> hardlinks. scp has the same problem, although it far safer handling of
> remote access due to the availability off SSH keys. But instead, if
> possible, install rsync and use 'rsync -e ssh -avH' to do the
> transfers: that will preserve not only ownership, but other file
> characteristics such as hard-links, and is often vastly more efficient.
0
John
11/4/2009 2:08:28 PM
@Steve Fabac: I have been trying to find a way for years to retain permissions attributes when copying between some older SCO Openserver servers.  Your cpio tips were the first that have worked for me, and I especially love that they copy links properly.

Thanks, Brian S. Cook
0
3/24/2014 10:09:52 PM
Reply: