termux / proot

An chroot-like implementation using ptrace.
https://wiki.termux.com/wiki/PRoot
Other
745 stars 161 forks source link

sudo results in "unable to determine tty: Permission denied" only in 32-bit (arm) Ubuntu-hirsute #193

Closed WheezyE closed 2 years ago

WheezyE commented 2 years ago

Problem description

This might be a minor / cosmetic error, since the sudo operations I need to run seem to be working so far(?), but whenever I run sudo inside 32-bit (arm) Ubuntu-hirsute (root or user account), I get this error popping up.

root@localhost:~# sudo
sudo: unable to determine tty: Permission denied
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory] [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory] [-T timeout] [-u user] file ...

root@localhost:~# su - user

user@localhost:~$ echo "hhhh" >> hi.txt
user@localhost:~$ sudo chmod 777 hi.txt
sudo: unable to determine tty: Permission denied
user@localhost:~$ ls -l hi.txt
-rwxrwxrwx 1 user user 5 Sep 26 15:48 hi.txt

user@localhost:~$ echo "aaa" >> hey.txt
user@localhost:~$ chmod 777 hey.txt
user@localhost:~$ ls -l hey.txt
-rwxrwxrwx 1 user user 4 Sep 26 15:49 hey.txt

Steps to reproduce

I'm using the same setup as in https://github.com/termux/proot/issues/191 (proot-distro Ubuntu-hirsute with DISTRO_ARCH="arm")

Expected behavior

In the past (32-bit Ubuntu-20.04), I didn't get this sudo "tty: Permission denied" error.

Additional information

I think this error might be related to https://github.com/termux/proot/issues/191 since it also didn't show up in Ubuntu-20.04.

Termux fresh install from F-Droid, installed today. My goal is to run box86 (not qemu) on armhf Termux Ubuntu proot.

~ $ termux-info
Application version:
0.117
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages.termux.org/apt/termux-main/ stable main
# science-repo (sources.list.d/science.list)
deb https://termux.mentality.rip/termux-science science stable
# game-repo (sources.list.d/game.list)
deb https://termux.mentality.rip/termux-games games stable
Updatable packages:
All packages up to date
Android version:
9
Kernel build information:
Linux localhost 4.4.146+ #1 SMP PREEMPT Sat Apr 24 02:53:11 UTC 2021 aarch64 Android
Device manufacturer:
Amazon
Device model:
KFTRWI
michalbednarski commented 2 years ago

Fixed version should soon be available in Termux apt as proot_5.1.107-45

WheezyE commented 2 years ago

Thank you! This is working too now! I didn't realize this issue wasn't closed yet.