[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to scp from one box to another with no root ssh?



On Fri, 2007-04-13 at 21:41 -0400, Douglas Allan Tutty wrote:
> In the past, to move config or script files from one box to another on
> my home network I've used scp or rsync.
> 
> However, recent discussions on the list have pointed out that root login
> with ssh should not be allowed.
> 
> How then to copy files that either only root can read or only root can
> place, or that need owner/permissions to be unchanged?
> 
> I have sshd setup to only allow ssh based on pre-existing keys (no
> password login allowed), and it only listens on the local interface, and
> I've got shorewall running and doesn't allow ssh to/from the net.  
> 
> What am I missing?

I do it all the time... as root on the "target" machine and as myself on
the "source" machine.

Most configuration are readable by regular users.

So for example I want to use "/etc/apt/sources.list" on the new machine,
form a machine I already have everything set the way I like it. Here is
what I do:

        ssh target_machine
        sudo su -
        cd /etc/apt/
        scp greg@source_machine:/etc/apt/sources.list .
        blah_blah_blah output

The only thing you have to allow is password login for your username...
and you are good.
-- 
greg, greg@gregfolkert.net

Novell's Directory Services is a competitive product to Microsoft's
Active Directory in much the same way that the Saturn V is a competitive
product to those dinky little model rockets that kids light off down at
the playfield. -- Thane Walkup

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: