You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by mindspin311 <co...@gmail.com> on 2008/07/22 17:37:29 UTC

sshexec (running remote commands with sudo) forced psuedo-tty allocation

I'm trying to mimic this command in ant:

build@colbert]$    ssh -t deploy@www150.qa.xxxxxxxxxxxx.net sudo
/sbin/service httpd restart
build has password-less ssh access to deploy's accounts. Deploy also has
password-less sudoers access to run any root owned apps. This is the only
way I can do this without being prompted for a password, but there is no way
to use the -t option with sshexec. Anyone know a good fix on how to do this
in ant using sshexec or exec?
-- 
View this message in context: http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-forced-psuedo-tty-allocation-tp18592216p18592216.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: sshexec (running remote commands with sudo) forced psuedo-tty allocation

Posted by mindspin311 <co...@gmail.com>.
Found a solution. Have to go into sudoers and comment 'requiretty'
Doesn't seem to be a way around this other than commenting out this line.



krzysieq wrote:
> 
> Forgot to close the double quote at the end of arg line...
> 
> 2008/7/25 Krzysieq <kr...@gazeta.pl>
> 
>> Not sure, but maybe this will help You:
>>
>> <exec executable="bash">
>> <arg line="-c 'ssh somebody@somewhere.net my_commands'/>
>> </exec>
>>
>> Solved some ssh problems for me...
>>
>> Cheers,
>> Chris
>>
>> 2008/7/25 mindspin311 <co...@gmail.com>
>>
>>
>>> meh.. I give up.
>>>
>>> ssh'in into root by adding build's pub key to root's authorized_keys'
>>> file.
>>> Systems might have some problems with it, but it works for now.
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-forced-psuedo-tty-allocation-tp18592216p18641500.html
>>> Sent from the Ant - Users mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: user-help@ant.apache.org
>>>
>>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-forced-psuedo-tty-allocation-tp18592216p18713849.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: sshexec (running remote commands with sudo) forced psuedo-tty allocation

Posted by Krzysieq <kr...@gazeta.pl>.
Forgot to close the double quote at the end of arg line...

2008/7/25 Krzysieq <kr...@gazeta.pl>

> Not sure, but maybe this will help You:
>
> <exec executable="bash">
> <arg line="-c 'ssh somebody@somewhere.net my_commands'/>
> </exec>
>
> Solved some ssh problems for me...
>
> Cheers,
> Chris
>
> 2008/7/25 mindspin311 <co...@gmail.com>
>
>
>> meh.. I give up.
>>
>> ssh'in into root by adding build's pub key to root's authorized_keys'
>> file.
>> Systems might have some problems with it, but it works for now.
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-forced-psuedo-tty-allocation-tp18592216p18641500.html
>> Sent from the Ant - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>

Re: sshexec (running remote commands with sudo) forced psuedo-tty allocation

Posted by Krzysieq <kr...@gazeta.pl>.
Not sure, but maybe this will help You:

<exec executable="bash">
<arg line="-c 'ssh somebody@somewhere.net my_commands'/>
</exec>

Solved some ssh problems for me...

Cheers,
Chris

2008/7/25 mindspin311 <co...@gmail.com>

>
> meh.. I give up.
>
> ssh'in into root by adding build's pub key to root's authorized_keys' file.
> Systems might have some problems with it, but it works for now.
>
>
>
> --
> View this message in context:
> http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-forced-psuedo-tty-allocation-tp18592216p18641500.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

RE: sshexec (running remote commands with sudo) forced psuedo-tty allocation

Posted by mindspin311 <co...@gmail.com>.
meh.. I give up.

ssh'in into root by adding build's pub key to root's authorized_keys' file.
Systems might have some problems with it, but it works for now.


  
-- 
View this message in context: http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-forced-psuedo-tty-allocation-tp18592216p18641500.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: sshexec (running remote commands with sudo) forced psuedo-tty allocation

Posted by mindspin311 <co...@gmail.com>.
Still not being able to. I might be doing this wrong though...

I have a build script:

<exec executable="ssh" failonerror="true">
      <arg line="deploy@www150.qa.xxxxxxxxxx.net /usr/local/bin/test" />
</exec>



/usr/local/bin/test is:

#!/bin/sh
/usr/local/bin/antRunAsync /usr/local/bin/RestartApache



I modified antRunAsync by setting nohup to true and setting an output file.
(I also tried w/o nohup)
I've also tried to use antRunAsync the way it was meant for (using ant exec
to no avail)





/usr/local/bin/RestartApache is just a script with:   sudo /sbin/service
httpd restart




