![]() ![]() Next, sudo looks for a terminal and then askpass to trigger a prompt, but fails in both. This requires the user’s password input to validate if they are the superuser. Note: This opens the /etc/sudoers file using your default editor. ssh remoteusernameremotehost 'sudo reboot' sudo: no tty present and no askpass program specified Here, the sudo command tries to execute a system reboot. To configure it run either of the commands below: sudo nano /etc/sudoers Note that HOME is already set when the the envreset option is enabled, so this option is only effective for configurations where either envreset is disabled or HOME is present in the envkeep list. Multiple -t options force tty allocation, even if ssh has no local tty. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. ![]() ![]() The no password requirements is configured in the /etc/sudoers file. /binary' From the man page: Force pseudo-tty allocation. To fix this you need to be able to run sudo for that specific user with no password requirements. As it can’t find a tty, sudo falls back to an askpass method but can’t find an askpass command configured, so the sudo command fails. The issue is caused by executing a sudo command which tries to request for a password, but sudo does not have access to a tty to prompt the user for a passphrase. The remote script failed with exit code 1 However when I run the command I get the error: sudo: no tty present and no askpass program specified I was trying to run a sudo command from a remote machine to deploy an app to the server. I faced this issue when working on an Ubuntu 20.04 server. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |