When running script in crontab I get an error
sudo: sorry, you must have a tty to run sudo
How to fix this problem?
- In /etc/sudoesr update
Defaults requiretty to Default !requiretty
- Disable per user
- Disable per command
If you executing command throw ssh connect using -t option
From ssh manual:
-t Force pseudo-terminal allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty.