Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

What should I change in remote shell command line in order to save the users groups and permission

I use the following line in order to copy one directory
 to another directory on another machine.

tar cf - .|rsh <ip address>
 '(cd <destination dir>;tar xBvf -)'

the problem is that all fileswere created with  root as owner.
What can I change in this command in order to transmit the dir with all owners permissions and groups
0
tzahi
Asked:
tzahi
1 Solution
 
tzahiAuthor Commented:
Edited text of question
0
 
ahoffmannCommented:
tar xpBvf -

unfortunatelly tar options highly depend on the UNIX flavior,
you'va to tell us you UNIX.
0
 
arthurdCommented:
Try adding the "p" option to tar.  This will preserve the permissions and ownerships.


0
 
toToCommented:
first the user id in the 3de field of /etc/passwd must
be the same number on both hosts.

switch from tar to cpio , when used by root, it maintains user
informations

find . -print | cpio -ocB | rsh <ip address>
      '(cd <destination dir>; cpio -icdvB)'

 
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now