termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
31.27k stars 3.32k forks source link

[Bug]: Stuck on root user when opening termux .. can't use it #3863

Closed nicklamn1 closed 2 months ago

nicklamn1 commented 2 months ago

Problem description

I have android 7.1.2 and use SuperSu or other root ability. Upon opening termux, it opens as root user. Running whoami returns root. Typing id returns user id 0 and root user. Can't use pkg or apt... Please help.

Steps to reproduce the behavior.

Well I just rooted and open app, it runs as root user

What is the expected behavior?

Login as non root user, allows me to pkg and apt commands.

System information

sylirre commented 2 months ago

Try to remember what you did that Termux started to open as root user.

Remove any dotfiles such as ~/.bashrc if configured.

If that didn't help, perhaps time to reset Termux.


This is not bug. Moreover, Termux doesn't have functionality to open as root by default.

nicklamn1 commented 2 months ago

Lmfao not completed. Installed and it is like this… there’s no other user account that I know of.

On Thu, Feb 29, 2024 at 4:30 PM Leonid @.***> wrote:

Closed #3863 https://github.com/termux/termux-app/issues/3863 as completed.

— Reply to this email directly, view it on GitHub https://github.com/termux/termux-app/issues/3863#event-11971704178, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFERGFO6AQUKLMYGH6RDIRLYV6OXLAVCNFSM6AAAAABEAVIKMSVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRHE3TCNZQGQYTOOA . You are receiving this because you authored the thread.Message ID: @.***>

sylirre commented 2 months ago

Again, Termux has no capability to launch as root user by default. You can switch to root only by using tsu/su/sudo, whether such command is executed manually or by some rc script you set up on your own.

Therefore if your Termux launching as root user by default, you have somewhere put tsu, su, or sudo command in your ~/.bashrc, ~/.zshrc or other script loaded into your shell during log in.

Your issue is user error but not a Termux bug. Termux developers will not work on solving user errors, especially when user does not tell what was done to achieve such behavior. Users should not use bug report for submitting results of their own mistakes, such as misconfiguration or product of usage of third party scripts and tutorials.

Indeed, Termux does not set up user accounts. The user being assigned by Android OS.

Screenshot_20240301-101209_Termux


In addition to above

The described behavior where out-of-box Termux appears launched as root user, is known to happen on certain ROMs for VMOS and F1VM virtual Android apps. These environments are not supported by Termux. They are not true Android OS VMs like they claim, but rather container with highly modified Android versions with proprietary nature, which makes it impossible to support. Furthermore, issue with VMOS and F1VM look like rather their flaw because they could not properly manage emulated UIDs.

If you decided to use VMOS or F1VM, please report issues to their support and not here.