• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

[International / GSM] Advice on File Permissions for Root

jlt1112,

Welcome to the AndroidForums! (and thank you for the kind words :).

Apologies for not seeing your thread until this morning...but I think I have a solution for you.

It appears to me that the su binary that is located in your /sbin directory and that binary is being used (first) for trying to grant your device root access.

/sbin/su is a non-standard location for root (ChainsDD is a little puzzled as to why folks have proliferated the su binary there for many devices).

The good news is that you do have a good, working, properly secured su binary where it belongs--in /system/bin/su.

As you've already discovered, an adb shell and an "su" will grant you proper root access for the adb shell.

What I would do if I were you would be to rename or delete the /sbin/su file and then see if you start getting root / Superuser permissions properly (I don't think a reboot is necessary, but if it doesn't work, then try reboot after you've deleted or renamed /sbin/su file).

Also, for your CWM flashing issues, try running my Android Root Toolkit app's "Make Recovery Stick" function (see the download link in my signature)--after you've verified that you properly have root, of course ;) :).

Cheers and let me know if you have any questions.

-SA
 
  • Like
Reactions: jlt1112
Upvote 0
SA,

Many thanks for your time. Understand exactly what you want me to do. In ADB Shell, I am able to get into the sbin directory. However, not able to delete its su file. Used "adb shell rm -r/sbin/su" (and su.app) command with no luck. Also, I could not find an adb command for listing files in the directory.

Since I came from the era of DOS, tried to get into the "Galaxy Nexus" drive as shown on file explorer. Was hoping to get at it from there. No luck. Appreciate the time you have taken.
 
Upvote 0
SA,

Many thanks for your time. Understand exactly what you want me to do. In ADB Shell, I am able to get into the sbin directory. However, not able to delete its su file. Used "adb shell rm -r/sbin/su" (and su.app) command with no luck. Also, I could not find an adb command for listing files in the directory.

Since I came from the era of DOS, tried to get into the "Galaxy Nexus" drive as shown on file explorer. Was hoping to get at it from there. No luck. Appreciate the time you have taken.

Ah, no problem jlt1112 (I forgot that you'll need to remount the root filesystem as read-write).

Here's what you'll need:

c:\android-sdk-windows\platform-tools> adb shell
$ su
# cd /sbin
# mount -o remount,rw -t rootfs rootfs /
# mv su old-stupid-su

After that, you should be good-to-go :).

Oh, and the list command you are looking for is ls or ls -a -l or a derivation thereof :p.

Lemme know!

Thanks,
-SA
 
Upvote 0
SA,

Did fine until the rename point ... no file existed. I tried to condense what Root Checker was telling me; as a result I may have left out important info. So here is the full text:


System File Properties for Root Access:
Alternative Location
Check Command: ls -l /sbin/su:
Result: /sbin/su: Permission denied
Analysis: File system permissions restricted and denied access.

Standard Location
Check Command: ls -l /system/bin/su:
Result: -rwsr-xr-x root root 22228 2012-04-14 18:16 su
Analysis: Setuid attribute present and root user ownership present. Root access is correctly configured for this file! Executing this file can grant root access!

Alternative Location
Check Command: ls -l /system/xbin/sudo:
Result: /system/xbin/sudo: No such file or directory
Analysis: File /system/xbin/sudo does not exist.

Standard Location
Check Command: ls -l /system/xbin/su:
Result: /system/xbin/su: No such file or directory
Analysis: File /system/xbin/su does not exist.

Root User ID and Group ID Status:
SU binary not found or not operating properly

System Environment PATH: /sbin /vendor/bin /system/sbin /system/bin /system/xbin

ADB Shell Default User:
ADB shell setting for standard access, stored in default.prop, is configured as: shell (non root) user - ro.secure=1

I appreciate the time you have taken; looks like I need to study more to be effective. If you don't see anything in this, let me know. I will stop and do some studying before I trouble you anymore.
 
Upvote 0
Hmm, well, I still stand by my thought that it's /sbin/su that gumming-up the works...

(sorry for the delay in replying...busy afternoon...)

Did the remounting of /system work okay? (you can check with the "mount" command and see that the output for the root file system shows:

rootfs / rootfs rw,relatime 0 0

or something very similar.

Then, if you type this:

ls -a -l /sbin/su

and

ls -d -l /sbin

what does the output show?

I'm thinking that /sbin is set to not allow you to rename files in that directory.

I'll set my phone up like yours when you tell me the permissions for the /sbin directory and see what it takes to nuke it ;) :).

Heading home in a bit where I'll be able to help you better.

Cheers!
 
Upvote 0
SA,

I did what you asked; found that the directory did not mount - when using a "space" between the commands and modifiers (mount -o), I got a return of usage info vice rootfs / rootfs rw,relatime 0 0. I tried not using a space before the options and got a mount not found.

Also, I got files not found for the listing commands (assume that because the directory did not mount.

Greatly appreciate your time; don't feel in a rush for my issue.

Best wishes - jlt1112
 
Upvote 0
SA,

I did what you asked; found that the directory did not mount - when using a "space" between the commands and modifiers (mount -o), I got a return of usage info vice rootfs / rootfs rw,relatime 0 0. I tried not using a space before the options and got a mount not found.

Also, I got files not found for the listing commands (assume that because the directory did not mount.

Greatly appreciate your time; don't feel in a rush for my issue.

Best wishes - jlt1112

Now that I'm home, I can do a copy and paste of stuff.

Here's what I did on my phone from my PC (don't worry about the fact that I'm already root (i.e., initial # instead of $) or the missing /sbin/su file that I don't have):

Code:
C:\Users\Scary Alien>
C:\Users\Scary Alien>[COLOR="Blue"][B]adb shell[/B][/COLOR]
root@android:/ # [COLOR="Blue"][B]su[/B][/COLOR]
su
root@android:/ # [COLOR="blue"][B]ls -a -l -d /sbin[/B][/COLOR]
ls -a -l -d /sbin
[COLOR="Red"]drwxrwxr-x system  system   2012-04-16 19:46 sbin[/COLOR]
root@android:/ # [COLOR="blue"][B]ls -a -l /sbin/su[/B][/COLOR]
ls -a -l /sbin/su
/sbin/su: No such file or directory
1|root@android:/ # [COLOR="blue"][B]mount[/B][/COLOR]
mount
[COLOR="red"]rootfs / rootfs ro,relatime 0 0[/COLOR]
[COLOR="Purple"]<snip>[/COLOR]
root@android:/ # [COLOR="blue"][B]mount -o remount,rw -t rootfs rootfs /[/B][/COLOR]
mount -o remount,rw -t rootfs rootfs /
root@android:/ # [COLOR="blue"][B]mount[/B][/COLOR]
mount
[COLOR="red"]rootfs / rootfs [COLOR="Blue"]rw[/COLOR],relatime 0 0[/COLOR]
[COLOR="purple"]<snip>[/COLOR]
root@android:/ # [COLOR="blue"][B]cd /sbin[/B][/COLOR]
cd /sbin
root@android:/sbin # [COLOR="blue"][B]mv su old-stupid-su[/B][/COLOR]
mv su old-stupid-su
failed on 'su' - No such file or directory
255|root@android:/sbin #

See if this helps...if not, we'll figure something else out ;) :).

Cheers!
 
Upvote 0
SA,

I was able to successfully list the following: system/bin/su and the following directories: /sbin /vendor/bin /system/sbin /system/bin /system/xbin. I was bit able to find su in any of the other directories than one it is suppose to be in.

I didn't go any further since I couldn't find any more "SU's".

Should I delete that file and try to root the phone again? If so given I am on ICS 4.04, which rooting strategy should I use?

Again many thanks for your time!
 
Upvote 0
SA,

I was able to successfully list the following: system/bin/su and the following directories: /sbin /vendor/bin /system/sbin /system/bin /system/xbin. I was bit able to find su in any of the other directories than one it is suppose to be in.

I didn't go any further since I couldn't find any more "SU's".

Should I delete that file and try to root the phone again? If so given I am on ICS 4.04, which rooting strategy should I use?

Again many thanks for your time!

Well, I was looking to see what the permissions were for the /sbin directory itself, since that seems to be what's keeping you from being able to delete the /sbin/su file.

Can you repeat the commands I listed in my above post and copy/paste that output here?

I still think that the /sbin/su binary (improperly secured) is getting invoked first before your other su binaries (which are properly secured)...the /sbin directory is listed first in your PATH variable, which would cause this and the issue you are experiencing.

If you can delete or rename the /sbin/su file, then I think you'll have proper root functionality.

Thanks!
 
Upvote 0
SA,

See attached:

Sorry for the delay.
 

Attachments

  • Galaxy.PNG
    Galaxy.PNG
    38.3 KB · Views: 125
  • Like
Reactions: scary alien
Upvote 0
SA,

See attached:

Sorry for the delay.

Thanks! Hmm, that's a little weird...you do not have a su file in your /sbin directory, so I don't know why your root checker is telling you that...? :thinking:

Can you try using my app (Android Root Toolkit--see my signature for the link) and do the "Display Root and Mount Status" and then something like "Identify Current Recovery" to test its access to root?

Lemme know what that tool says...

Thanks!

edit: signature links appear several posts up, but here's the app link, too:

https://play.google.com/store/apps/details?id=sa.root.toolkit
 
Upvote 0
SA,

Really appreciate your sticking with me.

Current root and mount status: system mounted as ready only. /(roots): mounted as read-write.

su: present/properly secured.
Superuser.apk: present
busybox not present
saved root: not present

Device appears to have root.

When I identify current recovery, application does not respond and then asked me to close.

Confirms what you been thinking. Your app is beautifully written; very impressive.
 
  • Like
Reactions: scary alien
Upvote 0
SA,

Really appreciate your sticking with me.

Current root and mount status: system mounted as ready only. /(roots): mounted as read-write.

su: present/properly secured.
Superuser.apk: present
busybox not present
saved root: not present

Device appears to have root.

When I identify current recovery, application does not respond and then asked me to close.

Confirms what you been thinking. Your app is beautifully written; very impressive.

Thank you for the kind words--I very much appreciate it :).

Wow, I'm still a little stumped here, jlt1112.

It almost sounds now like its because the Superuser app isn't responding to the su binary...

Have you tried re-installing the Superuser.apk app (you can get it from the Market)?

Can you try that?
 
Upvote 0
Went to uninstall SU via Apps in Settings; could not because it was loaded via the rooting process vice a download from the app store. All I can do is to stop process and disable. Went to the app store and it shows installed - no luck for a reinstall.

My intent sometime today is to try to rename it as you tried to have me do for \sbin. If I can't do that, then guess I should try to wipe and reload another ROM. Whether I am successful or not, I have really learned a lot and appreciate all your help!
 
Upvote 0
Went to uninstall SU via Apps in Settings; could not because it was loaded via the rooting process vice a download from the app store. All I can do is to stop process and disable. Went to the app store and it shows installed - no luck for a reinstall.

My intent sometime today is to try to rename it as you tried to have me do for \sbin. If I can't do that, then guess I should try to wipe and reload another ROM. Whether I am successful or not, I have really learned a lot and appreciate all your help!

jlt1112,

Yeah, you've certainly got a puzzler here...you've got root manually via adb, but not via an app.

I know you've said that you flashed various su.zip files for root, but can you point me to the links that you've downloaded them from?

I've read that others have had trouble with the "normal" su.zip file that we've got posted here in the GNex root guides, but I've used it on a 4.0.4 leak for my VZW Gnex and it rooted me just fine. But I'll try to find the link to the su.zip that will supposedly work on 4.0.4 (it is different, but I can't see why or how it installs the root binaries any differently).

If I had your phone in my hands and since you still have root access via adb, I would push / install a busybox manually on to the phone, use its find command to search for all of the su and Superuser.apk files and either delete them or re-secure them properly (and then, optionally re-flash the su.zip).

I'm happy to help guide you through that if you'd like, just let me know.

Cheers!
 
Upvote 0
SA,

Good by me - when you have time, send me the guide.

Best wishes!

jlt1112,

No problem, I'll get back with you with something after I get home from work.

In the meantime, I found the "4.0.4 approved" su.zip that I had seen over at XDA:

xda-developers - View Single Post - 4.0.4 OTA Officially Rolling Out Now (GSM-Yakju Only) Link Inside!

(here's the direct link to that post in that full thread: http://forum.xda-developers.com/showpost.php?p=24194838&postcount=582)

You might try flashing that and see if that magically makes a difference (although like I said, I certainly don't understand why it would--but others in that thread have reported that this is what is needed for 4.0.4).

Cheers!
 
Upvote 0
SA,

Good news - your program shows I have root and I was able to check other things. It seems that I had the wrong SU .... before your program executed, SU requested permission for it to do its job.

I can't thank you enough for all the time you have spent with me. I hope you gained something from this too. My very best wishes!

Joe

You are most welcome, Joe! :)

It was interesting, anyway...;) [I always learn something new].

Glad you're working now...

Cheers!
-SA
 
  • Like
Reactions: jlt1112
Upvote 0
Scary Alien,

I seem to have found myself in the same boat as Jlt1112 and have yet to find my way out. I ran the same codes in terminal and they are the exact same as his. I then tried to install the new su.zip to no avail. I'm also having the same issues with busybox, and when I ran your app, it came back the exact same as his as well. Any help would be appreciated. Oh and I left my iphone for this galaxy nexus 3 days ago.... Complete Noob.

Thanks!!!!!
 
Upvote 0
Scary Alien,

I seem to have found myself in the same boat as Jlt1112 and have yet to find my way out. I ran the same codes in terminal and they are the exact same as his. I then tried to install the new su.zip to no avail. I'm also having the same issues with busybox, and when I ran your app, it came back the exact same as his as well. Any help would be appreciated. Oh and I left my iphone for this galaxy nexus 3 days ago.... Complete Noob.

Thanks!!!!!

Hey StartledNinja (great name, by the way :)), welcome to the AndroidForums! :)

