1834178 Members
2510 Online
110064 Solutions
New Discussion

rcp file

 
peterchu
Super Advisor

rcp file

I want to rcp files from hostA to hostB by below command , my login ID is userA
$rcp aa.txt userB@hostB:~userB , but it is fail , I think the reason is userA can't su to login ID "userB" ,( I sure I can overwrite the file because the file mode is 777 ) if I don't have the password of userB , is it possible to run the below script ( I just want to copy file to hostB:userB direcory ) ? thx.
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: rcp file

The users actually doing the rcp command must exist on both systems.

There must be a valid .rhost file.

/etc/hosts.equiv and /var/adm/inetd.sec can't block the protocol.

Check the /var/adm/syslog/syslog.log file for errors during the transfer.

IF the permissions are 777 and accessible up to root directory for both users it should be possible to script this.

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
Deoncia Grayson_1
Honored Contributor

Re: rcp file

777 should not be a hinderance on this file cause you are giving read/write/execute to everyone. In order for your login to work the account for userA must reside on userB system other wise the login will fail. Check the syslog.log in /var/adm/syslog to read what error message you are getting while trying to log in.
If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon
Sridhar Bhaskarla
Honored Contributor

Re: rcp file

Hi,

If you don't have the password of userB and if there is no .rhosts file in the home directory of userB allowing userA of hostA, then you cannot use 'rcp' to copy the file. Create a .rhosts file in the home directory of userB on hostB with the entry "hostA userA" and then try.

It's much easier and safer to use public/private authentication with SSH.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try