[KLUG Members] remote copy of /homes directory

Adam Tauno Williams adam at morrison-ind.com
Fri Dec 3 16:48:00 EST 2004


> If I wanted to remotely copy (rcp) the /homes directory from a host, how
> could I do it without logging in as root?
> scp WhatUserHere at myhost:/homes /mylocaldirectory

You probably want the "-r" option for recursive operation.

> If I use a normal user, that user would only have access to one home
> directory (their own).

Yep.

> If I use root it somehow doesn't seem like I'm doing it securely (should
> you ever remotely log in directly as root?).

Depends.

Do you care about file permissions/ownership?  If so better to use
something like tar.

You can:
ssh root@{remotehost} "tar cf - /home | ssh root@{localhost} \"tar -C/
-xf - \" "

To start tar on the remote host, send the tar'd content over an ssh
tunnel back to your host and untar the stream.  I've got a couple of
hosts I backup this way since they don't have local tape drives.

You need to setup the RSA keys, but if the boxes are secure, that should
be pretty safe.



More information about the Members mailing list