Skip to content

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

It took me a while to find out, why this backup script would not start. Finally, i found this error message: "sudo: sorry, you must have a tty to run sudo". The sudo call is required to execute "clustat" and find out, which machine is the current master.

sudo is configured to execute "clustat" without password and works fine on the command line - so what's wrong here?

The solution is easy: some distributions enable the setting "requiretty". This looks like:

Defaults requiretty

in visudo. After commenting out this setting (you must be root for doing this), my cronjob started without any trouble.


No Trackbacks


Display comments as Linear | Threaded

No comments

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
To leave a comment you must approve it via e-mail, which will be sent to your address after submission.
Form options