[sudo-users] Please help me sudo

Kumar, Gyan gyan_kumar at uhc.com
Thu Dec 24 01:04:21 EST 2009


Hi ,
 My requirement is take backup as sudo admin.
  

      a.  apsr8007 machine.

     [gkuma14 at apsr8007 gyan]$ ssh -t gkuma14 at cwsapp02.phs.com 'sudo -u
wladmin -s -H ;cd /home/stage/doamins/cw_stage1 '
      
 after executing now i am in wladmin user,

       
       [wladmin at cwsapp02 gyan]$ pwd
       /home/gyan

 
    but cd /home/stage/doamins/cw_stage1 'is not working 
 

   
      
      b. now i want to connect cwsapp02 machine(Three
requirement).Because here  20 machine(cwsapp03,05...20)
          It is very diffcult to take backup for logfile.Taking backup
we have to do "sudo -u wladmin -s -H' and go to
          the perticular path cd /home/stage/domains/cw_stage1/ 
       
              Three steps:

                      1> sudo -u wladmin -s -H                =  do the
sudo
                      2> cd /home/stage/domains/cw_stage1/    =  go to
the pertucular path
                      3> mv log logs.241209                   =  Take
backup

Thanks, 
Gyan



-----Original Message-----
From: Todd C. Miller [mailto:Todd.Miller at courtesan.com] 
Sent: Wednesday, December 23, 2009 8:00 PM
To: Kumar, Gyan
Cc: sudo-users at sudo.ws
Subject: Re: [sudo-users] Please help me sudo 

In message
<312D09D33B3C0E4A9AE709A6577D3768053EA7A3 at APSW0132EVS.ms.ds.uhc.com>
	so spake "Kumar, Gyan" (gyan_kumar):

>  I am not able to run in ssh command.
> 
> ssh gkuma14 at cwr.uuu.com 'sudo -u wladmin -s -H '

You need to tell ssh to allocate a pty for the command.  E.g.

    ssh -tt gkuma14 at cwr.uuu.com 'sudo -u wladmin -s -H'

That should do the trick.

 - todd

This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.




More information about the sudo-users mailing list