still getting a tty error for using sudo in RestartApache


Barry Pape wrote:
> 
> I'm using it in a less direct way.  My ant script executes a shell file
> on a remote host using ssh.  The shell file in turn executes a run
> script (shell file) using the antRunAsync wrapper.
> 
> So I have...
> Build script:
>       <exec executable="ssh">
>          <arg line="${remote.host} ${sudo.cmd} -u user
> /path/to/deploy_build.sh @{deploy.param}"/>
>       </exec>
> 
> The command in the shell script:
> ./antRunAsync.sh ./run.sh
> 
> In this way I never use the -t argument and nohup works properly from
> the run script.  Maybe a similar setup would work for you?
> 
> 
> -----Original Message-----
> From: mindspin311 [mailto:connoc.mindspin@gmail.com] 
> Sent: Tuesday, July 22, 2008 11:14 PM
> To: user@ant.apache.org
> Subject: RE: sshexec (running remote commands with sudo) forced
> psuedo-tty allocation
> 
> 
> I tried that to no avail. I got this as my build script:
> 
> <property name="exec" value="./TestCommand" />
> 
> <exec executable="./antRunAsync" failonerror="true">
>       <env key="ANTRUN_NOHUP" value="true" />
>       <env key="ANTRUN_OUTPUT" value="./exec.log" />
>       <arg value="${exec}" />  <!-- actual executable -->
> </exec>
> 
> 
> antRunAsync I copied the way it was.
> 
> and TestCommand is:
> 
> #!/bin/sh
> ssh -t deploy@host.net sudo /sbin/services httpd restart
> 
> 
> 
> Not sure what's wrong here.. I tried with nohup set to true and false
> and my
> log shows this:
> 
> Pseudo-terminal will not be allocated because stdin is not a terminal.
> sudo: sorry, you must have a tty to run sudo
> 
> 
> 
> 
> Barry Pape wrote:
>> 
>> I went through this type of thing back in January.  Maybe my findings
>> can help you out, the full thread is here:
>> http://marc.info/?l=ant-user&m=120128316829325&w=2
>> 
>> 
>> -----Original Message-----
>> From: mindspin311 [mailto:connoc.mindspin@gmail.com] 
>> Sent: Tuesday, July 22, 2008 11:08 AM
>> To: user@ant.apache.org
>> Subject: RE: sshexec (running remote commands with sudo) forced
>> psuedo-tty allocation
>> 
>> 
>> [exec] Pseudo-terminal will not be allocated because stdin is not a
>> terminal.
>> 
>> Doesn't work. Tried it to run a remote command without -t for
> something
>> like
>> 'ls' and it works fine. It seems to have a problem with '-t'
>> I thought exec was exactly like working on a command line.
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> ruel loehr wrote:
>>> 
>>>  why can't you just do an exec with the command ssh -t .....?
>>> 
>>> -----Original Message-----
>>> From: mindspin311 [mailto:connoc.mindspin@gmail.com]
>>> Sent: Tuesday, July 22, 2008 10:37 AM
>>> To: user@ant.apache.org
>>> Subject: sshexec (running remote commands with sudo) forced
> psuedo-tty
>>> allocation
>>> 
>>> 
>>> I'm trying to mimic this command in ant:
>>> 
>>> build@colbert]$    ssh -t deploy@www150.qa.xxxxxxxxxxxx.net sudo
>>> /sbin/service httpd restart
>>> build has password-less ssh access to deploy's accounts. Deploy also
>> has
>>> password-less sudoers access to run any root owned apps. This is the
>> only
>>> way I can do this without being prompted for a password, but there is
>> no
>>> way to use the -t option with sshexec. Anyone know a good fix on how
>> to do
>>> this in ant using sshexec or exec?
>>> --
>>> View this message in context:
>>>
>>
> http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-fo
>> rced-psuedo-tty-allocation-tp18592216p18592216.html
>>> Sent from the Ant - Users mailing list archive at Nabble.com.
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For
> additional
>>> commands, e-mail: user-help@ant.apache.org
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: user-help@ant.apache.org
>>> 
>>> 
>>> 
>> 
>> -- 
>> View this message in context:
>>
> http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-fo
>> rced-psuedo-tty-allocation-tp18592216p18592917.html
>> Sent from the Ant - Users mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>> 
>> 
>> -----------------------------------------
>> Confidentiality Notice!
>> This electronic transmission and any attached documents or other
>> writings are confidential and are for the sole use of the intended
>> recipient(s) identified above. This message may contain information
>> that is privileged, confidential or otherwise protected from
>> disclosure under applicable law. If the receiver of this
>> information is not the intended recipient, or the employee, or
>> agent responsible for delivering the information to the intended
>> recipient, you are hereby notified that any use, reading,
>> dissemination, distribution, copying or storage of this information
>> is strictly prohibited. If you have received this information in
>> error, please notify the sender by return email and delete the
>> electronic transmission, including all attachments from your
>> system.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-fo
> rced-psuedo-tty-allocation-tp18592216p18603537.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-forced-psuedo-tty-allocation-tp18592216p18619854.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: sshexec (running remote commands with sudo) forced psuedo-tty allocation

Posted by Barry Pape <bp...@netspend.com>.
I'm using it in a less direct way.  My ant script executes a shell file
on a remote host using ssh.  The shell file in turn executes a run
script (shell file) using the antRunAsync wrapper.

So I have...
Build script:
      <exec executable="ssh">
         <arg line="${remote.host} ${sudo.cmd} -u user
/path/to/deploy_build.sh @{deploy.param}"/>
      </exec>

The command in the shell script:
./antRunAsync.sh ./run.sh

In this way I never use the -t argument and nohup works properly from
the run script.  Maybe a similar setup would work for you?


-----Original Message-----
From: mindspin311 [mailto:connoc.mindspin@gmail.com] 
Sent: Tuesday, July 22, 2008 11:14 PM
To: user@ant.apache.org
Subject: RE: sshexec (running remote commands with sudo) forced
psuedo-tty allocation


I tried that to no avail. I got this as my build script:

<property name="exec" value="./TestCommand" />

<exec executable="./antRunAsync" failonerror="true">
      <env key="ANTRUN_NOHUP" value="true" />
      <env key="ANTRUN_OUTPUT" value="./exec.log" />
      <arg value="${exec}" />  <!-- actual executable -->
</exec>


antRunAsync I copied the way it was.

and TestCommand is:

#!/bin/sh
ssh -t deploy@host.net sudo /sbin/services httpd restart



Not sure what's wrong here.. I tried with nohup set to true and false
and my
log shows this:

Pseudo-terminal will not be allocated because stdin is not a terminal.
sudo: sorry, you must have a tty to run sudo




Barry Pape wrote:
> 
> I went through this type of thing back in January.  Maybe my findings
> can help you out, the full thread is here:
> http://marc.info/?l=ant-user&m=120128316829325&w=2
> 
> 
> -----Original Message-----
> From: mindspin311 [mailto:connoc.mindspin@gmail.com] 
> Sent: Tuesday, July 22, 2008 11:08 AM
> To: user@ant.apache.org
> Subject: RE: sshexec (running remote commands with sudo) forced
> psuedo-tty allocation
> 
> 
> [exec] Pseudo-terminal will not be allocated because stdin is not a
> terminal.
> 
> Doesn't work. Tried it to run a remote command without -t for
something
> like
> 'ls' and it works fine. It seems to have a problem with '-t'
> I thought exec was exactly like working on a command line.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ruel loehr wrote:
>> 
>>  why can't you just do an exec with the command ssh -t .....?
>> 
>> -----Original Message-----
>> From: mindspin311 [mailto:connoc.mindspin@gmail.com]
>> Sent: Tuesday, July 22, 2008 10:37 AM
>> To: user@ant.apache.org
>> Subject: sshexec (running remote commands with sudo) forced
psuedo-tty
>> allocation
>> 
>> 
>> I'm trying to mimic this command in ant:
>> 
>> build@colbert]$    ssh -t deploy@www150.qa.xxxxxxxxxxxx.net sudo
>> /sbin/service httpd restart
>> build has password-less ssh access to deploy's accounts. Deploy also
> has
>> password-less sudoers access to run any root owned apps. This is the
> only
>> way I can do this without being prompted for a password, but there is
> no
>> way to use the -t option with sshexec. Anyone know a good fix on how
> to do
>> this in ant using sshexec or exec?
>> --
>> View this message in context:
>>
>
http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-fo
> rced-psuedo-tty-allocation-tp18592216p18592216.html
>> Sent from the Ant - Users mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For
additional
>> commands, e-mail: user-help@ant.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>> 
>> 
>> 
> 
> -- 
> View this message in context:
>
http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-fo
> rced-psuedo-tty-allocation-tp18592216p18592917.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> -----------------------------------------
> Confidentiality Notice!
> This electronic transmission and any attached documents or other
> writings are confidential and are for the sole use of the intended
> recipient(s) identified above. This message may contain information
> that is privileged, confidential or otherwise protected from
> disclosure under applicable law. If the receiver of this
> information is not the intended recipient, or the employee, or
> agent responsible for delivering the information to the intended
> recipient, you are hereby notified that any use, reading,
> dissemination, distribution, copying or storage of this information
> is strictly prohibited. If you have received this information in
> error, please notify the sender by return email and delete the
> electronic transmission, including all attachments from your
> system.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 

-- 
View this message in context:
http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-fo
rced-psuedo-tty-allocation-tp18592216p18603537.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: sshexec (running remote commands with sudo) forced psuedo-tty allocation

Posted by mindspin311 <co...@gmail.com>.
I tried that to no avail. I got this as my build script:

<property name="exec" value="./TestCommand" />

<exec executable="./antRunAsync" failonerror="true">
      <env key="ANTRUN_NOHUP" value="true" />
      <env key="ANTRUN_OUTPUT" value="./exec.log" />
      <arg value="${exec}" />  <!-- actual executable -->
</exec>


antRunAsync I copied the way it was.

and TestCommand is:

#!/bin/sh
ssh -t deploy@host.net sudo /sbin/services httpd restart



Not sure what's wrong here.. I tried with nohup set to true and false and my
log shows this:

Pseudo-terminal will not be allocated because stdin is not a terminal.
sudo: sorry, you must have a tty to run sudo




Barry Pape wrote:
> 
> I went through this type of thing back in January.  Maybe my findings
> can help you out, the full thread is here:
> http://marc.info/?l=ant-user&m=120128316829325&w=2
> 
> 
> -----Original Message-----
> From: mindspin311 [mailto:connoc.mindspin@gmail.com] 
> Sent: Tuesday, July 22, 2008 11:08 AM
> To: user@ant.apache.org
> Subject: RE: sshexec (running remote commands with sudo) forced
> psuedo-tty allocation
> 
> 
> [exec] Pseudo-terminal will not be allocated because stdin is not a
> terminal.
> 
> Doesn't work. Tried it to run a remote command without -t for something
> like
> 'ls' and it works fine. It seems to have a problem with '-t'
> I thought exec was exactly like working on a command line.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ruel loehr wrote:
>> 
>>  why can't you just do an exec with the command ssh -t .....?
>> 
>> -----Original Message-----
>> From: mindspin311 [mailto:connoc.mindspin@gmail.com]
>> Sent: Tuesday, July 22, 2008 10:37 AM
>> To: user@ant.apache.org
>> Subject: sshexec (running remote commands with sudo) forced psuedo-tty
>> allocation
>> 
>> 
>> I'm trying to mimic this command in ant:
>> 
>> build@colbert]$    ssh -t deploy@www150.qa.xxxxxxxxxxxx.net sudo
>> /sbin/service httpd restart
>> build has password-less ssh access to deploy's accounts. Deploy also
> has
>> password-less sudoers access to run any root owned apps. This is the
> only
>> way I can do this without being prompted for a password, but there is
> no
>> way to use the -t option with sshexec. Anyone know a good fix on how
> to do
>> this in ant using sshexec or exec?
>> --
>> View this message in context:
>>
> http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-fo
> rced-psuedo-tty-allocation-tp18592216p18592216.html
>> Sent from the Ant - Users mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional
>> commands, e-mail: user-help@ant.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-fo
> rced-psuedo-tty-allocation-tp18592216p18592917.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> -----------------------------------------
> Confidentiality Notice!
> This electronic transmission and any attached documents or other
> writings are confidential and are for the sole use of the intended
> recipient(s) identified above. This message may contain information
> that is privileged, confidential or otherwise protected from
> disclosure under applicable law. If the receiver of this
> information is not the intended recipient, or the employee, or
> agent responsible for delivering the information to the intended
> recipient, you are hereby notified that any use, reading,
> dissemination, distribution, copying or storage of this information
> is strictly prohibited. If you have received this information in
> error, please notify the sender by return email and delete the
> electronic transmission, including all attachments from your
> system.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-forced-psuedo-tty-allocation-tp18592216p18603537.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: sshexec (running remote commands with sudo) forced psuedo-tty allocation

Posted by Barry Pape <bp...@netspend.com>.
I went through this type of thing back in January.  Maybe my findings
can help you out, the full thread is here:
http://marc.info/?l=ant-user&m=120128316829325&w=2


-----Original Message-----
From: mindspin311 [mailto:connoc.mindspin@gmail.com] 
Sent: Tuesday, July 22, 2008 11:08 AM
To: user@ant.apache.org
Subject: RE: sshexec (running remote commands with sudo) forced
psuedo-tty allocation


[exec] Pseudo-terminal will not be allocated because stdin is not a
terminal.

Doesn't work. Tried it to run a remote command without -t for something
like
'ls' and it works fine. It seems to have a problem with '-t'
I thought exec was exactly like working on a command line.

















ruel loehr wrote:
> 
>  why can't you just do an exec with the command ssh -t .....?
> 
> -----Original Message-----
> From: mindspin311 [mailto:connoc.mindspin@gmail.com]
> Sent: Tuesday, July 22, 2008 10:37 AM
> To: user@ant.apache.org
> Subject: sshexec (running remote commands with sudo) forced psuedo-tty
> allocation
> 
> 
> I'm trying to mimic this command in ant:
> 
> build@colbert]$    ssh -t deploy@www150.qa.xxxxxxxxxxxx.net sudo
> /sbin/service httpd restart
> build has password-less ssh access to deploy's accounts. Deploy also
has
> password-less sudoers access to run any root owned apps. This is the
only
> way I can do this without being prompted for a password, but there is
no
> way to use the -t option with sshexec. Anyone know a good fix on how
to do
> this in ant using sshexec or exec?
> --
> View this message in context:
>
http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-fo
rced-psuedo-tty-allocation-tp18592216p18592216.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional
> commands, e-mail: user-help@ant.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 

-- 
View this message in context:
http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-fo
rced-psuedo-tty-allocation-tp18592216p18592917.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


-----------------------------------------
Confidentiality Notice!
This electronic transmission and any attached documents or other
writings are confidential and are for the sole use of the intended
recipient(s) identified above. This message may contain information
that is privileged, confidential or otherwise protected from
disclosure under applicable law. If the receiver of this
information is not the intended recipient, or the employee, or
agent responsible for delivering the information to the intended
recipient, you are hereby notified that any use, reading,
dissemination, distribution, copying or storage of this information
is strictly prohibited. If you have received this information in
error, please notify the sender by return email and delete the
electronic transmission, including all attachments from your
system.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: sshexec (running remote commands with sudo) forced psuedo-tty allocation

Posted by mindspin311 <co...@gmail.com>.
[exec] Pseudo-terminal will not be allocated because stdin is not a terminal.

Doesn't work. Tried it to run a remote command without -t for something like
'ls' and it works fine. It seems to have a problem with '-t'
I thought exec was exactly like working on a command line.

















ruel loehr wrote:
> 
>  why can't you just do an exec with the command ssh -t .....?
> 
> -----Original Message-----
> From: mindspin311 [mailto:connoc.mindspin@gmail.com]
> Sent: Tuesday, July 22, 2008 10:37 AM
> To: user@ant.apache.org
> Subject: sshexec (running remote commands with sudo) forced psuedo-tty
> allocation
> 
> 
> I'm trying to mimic this command in ant:
> 
> build@colbert]$    ssh -t deploy@www150.qa.xxxxxxxxxxxx.net sudo
> /sbin/service httpd restart
> build has password-less ssh access to deploy's accounts. Deploy also has
> password-less sudoers access to run any root owned apps. This is the only
> way I can do this without being prompted for a password, but there is no
> way to use the -t option with sshexec. Anyone know a good fix on how to do
> this in ant using sshexec or exec?
> --
> View this message in context:
> http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-forced-psuedo-tty-allocation-tp18592216p18592216.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional
> commands, e-mail: user-help@ant.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-forced-psuedo-tty-allocation-tp18592216p18592917.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: sshexec (running remote commands with sudo) forced psuedo-tty allocation

Posted by "Loehr, Ruel" <rl...@pointserve.com>.
 why can't you just do an exec with the command ssh -t .....?

-----Original Message-----
From: mindspin311 [mailto:connoc.mindspin@gmail.com]
Sent: Tuesday, July 22, 2008 10:37 AM
To: user@ant.apache.org
Subject: sshexec (running remote commands with sudo) forced psuedo-tty allocation


I'm trying to mimic this command in ant:

build@colbert]$    ssh -t deploy@www150.qa.xxxxxxxxxxxx.net sudo
/sbin/service httpd restart
build has password-less ssh access to deploy's accounts. Deploy also has password-less sudoers access to run any root owned apps. This is the only way I can do this without being prompted for a password, but there is no way to use the -t option with sshexec. Anyone know a good fix on how to do this in ant using sshexec or exec?
--
View this message in context: http://www.nabble.com/sshexec-%28running-remote-commands-with-sudo%29-forced-psuedo-tty-allocation-tp18592216p18592216.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org