Sudo requires allocation of a real pseudoterminal
GoogleCodeExporter opened this issue · 6 comments
GoogleCodeExporter commented
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
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
- Changed state: Invalid
GoogleCodeExporter commented
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
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
- Changed state: New
GoogleCodeExporter commented
Original comment by amcna...@gmail.com
on 15 Oct 2013 at 10:58
- Changed title: Sudo requires allocation of a real pseudoterminal
GoogleCodeExporter commented
[deleted comment]
GoogleCodeExporter commented
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