Operating System - HP-UX
1822818 Members
4229 Online
109645 Solutions
New Discussion юеВ

rcp command on HP-UX 11v2

 
SOLVED
Go to solution
sasikala
Advisor

rcp command on HP-UX 11v2


Hello,

We are trying to copy file 'hai' from /home/raja to /home/raja/TESTING on the same host.

We are getting the following error while trying to use rcp command on HP-UX 11V2 version :
$ rcp hai g3u0992:TESTING
rresvport_af: bind: Permission denied
$ cat .rhosts
g3u0992.houston.hp.com
$ uname -a
HP-UX g3u0992 B.11.23 U ia64 2181415107 unlimited-user license
$ hostname
g3u0992


Could you please help us in resolving the error 'rresvport_af: bind: Permission denied' ?

Thanks in advance for your help.
10 REPLIES 10
Steven E. Protter
Exalted Contributor

Re: rcp command on HP-UX 11v2

Shalom

rcp does not work and should not be used for copying files on the same host.

The regular cp command should be used.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
sasikala
Advisor

Re: rcp command on HP-UX 11v2

Hello,

Could you please let me know the command I have to use if it is for a remote host?

Thanks in advance for your help.
Pete Randall
Outstanding Contributor

Re: rcp command on HP-UX 11v2

Why would you try to use rcp when cp will do the job?

man rcp

NAME
rcp - remote file copy

.
.
.DESCRIPTION
The rcp command copies files, directory subtrees, or a combination of files and directory subtrees from one or more systems to another.


Pete

Pete
Steven E. Protter
Exalted Contributor
Solution

Re: rcp command on HP-UX 11v2

rcp will work for remote hosts, not same host.

I also recommend using scp from openssh.

It is a bit slower but it authenticates and does its data stream encrypted.

It is available by searching for secure shell at http://software.hp.com

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
harry d brown jr
Honored Contributor

Re: rcp command on HP-UX 11v2

I've used "rcp" as a generic way to copy files from one system to another, even if the other system is the same host. Using "rcp" in this way eliminates the need to determine if the sending machine is or isn't the same machine as the receiving machine.

Sasikala,

can you provide the output of these commands?

nslookup g3u0992
whoami
cat /etc/passwd | grep `whoami`
ls -l TESTING

live free or die
harry
Live Free or Die
sasikala
Advisor

Re: rcp command on HP-UX 11v2

Hi Harry,

Thanks for your help on this.

Please find below the output:

$ nslookup g3u0992
Using /etc/hosts on: g3u0992

looking up FILES
Name: g3u0992.houston.hp.com
Address: 16.232.72.203
Aliases: g3u0992

$ whoami
sathisb
$ cat /etc/passwd | grep `whoami`
sathisb:x:25195:20:Sathis Kumar B,,91-044-39853045-ext.-3045,,sathiskumar.b@hp.com:/home/sathisb:/usr/bin/ksh
$ ls -l TESTING
total 0


HGN
Honored Contributor

Re: rcp command on HP-UX 11v2

Hi

The best recommendation would be to install SSH like what Steve mentioned, after which you could use ssh,scp,sftp which would work fine and also is secure.

Don't forget to assign points for the posting, people help using their valuable time and assigning points is a way of appreciation.

Rgds

HGN
Pete Randall
Outstanding Contributor

Re: rcp command on HP-UX 11v2

The real question here is the "permission denied" error, apparently on "bind".

Harry is right: rcp should work, though I'm still not convinced that "eliminating the need to determine if the sending machine is or isn't the same machine as the receiving machine" is much of an advantage. ;^)

What is "rresvport_af"?


Pete

Pete
OldSchool
Honored Contributor

Re: rcp command on HP-UX 11v2

"bind" ties a socket to an address. according to the man page on bind, address can / is a file. my guess (and thats all it is) is there is a permission issue with one or both of the files. either that, or the port is blocked somehow.
Matti_Kurkela
Honored Contributor

Re: rcp command on HP-UX 11v2

rcp uses remsh/rcmd() for making the connection. This means rcp must use a privileged local TCP port for its outgoing connection, so the TCP connection is from (local host, port between 512...1023) to (remote host, port 514). This is supposed to prove the remote host that the user is who rcp claims, assuming the local host has not been broken into.

There are two possible problems:

1.) Getting a privileged local port requires root privileges, so the rcp command must be "setuid root". Many security procedures require the limitation of suid root programs to the bare minimum, so the setuid bit may have been intentionally removed. This effectively disables the rcp and remsh clients.

2.) The number of free privileged ports is relatively small. If there are no local ports available in the 512...1023 range, rcp and remsh cannot open a connection.

The error message "Permission denied" strongly suggests that rcp is disabled by removing the setuid bit. Re-enabling it might be a violation of your local computer security policy.

MK
MK