Math-Linux.com

Knowledge base dedicated to Linux and applied mathematics.

Home > Linux > Bash > Error "standard in must be a tty" when doing ssh username@server ’sudo (...)

Error "standard in must be a tty" when doing ssh username@server ’sudo command’

When

ssh username@server 'sudo command'

gives "standard in must be a tty".
First solution:
Edit your /etc/sudoers file, by using visudo command:

visudo

comment out the line "Defaults requiretty".

A most secure way should be to add:

Defaults:[username] !requiretty

Second solution:
forcing allocation of a pseudo-tty.by using -t option

ssh -t username@server 'sudo command'

Additional information

This behaviour is not the default. Only Redhat distributions of sudo that had requiretty in its default sudoers. It will be fixed in newer releases

https://bugzilla.redhat.com/show_bug.cgi?id=1020147

Any message or comments?

comments powered by Disqus