openssh - run as another user

Wout Mertens wmertens at cisco.com
Sat Aug 28 00:36:34 EST 2010


If you use tar instead it's reasonably easy:

ssh desthost -t sudo tar cf - srcfile | tar xvf -

untested.

Wout.

On Aug 27, 2010, at 16:13 , Jeremy Nickurak wrote:

> Any thoughts on how to get away with doing this with scp, in particular?
> 
> On Thu, Aug 26, 2010 at 20:23, Matthew Monaco <dgbaley27 at verizon.net> wrote:
> 
>> On 08/26/2010 10:39 PM, Coy Hile wrote:
>> 
>>> Use sudo a la
>>> 
>>> ssh desthost sudo /some/command
>>> 
>>> 
>> 
>> ssh desthost -t sudo /some/command
>> 
>> 
>> 
>> -----Original Message-----
>>> From: openssh-unix-dev-bounces+coy.hile=coyhile.com at mindrot.org [mailto:
>>> openssh-unix-dev-bounces+coy.hile <openssh-unix-dev-bounces%2Bcoy.hile>=
>>> coyhile.com at mindrot.org] On Behalf Of Phillip Wu
>>> Sent: Thursday, August 26, 2010 7:37 PM
>>> To: openssh-unix-dev at mindrot.org
>>> Subject: openssh - run as another user
>>> 
>>> For security, many systems are configured so you cannot log directly as
>>> root via the initial authentication in openssh.
>>> 
>>> What is usually done is that you log onto as your normal login and once
>>> you get a interactive shell you su to root to
>>> run the command that requires root.
>>> 
>>> Does openssh have a more elegant way of exec'ing a command as root so I
>>> can run the command
>>> non-interactively?  I know:
>>> Normal userid
>>> Normal userid password
>>> Root's password
>>> 
>>> ***************************************************************
>>> This message is intended for the addressee named and may contain
>>> confidential information. If you are not the intended recipient, please
>>> delete it and notify the sender. Views expressed in this message are those
>>> of the individual sender, and are not necessarily the views of the Land and
>>> Property Management Authority. This email message has been swept by
>>> MIMEsweeper for the presence of computer viruses.
>>> ***************************************************************
>>> Please consider the environment before printing this email.
>>> _______________________________________________
>>> openssh-unix-dev mailing list
>>> openssh-unix-dev at mindrot.org
>>> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
>>> _______________________________________________
>>> openssh-unix-dev mailing list
>>> openssh-unix-dev at mindrot.org
>>> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
>>> 
>>> 
>> _______________________________________________
>> openssh-unix-dev mailing list
>> openssh-unix-dev at mindrot.org
>> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
>> 
> 
> 
> 
> -- 
> Jeremy Nickurak -= Email/XMPP: -= jeremy at nickurak.ca =-
> _______________________________________________
> openssh-unix-dev mailing list
> openssh-unix-dev at mindrot.org
> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev



More information about the openssh-unix-dev mailing list