I'm facing trouble with a system which I'm maintaining via SSH. When I test commands which require a TTY they work, probably because of the SSH session. Under some unclear circumstances there's no TTY available and commands like
sudo fail due to
(sudo: sorry, you must have a tty to run sudo)
They succeed in the SSH shell which makes issues hard to track before they occur. Since this is a recurring issue, I'm looking for a way to test changes to scripts in a shell which doesn't provide a TTY.
I'm using Ubuntu 19.04, CentOS 6 and Debian 9 with bash and ksh.