Operating System - HP-UX
1833750 Members
3080 Online
110063 Solutions
New Discussion

ownership of copies files to a remote system

 
SOLVED
Go to solution
Peter Gillis
Super Advisor

ownership of copies files to a remote system

Hi,
I am trying to copy files from a d220 ux-11.0 system to a rp2450 ux-11.0 system. I have used rcp but found that the owner of the files would become the name of user submitting the rcp command; or, if issued rcp cmd with userid@hostname remshd: Password for this account expired - msg is displayed. I have added .rhosts file to the users directory in both systems and still get this message.
Would someone please help I really have to get these files copied over to the 2450 - and I dont want to go nuts!! ps. any other methods - maybe easier - please let me know.
Thanks
Maria
14 REPLIES 14
Rajeev  Shukla
Honored Contributor

Re: ownership of copies files to a remote system

Hi Maria,
the username you are using on the destination machine to rcp is disabled, enable the account first using
/usr/lbin/modprpw -k "username" if its a trusted system.
Then use rcp with -p option to preserve the permission and mode. i.e.
rcp -p source userid@destination

An alternate to check if rcp will work run remsh hostname -l userid -n date

If this works rcp should work too.
Cheers
Rajeev
Michael Tully
Honored Contributor

Re: ownership of copies files to a remote system

Hi Maria,

There is a couple of other methods you could try:

tar archive

cpio using remsh
# cd /mydir
# (find . -xdev|cpio -coax)|remsh remhost "cd mydir;cpio -icdmuxla"


fbackup
fbackup -f -i /mydir | remsh remhost "cd /newlocation ; frecover -xXf -"

HTH
Michael
Anyone for a Mutiny ?
Peter Gillis
Super Advisor

Re: ownership of copies files to a remote system

Thanks rajeev,
I ahve the username setup with a .rhosts file containg name of destination host. Checked system access and users are allowed. Have I missed anythign else.
Maria
Peter Gillis
Super Advisor

Re: ownership of copies files to a remote system

Michael,
I did try a tar archive but the owner of the files came up as a number (202) and there were messages about the blocksize being different.
Thanks for helping.
Maria
Rajeev  Shukla
Honored Contributor

Re: ownership of copies files to a remote system

But if its displaying "passwd expired" clearly means the account passwd has expired so change the password first on the destination machine. And is the remsh command i gave before working?
Ok here is the setup you should have in .rhosts file
say source machine is A and user is AU
destination machine is B and user there is BU
then in the .rhosts file of destination machine(home directory of BU) should have
A(machine name) AU(username)
similar if you want to do reverse rcp
on host A inside AU's home directory you should have
B BU

Also try loging into the server with the userid you are using to do rcp to see if the account is file(password is not expired)

Thanks
Rajeev
Michael Tully
Honored Contributor

Re: ownership of copies files to a remote system


If the password has "expired" for the user and not "account disabled", the password must be changed. Login into the remote server (assuming your root) from the console, or if you have another session, change it using that.

If you just copying files, then use ftp, or you could even set up a simple NFS mount point.
Anyone for a Mutiny ?
Peter Gillis
Super Advisor

Re: ownership of copies files to a remote system

Michael, I tried the fbackup option and this resulted:

# fbackup -f -i /SCCS|remsh charon "cd /SCCS ; frecover -xXf -"
fbackup(1401): extra argument: /SCCS ignored
fbackup(1404): no files have been specified; (use at least one -i and/or -g opti
on)
usage: fbackup -f device [-f device] ... [-0-9] [-nsuvyAEl]
[-i path] ... [-e path] ... [-g graph] ... [-d path] [-I path] [-V path]
[-c config]

usage: fbackup -f device [-f device] ... -R restart [-nsuvyAEl]
[-d path] [-I path] [-V path] [-c config]
sh frecover: not found

What am I doing wrong now? I am sure that the -i I put in the command is an include file option. Any ideas??

Maria
A. Clay Stephenson
Acclaimed Contributor

Re: ownership of copies files to a remote system

Note that rcp -p ONLY preserves the permissions (modes) and modification times of a file; ownership and group are determined by the user executing the command.

If it ain't broke, I can fix that.
Michael Tully
Honored Contributor

Re: ownership of copies files to a remote system

Stupid me can't read man pages properly, when your using 'fbackup', if your using stdout instead of a device, you need to include a '-'. So try this instead:

# fbackup -f - -i /mydir | remsh remhost "cd /newlocation ; frecover -xXf -"

Anyone for a Mutiny ?
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: ownership of copies files to a remote system

I suppose that I should give you a workable solution. This does assume that you have remote login problems resolved. I'll build this one around cpio. Well get all the .sh files in the local directory and copy them to the /tmp directory on the remote host (daffy) and preserve ownership, group, modification times, and permissions.

find . -name '*.sh' | cpio -ocv | remsh daffy cd /tmp \; cpio -icvdum

That should fix you.
If it ain't broke, I can fix that.
Peter Gillis
Super Advisor

Re: ownership of copies files to a remote system

Michael I am now getting the following:
# fbackup -f - -i /SCCS|remsh charon -n "cd /SCCS ; frecover -xXf -"
fbackup(1004): session begins on Tue Feb 11 12:31:24 2003
sh: frecover: not found.
fbackup(3024): writing volume 1 to the output file -
fbackup(9999): Broken pipe
fbackup(3004): writer aborting
fbackup(1002): Backup did not complete : Reader or Writer process exit
#

I also got this error without the -n being specified in the command line.
Would you possibly have any further ideas ?
thanks
Maria.
Michael Tully
Honored Contributor

Re: ownership of copies files to a remote system

Looks like the frecover cannot be found in the default path, so let's add it in.

# fbackup -f - -i /mydir | remsh charon -n "cd /SCCS; /usr/sbin/frecover -xXf -"
Anyone for a Mutiny ?
Peter Gillis
Super Advisor

Re: ownership of copies files to a remote system

Thanks very much for your help with all the questions. Michael, your cpio command has done the trick for me at the moment. I will be looking furhter at the rcp way. Thanks all for getting me on track with that one.
REgards,
Maria.
Peter Gillis
Super Advisor

Re: ownership of copies files to a remote system

Michael, I am now getting 'not an fbackup volume' :


# fbackup -f - -i /SCCS |remsh charon -n "cd /SCCS;/usr/sbin/frecover -xXf -"
fbackup(1004): session begins on Tue Feb 11 13:06:18 2003
frecover(5418): not an fbackup volume; unable to read volume header
frecover(5414): abort selected
fbackup(3024): writing volume 1 to the output file -
fbackup(9999): Broken pipe
fbackup(3004): writer aborting
fbackup(1002): Backup did not complete : Reader or Writer process exit

If you dont mind and you have the time I would like to know if there is a way to get this method working...

thanks
Maria.