Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having this issue where when I try to use sudo to rcp some files from a Linux host to an HP-UX host (note that the destination directory requires root access to write to), I get the following error from HP-UX's side:

LINUX HOST:/tmp/justin $ sudo rcp ./justin.txt HPUXHOST:/usr/local/bin
remshd: Login incorrect.

I should note that the passwords for the Linux host and the HP-UX host are different. The command doesn't seem to give me a chance to enter the proper HP-UX password and automatically defaults to this error.

share|improve this question
Are you sure that the HP-UX host allows remote root login? – Thor Jun 28 '12 at 0:03

"sudo" on this side doesn't give you root on that side. I think you want rcp ./justin.txt root@HPUXHOST:/usr/local/bin, but even then you'll need the root password on that side, and they will have to allow root remote connections, which is unlikely. It's safer (and more likely to work) if you just rcp it to somewhere neutral (like /var/tmp) on the remote side, and then log into the remote side and use sudo mv to put it in /usr/local/bin.

share|improve this answer
You don't want to enable rcp to receive as root, if you do get it to work then take a few minutes to disable it. Better to use scp as a non-root user on both sides and then sudo mv and chown appropriately on the other side. – Ram Jul 11 '12 at 1:03
Isn't that pretty much what I said? – Paul Tomblin Jul 11 '12 at 1:17
Pretty much - a reference to scp is informative so I added it; note that I up-voted your answer rather than make my own... – Ram Jul 11 '12 at 1:19
Ah, well if we're going to mention things that are better than what the op specified, I'd like to cast a vote for rsync. – Paul Tomblin Jul 11 '12 at 2:22

You can also use rsync instead to copy the files with sudo rsync -avz -e "ssh" --rsync-path="sudo rsync"

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .