sudo: Sorry, you must have a tty to run sudo Error on a Linux and Unix


#1

Originally published at: https://www.cyberciti.biz/faq/linux-unix-bsd-sudo-sorry-you-must-haveattytorun/

I’m trying to run the following command:

ssh user@box.example.com sudo command1 /path/to/file

But, an error is displayed follows:

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

How do I fix this problem on Linux or Unix based systems?