How to set permissions using chmod

I recently found a way to support root access on my Android device using the dropbear SSH server, which I modified to run at boot as root using init.d, the lil script layout, and some configuration scripts that I made. If you want, you can check it here ... In any case, for the experiment, I removed the su-binary and Superuser.apk from the system. I managed to get them back to the system, but I don't know how to set the appropriate permissions for the su binary file. If I watch the Super User application on another root phone and proceed with the update, it shows -rwsr -sr-xas permissions on the binary file. How can I set the same permissions manually and what do they mean? In particular, the s-part.

+4
source share
1 answer

Part s is a bit setuid. Wikipedia :

setuid and setgid (short for "set user identifier at run time" and "set group id at run time, respectively) are Unix permissions flags that allow users to run the executable file with the permissions of the executive owner or group, respectively, and change the behavior in directories.

This permission string means:

  • owner can read, write and execute
  • users in the file group can read and execute
  • other users can read and execute
  • file has setuid set

, chmod 06755 /system/bin/su. , (= " ", , " " - " " ), :

  • setuid (4) setgid (2) = 6
  • (7)
  • (5)
  • (5)
+4

All Articles