Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers

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

share|improve this answer
add comment

"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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.