On Sunday 29 May 2005 04:42 pm, Pupeno <[EMAIL PROTECTED]> wrote:
> On Sunday 29 May 2005 16:53, Boyd Stephen Smith Jr. wrote:
> > I never use rsync myself, but why not just use --rsh="ssh 'su -'"
> > instead of --rsh="ssh"?
>
> It'd have to be "ssh 'sudo su -'", but that doesn't work:

'sudo su -' is definately wrong.

Maybe simply 'sudo' or 'sudo /bin/bash' but not 'sudo su -'.

> # rsync --verbose --checksum --archive --partial --progress --rsh="ssh
> 'sudo su -'" [EMAIL PROTECTED]:/var/ ./var/
> ssh: 'sudo: Name or service not known

Er, this is the kicker.

It means that rsync is invoking ssh like:
ssh 'sudo su -' [EMAIL PROTECTED]
whereas ssh needs it to look like:
ssh [EMAIL PROTECTED] 'sudo su -'

There's no way to force ssh to take the command first that I can find.

I see a couple of solutions.

The first is to simply allow root to login via ssh on the remote machine 
and use [EMAIL PROTECTED] instead of [EMAIL PROTECTED]

The second is to write a small bash script reorders the arguments to ssh so 
that --rsh="<script name> 'sudo /bin/bash'" (or a variant) will work.

I'm sure there are other solutions, too.

-- 
Boyd Stephen Smith Jr.
[EMAIL PROTECTED]
ICQ: 514984 YM/AIM: DaTwinkDaddy
-- 
gentoo-user@gentoo.org mailing list

Reply via email to