简体   繁体   中英

what is UID in linux?

what is UID in linux? Wiki and other online sources say it is user ID. But what exactly is user id? The name "user id" gives me a sense that it is the user who is using the OS. Like If I have only one user, my user id should be 1. For root, I understand that it is 0.

But I see that the user id is given to every process(application ?). So, does every process has a different uid? Why is it needed when we have pid already to distinguish them.

Ex :
root:/ # ps 8533
USER     PID   PPID  VSIZE  RSS     WCHAN    PC        NAME
u0_a78    8533  363   1526628 52668 ffffffff b6f80d04 S com.google.android.keep

root:/ # cat /proc/8533/status
Name:   le.android.keep
State:  S (sleeping)
Tgid:   8533
Pid:    8533
PPid:   363
TracerPid:  0
Uid:    10078   10078   10078   10078
....

So here for the process google keep, the UID is 10078. So, are there more than 10000 users? If yes, then Who exactly is a user?

UID is the Linux user ID.

User IDs don't have to start counting at 0 or 1. There's nothing that says that user IDs go up from 0, 1, 2, ... etc. so there is nothing strange with the fact that the UID is 10078.

On Android, every app gets its own Linux user. This is done for security management reasons; the permissions for each user = each app can be managed at the OS level in this way. Every time you install a new app, a new Linux user is created for that app.

This is explained in more detail in: Android System Permissions

The Linux user is an operating system level user, and does not have any direct relation to the person who is using the Android device.

我注意到,在Android中(至少5和6),任何大于10000的uid都对应于非系统用户,即非系统应用程序。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM