lapapaye / parallel-ssh

Automatically exported from code.google.com/p/parallel-ssh
Other
0 stars 0 forks source link

Sudo requires allocation of a real pseudoterminal #90

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  pssh -h file -i sudo blah

What is the expected output? What do you see instead?

I would like 'sudo blah' to run. But it fails with:

Stderr: sudo: sorry, you must have a tty to run sudo

What version of the product are you using? On what operating system?

2.3.1 on RHEL 6.4

Please provide any additional information below.

I toyed with pssh -O option which should feed an option to ssh. But there is no 
ssh_config equivalent to '-t'. I need to tell pssh to sun 'ssh -t' instead and 
force a tty so I can sudo.

Original issue reported on code.google.com by charl...@unixrealm.com on 15 Oct 2013 at 7:45

GoogleCodeExporter commented 8 years ago
You can use the "-x" option to pass other options to ssh.  For example:

pssh -h file -i -x "-t" sudo blah

I hope this helps. Please reopen if this doesn't address the issue. Thanks for 
participating with the pssh project.

Original comment by amcna...@gmail.com on 15 Oct 2013 at 8:28

GoogleCodeExporter commented 8 years ago
Great, I missed that one. Now it works but I get an tcgetattr error?

[1] 16:31:46 [FAILURE] cgagnon@hcq4pl1 Exited with error code 3
abrtd is stopped
Stderr: tcgetattr: Invalid argument
Connection to hcq4pl1 closed.

Which results in a failure of the attempt (even though it did actually work).

Could this relate to a similar problem ansible had? 
https://github.com/ansible/ansible/issues/1662
https://github.com/ansible/ansible/commit/7192eb30477f8987836c075eece6e530eb9b07
f2

Thanks again.

Original comment by charl...@unixrealm.com on 15 Oct 2013 at 8:37

GoogleCodeExporter commented 8 years ago
Hmm. It looks like that could be related. The links include a possible fix, but 
they don't explain why sudo seems to need a real pty.

It might make sense to add an option to allocate a pty, but I'll need to make 
sure that this doesn't cause other side effects.

By the way, I'm hoping that you've set up "sudo blah" so that sudo doesn't ask 
for your password.

I'll have to look at these issues and see if I can reproduce the issue. In the 
meantime, you might consider setting up ssh keys for root. Anyway, thanks for 
bringing this to my attention.

Original comment by amcna...@gmail.com on 15 Oct 2013 at 10:57

GoogleCodeExporter commented 8 years ago

Original comment by amcna...@gmail.com on 15 Oct 2013 at 10:58

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
What's status for this issue?
I'm having this message for every host of my company (all Red Hat/CentOS boxes):

Stderr: tcgetattr: Invalid argument
Connection to myhost closed.

Not a real problem but this message is annoying and makes output less readable

Original comment by domenico...@gmail.com on 14 Jul 2015 at 10:09