[WLUG] Help! AWS/EC2, interactive login, but sudo reports no tty error....

Mark J. Bobak mark at bobak.net
Thu Mar 22 15:54:51 EDT 2018


 Hi all,

Can anyone help me with this?

I'm running in AWS on EC2, and I'm getting this error:
[ec2-user at ppbaudi-uat-web ~]$ cat /etc/oracle-release
Oracle Linux Server release 6.7
[ec2-user at ppbaudi-uat-web ~]$ tty
/dev/pts/0
[ec2-user at ppbaudi-uat-web ~]$ ls -l `tty`
crw--w---- 1 ec2-user tty 136, 0 Mar 22 15:39 /dev/pts/0
[ec2-user at ppbaudi-uat-web ~]$ id
uid=500(ec2-user) gid=500(ec2-user) groups=500(ec2-user)
[ec2-user at ppbaudi-uat-web ~]$ sudo -i
sudo: sorry, you must have a tty to run sudo

Clearly, I *do* have a tty, and this is an interactive session, but sudo
thinks I don't have a tty.

Yes, I know that I can edit /etc/sudoers and change to '!requiretty',
except that I can't cause I need to sudo to be able to edit /etc/sudoers!

This is AWS, so booting into single user mode to edit /etc/sudoers is not
an option.

I guess I could shutdown, mount root device on another server, and edit
/etc/sudoers, but I'd really like to understand root cause, and I'd prefer
to avoid the hassle of unmounting/remounting the root device....

Help?

-Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://linux.marcdatabase.com/pipermail/washlug/attachments/20180322/16f7ab1e/attachment.html>


More information about the washlug mailing list