Can't access some directories with terminal emulator

Hi all, first of all sorry if I’m messing up the terminology and jargon a little bit, I’m still quite new to it all and trying to get my head round it. Nonetheless, I hope somebody will be able to help! :sweat_smile:

I was trying to explore my FP2’s directories through the terminal emulator app, and I noticed that I couldn’t list (command ls) some of the directories in the root directory, such as data and sbin. The command would simply return opendir failed, Permission denied. I am currently using FPOOS, meaning I have root access (although the directories have rwxrwx–x permissions, which should give me the right to read them independently of whether I have root access, or am I wrong?). I tried using the superuser command su, which also didn’t work (returning Unknown id: ls) when I was already in the directory I wanted to explore. Can anyone explain what I’m doing wrong or why I’m not allowed to see what’s in those directories?

Many thanks :slight_smile:

I can’t reproduce your problem. After opening Terminal Emulator I type su - and Android asks if it shall allow root permission to Terminal Emulator. Then I issue cd /sbin or cd /data and the prompt changes accordingly. After typing ls or ls -l the correct output is generated.

Try to reproduce these steps. In addition, I have the latest BusyBox installed.

1 Like

I’m guessing you ran su ls. This tries to change ownership of the session (think of su more as switch user) to a user named ‘ls’. This user doesn’t exist, so it throws an error telling you that.
If you run su without any arguments, it will by default attempt to switch to root (which is what you want). More complete is running su - as suggested above, which will load the default environment settings for root (effectively starting a new session, rather than just switching ownership of your current session).
The prompt in the shell should change after you successfully su to another user. If you have root privileges the last symbol normally also changes from ‘$’ to ‘#’. To go back to your original session, use exit (su-ing to the orginal user just keeps adding layers).

1 Like

Alright it worked perfectly now. What I didn’t know is that I have to run su with no arguments to switch to root, I was using it like sudo in linux, precisely as you said. Thank you very much for your reply :slight_smile:

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.