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

I suspect that when your sudo account has been created it’s been done with requiretty - I’ve never had this issue personally, normally Ubuntu 22.04 does not enable this by default. Are you sure the machine you’re reaching is not a CentOS machine?

Basically your box is saying the user running this command isn’t actually in a live session with me, it’s being ran via piping through a different session so I don’t trust them to run sudo commands.

You need to have requiretty commented out/excluded in your sudoer account in /etc/sudoers. To the best of my knowledge this isn’t default behaviour but would be keen to hear if this is a new AWS default for security - might help future users

1 Like