So, can you reset me here a little bit...I went back and re-read jlt1112 posts and it looks like his issues were solved by re-installing the root binaries (i.e., flashing the newest version via ClockworkMod).

You're on 4.0.4 and have ClockworkMod installed? And you downloaded and flashed this version of the su.zip?

xda-developers - View Single Post - 4.0.4 OTA Officially Rolling Out Now (GSM-Yakju Only) Link Inside!

Thanks!
 
  • Like
Reactions: StartledNinja
Upvote 0
Thanks for the response! I am actually on 4.1.1. I tried rooting using a combination of a few out of date methods, I then found a random post about updating the su.zip. I then flashed the one you pointed to, but nothing, actually when I try and flash, it tells me on the clkmod that I may loose root, so I hit yes to apply update from sdcard. And nothing! So here I am partially rooted and no idea what to flash or if I need to start over?
 
Upvote 0
Thanks for the response! I am actually on 4.1.1. I tried rooting using a combination of a few out of date methods, I then found a random post about updating the su.zip. I then flashed the one you pointed to, but nothing, actually when I try and flash, it tells me on the clkmod that I may loose root, so I hit yes to apply update from sdcard. And nothing! So here I am partially rooted and no idea what to flash or if I need to start over?

Ah, so you are on JellyBean?

You could flash the su.zip (SuperSU.zip) that I used for rooting my Nexus 7:

SuperSU Download

(courtesy of this thread: [16.07.2012] SuperSU v0.94 - xda-developers)

Try flashing that and see if it works.

Cheers!
 
  • Like
Reactions: StartledNinja
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones