what 's difference between android system user and linux root user
2014-10-23 15:08
141 查看
摘自: http://stackoverflow.com/questions/16933108/what-s-difference-between-android-system-user-and-linux-root-user
Q: 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:)
A:
s far as Linux is concerned, the
What that does is deny access to anyone who is not root or
Android uses a separate user for every app, and system services also have their dedicated users (
share|improve
this answer
Q: 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:)
A:
s far as Linux is concerned, the
systemuser 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
shelluser (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 thins run as root (mostly native daemons).
share|improve
this answer
down vote | 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. |
相关文章推荐
- 开篇 why python&&what python
- eXpressApp Framework 8.1.4 released on 30 May 2008 and What'a New
- POJ 3130 & ZOJ 2820 How I Mathematician Wonder What You Are!(半平面相交 多边形是否有核)
- what's this , it's a ruler
- THE QUESTIONS :The Top 25 (what we don't know?)
- What's POD (C++ Language Note)
- [aidl] terminate called after throwing an instance of 'std::logic_error' [aidl] what(): basic_string
- Yann LeCun video: (What's Wrong with Deep Learning?)
- What's New in Python3.0
- what is the mean of "GPRINT Type" in cacti
- What's my mail file size?
- Delphi XE2 新技术说明 (What's new in Delphi XE2)
- ArcGIS Mobile 9.4学习笔记六之What's new in 9.4
- what's the difference between OnDraw and OnPaint
- What is "35mm equivalent focal length?"
- What to do with "ORA-60 Deadlock Detected" Errors [ID 62365.1](oracle deadlock 学习资料-05.1)
- What's the difference between tape expiry date and image expiry date
- What is Lead & Lag?
- 'You've got to find what you love,' Jobs says
- What's New in eXpressApp Framework v7.3.7