what 's difference between android system user and linux root user

When I connect my phone to computer,then I use “adb shell” command to communicate with my phone and input ps command to output processes info that currently run on my phone,I find two special users,one is root,the other is system,as far as I know,android based on linux,so root user is the bigest authority user,but I confuse with system user,maybe I can consider it as a normal user in linux system,But it is special in Android,it has a lot of permissions related to android,so Can someone tell me the real different between root user and system user,and why android need to add a system user?thanks:)

  • Sharing an image with Google+ app using Intent.ACTION_SEND and Intent.EXTRA_STREAM
  • Retrofit - Okhttp client How to cache the response
  • To access shared SharedPreference from service in android
  • Can I setup app global custom styles for android-support-design widgets?
  • How to obtain the android_id of a device?
  • android: quality of the images resized in runtime
  • Related posts:

    What is the Android GSF package?
    Modern carousel library for android
    how to set custom locale for indian regional languages in android emulator
    Is there a better way of getting a reference to the parent RecyclerView from the adapter?
    Android slow soft keyboard opening
    react-native-tcp not working on Android 7+
  • ADB push -p Bad file descriptor
  • How can I use duplicate IDs in different layouts?
  • Error:Could not find property 'assembleDebug' on project ':app'
  • Android studio logcat nothing to show
  • Why are adjacent Buttons moving when I change the size of the text in a Button
  • Sending images from gallery to Web Service using SOAP
  • 2 Solutions collect form web for “what 's difference between android system user and linux root user”

    As far as Linux is concerned, the system user is just a regular user (UID 1000). Android services however give it special permissions and you can get access to pretty much anything. Most services have code like this somewhere:

    private static final void enforceSystemOrRoot(String message) {
        final int uid = Binder.getCallingUid();
        if (uid != Process.SYSTEM_UID && uid != 0) {
            throw new SecurityException(message);
        }
    }
    

    What that does is deny access to anyone who is not root or system. The shell user (UID 2000) (what you get when doing adb shell) is another user with a lot of power (member of many groups). Cf.

    system:

     $ su 1000
     $ id
     uid=1000(system) gid=1000(system)
     groups=1003(graphics),1004(input),1007(log),1009(mount),
     1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),
     3002(net_bt),3003(inet),3006(net_bw_stats)
    

    shell:

    $ adb shell
    shell@android:/ $ id
    uid=2000(shell) gid=2000(shell)   
    groups=1003(graphics),1004(input),1007(log),1009(mount),
    1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),
    3002(net_bt),3003(inet),3006(net_bw_stats)
    

    Android uses a separate user for every app, and system services also have their dedicated users (media, radio, wifi, etc.). Very few things run as root (mostly native daemons).

    system user can not access other user’s files.

    If you do:
    ls -l /data/data/com.google.android.gm/shared_prefs/

    You will got ‘permission denied’

    If you are root user, you can do anything.
    You can access all the file system, wipe all the data.

    You can also reboot the phone, etc.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.