<s>
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
identify	O
a	O
user	O
by	O
a	O
value	O
called	O
a	O
user	B-Application
identifier	I-Application
,	O
often	O
abbreviated	O
to	O
user	B-Application
ID	I-Application
or	O
UID	O
.	O
</s>
<s>
The	O
UID	O
,	O
along	O
with	O
the	O
group	B-Application
identifier	I-Application
(	O
GID	O
)	O
and	O
other	O
access	O
control	O
criteria	O
,	O
is	O
used	O
to	O
determine	O
which	O
system	O
resources	O
a	O
user	O
can	O
access	O
.	O
</s>
<s>
UIDs	O
are	O
stored	O
in	O
the	O
inodes	B-Application
of	O
the	O
Unix	B-Application
file	B-Application
system	I-Application
,	O
running	O
processes	B-Operating_System
,	O
tar	B-Application
archives	I-Application
,	O
and	O
the	O
now-obsolete	O
Network	B-Operating_System
Information	I-Operating_System
Service	I-Operating_System
.	O
</s>
<s>
In	O
POSIX-compliant	O
environments	O
,	O
the	O
command-line	O
command	O
id	B-Application
gives	O
the	O
current	O
user	O
's	O
UID	O
,	O
as	O
well	O
as	O
more	O
information	O
such	O
as	O
the	O
user	O
name	O
,	O
primary	O
user	O
group	O
and	O
group	B-Application
identifier	I-Application
(	O
GID	O
)	O
.	O
</s>
<s>
The	O
POSIX	O
standard	O
introduced	O
three	O
different	O
UID	O
fields	O
into	O
the	O
process	O
descriptor	O
table	O
,	O
to	O
allow	O
privileged	O
processes	B-Operating_System
to	O
take	O
on	O
different	O
roles	O
dynamically	O
:	O
</s>
<s>
According	O
to	O
BSD	O
Unix	B-Application
semantics	O
,	O
the	O
group	O
ownership	O
given	O
to	O
a	O
newly	O
created	O
file	O
is	O
unconditionally	O
inherited	O
from	O
the	O
group	O
ownership	O
of	O
the	O
directory	O
in	O
which	O
it	O
is	O
created	O
.	O
</s>
<s>
According	O
to	O
AT&T	B-Operating_System
UNIX	I-Operating_System
System	B-Operating_System
V	I-Operating_System
semantics	O
(	O
also	O
adopted	O
by	O
Linux	B-Application
variants	O
)	O
,	O
a	O
newly	O
created	O
file	O
is	O
normally	O
given	O
the	O
group	O
ownership	O
specified	O
by	O
the	O
egid	O
of	O
the	O
process	O
that	O
creates	O
the	O
file	O
.	O
</s>
<s>
Most	O
filesystems	B-Application
implement	O
a	O
method	O
to	O
select	O
whether	O
BSD	O
or	O
AT&T	O
semantics	O
should	O
be	O
used	O
regarding	O
group	O
ownership	O
of	O
a	O
newly	O
created	O
file	O
;	O
BSD	O
semantics	O
are	O
selected	O
for	O
specific	O
directories	O
when	O
the	O
S_ISGID	O
(	O
s-gid	O
)	O
permission	O
is	O
set	O
.	O
</s>
<s>
Linux	B-Application
also	O
has	O
a	O
file	B-Application
system	I-Application
user	B-Application
ID	I-Application
(	O
fsuid	O
)	O
which	O
is	O
used	O
explicitly	O
for	O
access	O
control	O
to	O
the	O
file	B-Application
system	I-Application
.	O
</s>
<s>
It	O
may	O
be	O
root	O
's	O
user	B-Application
ID	I-Application
only	O
if	O
ruid	O
,	O
suid	O
,	O
or	O
euid	O
is	O
root	O
.	O
</s>
<s>
The	O
intent	O
of	O
fsuid	O
is	O
to	O
permit	O
programs	O
(	O
e.g.	O
,	O
the	O
NFS	B-Protocol
server	O
)	O
to	O
limit	O
themselves	O
to	O
the	O
file	B-Application
system	I-Application
rights	O
of	O
some	O
given	O
uid	O
without	O
giving	O
that	O
uid	O
permission	O
to	O
send	O
them	O
signals	O
.	O
</s>
<s>
Since	O
kernel	O
2.0	O
,	O
the	O
existence	O
of	O
fsuid	O
is	O
no	O
longer	O
necessary	O
because	O
Linux	B-Application
adheres	O
to	O
SUSv3	O
rules	O
for	O
sending	O
signals	O
,	O
but	O
fsuid	O
remains	O
for	O
compatibility	O
reasons	O
.	O
</s>
<s>
The	O
saved	O
user	B-Application
ID	I-Application
(	O
suid	O
)	O
is	O
used	O
when	O
a	O
program	O
running	O
with	O
elevated	O
privileges	O
needs	O
to	O
do	O
some	O
unprivileged	O
work	O
temporarily	O
;	O
changing	O
euid	O
from	O
a	O
privileged	O
value	O
(	O
typically	O
0	O
)	O
to	O
some	O
unprivileged	O
value	O
(	O
anything	O
other	O
than	O
the	O
privileged	O
value	O
)	O
causes	O
the	O
privileged	O
value	O
to	O
be	O
stored	O
in	O
suid	O
.	O
</s>
<s>
A	O
process	O
without	O
superuser	B-Application
privileges	O
may	O
signal	O
another	O
process	O
only	O
if	O
the	O
sender	O
's	O
ruid	O
or	O
euid	O
matches	O
receiver	O
's	O
ruid	O
or	O
suid	O
.	O
</s>
<s>
Most	O
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
represent	O
the	O
UID	O
as	O
an	O
unsigned	O
integer	O
.	O
</s>
<s>
The	O
size	O
of	O
UID	O
values	O
varies	O
amongst	O
different	O
systems	O
;	O
some	O
UNIX	B-Application
OS	O
's	O
used	O
15-bit	O
values	O
,	O
allowing	O
values	O
up	O
to	O
32767	O
,	O
while	O
others	O
such	O
as	O
Linux	B-Application
(	O
before	O
version	O
2.4	O
)	O
supported	O
16-bit	B-Device
UIDs	O
,	O
making	O
65536	O
unique	O
IDs	B-Application
possible	O
.	O
</s>
<s>
The	O
majority	O
of	O
modern	O
Unix-like	B-Operating_System
systems	I-Operating_System
(	O
e.g.	O
,	O
Solaris-2.0	O
in	O
1990	O
,	O
Linux	B-Application
2.4	O
in	O
2001	O
)	O
have	O
switched	O
to	O
32-bit	O
UIDs	O
,	O
allowing	O
4,294,967,296	O
(	O
232	O
)	O
unique	O
IDs	B-Application
.	O
</s>
<s>
The	O
Linux	B-Application
Standard	I-Application
Base	I-Application
Core	O
Specification	O
specifies	O
that	O
UID	O
values	O
in	O
the	O
range	O
0	O
to	O
99	O
should	O
be	O
statically	O
allocated	O
by	O
the	O
system	O
,	O
and	O
shall	O
not	O
be	O
created	O
by	O
applications	O
,	O
while	O
UIDs	O
from	O
100	O
to	O
499	O
should	O
be	O
reserved	O
for	O
dynamic	O
allocation	O
by	O
system	O
administrators	O
and	O
post	O
install	O
scripts	O
.	O
</s>
<s>
Debian	O
Linux	B-Application
not	O
only	O
reserves	O
the	O
range	O
100	O
–	O
999	O
for	O
dynamically	O
allocated	O
system	O
users	O
and	O
groups	O
,	O
but	O
also	O
centrally	O
and	O
statically	O
allocates	O
users	O
and	O
groups	O
in	O
the	O
range	O
60000-64999	O
and	O
further	O
reserves	O
the	O
range	O
65000	O
–	O
65533	O
.	O
</s>
<s>
Some	O
POSIX	O
systems	O
allocate	O
UIDs	O
for	O
new	O
users	O
starting	O
from	O
500	O
(	O
macOS	B-Application
,	O
Red	O
Hat	O
Enterprise	O
Linux	B-Application
till	O
version	O
6	O
)	O
,	O
others	O
start	O
at	O
1000	O
(	O
Red	O
Hat	O
Enterprise	O
Linux	B-Application
since	O
version	O
7	O
,	O
openSUSE	B-Operating_System
,	O
Debian	O
)	O
.	O
</s>
<s>
On	O
many	O
Linux	B-Application
systems	O
,	O
these	O
ranges	O
are	O
specified	O
in	O
/etc/login.defs	O
,	O
for	O
useradd	O
and	O
similar	O
tools	O
.	O
</s>
<s>
Central	O
UID	O
allocations	O
in	O
enterprise	O
networks	O
(	O
e.g.	O
,	O
via	O
LDAP	B-Protocol
and	O
NFS	B-Protocol
servers	O
)	O
may	O
limit	O
themselves	O
to	O
using	O
only	O
UID	O
numbers	O
well	O
above	O
1000	O
,	O
and	O
outside	O
the	O
range	O
60000	O
–	O
65535	O
,	O
to	O
avoid	O
potential	O
conflicts	O
with	O
UIDs	O
locally	O
allocated	O
on	O
client	O
computers	O
.	O
</s>
<s>
OS-level	B-Application
virtualization	I-Application
can	O
remap	O
user	B-Application
identifiers	I-Application
,	O
e.g.	O
</s>
<s>
using	O
Linux	B-Architecture
namespaces	I-Architecture
,	O
and	O
therefore	O
need	O
to	O
allocate	O
ranges	O
into	O
which	O
remapped	O
UIDs	O
and	O
GIDs	O
are	O
mapped	O
:	O
</s>
<s>
The	O
systemd	B-Application
authors	O
recommend	O
that	O
OS-level	B-Application
virtualization	I-Application
systems	O
should	O
allocate	O
65536	O
(	O
216	O
)	O
UIDs	O
per	O
container	B-Application
,	O
and	O
map	O
them	O
by	O
adding	O
an	O
integer	O
multiple	O
of	O
216	O
.	O
</s>
<s>
0	O
:	O
The	O
superuser	B-Application
normally	O
has	O
a	O
UID	O
of	O
zero	O
(	O
0	O
)	O
.	O
</s>
<s>
65535	O
:	O
This	O
value	O
is	O
still	O
avoided	O
because	O
it	O
was	O
the	O
API	O
error	O
return	O
value	O
when	O
uid_t	O
was	O
16	B-Device
bits	I-Device
.	O
</s>
<s>
Nobody	B-Operating_System
:	O
Historically	O
,	O
the	O
user	O
"	O
nobody	B-Operating_System
"	O
was	O
assigned	O
UID	O
-2	O
by	O
several	O
operating	O
systems	O
,	O
although	O
other	O
values	O
such	O
as	O
215−1	O
=	O
32,767	O
are	O
also	O
in	O
use	O
,	O
such	O
as	O
by	O
OpenBSD	B-Operating_System
.	O
</s>
<s>
For	O
compatibility	O
between	O
16-bit	B-Device
and	O
32-bit	O
UIDs	O
,	O
many	O
Linux	B-Application
distributions	O
now	O
set	O
it	O
to	O
be	O
216−2	O
=	O
65,534	O
;	O
the	O
Linux	B-Application
kernel	O
defaults	O
to	O
returning	O
this	O
value	O
when	O
a	O
32-bit	O
UID	O
does	O
not	O
fit	O
into	O
the	O
return	O
value	O
of	O
the	O
16-bit	B-Device
system	O
calls	O
.	O
</s>
<s>
Fedora	O
Linux	B-Application
assigns	O
the	O
last	O
UID	O
of	O
the	O
range	O
statically	O
allocated	O
for	O
system	O
use	O
(	O
0	O
–	O
99	O
)	O
to	O
nobody	B-Operating_System
:	O
99	O
,	O
and	O
calls	O
65534	O
instead	O
nfsnobody	O
.	O
</s>
<s>
However	O
,	O
as	O
long	O
as	O
operating-system	O
kernels	O
and	O
local	O
file	B-Application
systems	I-Application
continue	O
to	O
use	O
integer	O
user	B-Application
identifiers	I-Application
,	O
this	O
comes	O
at	O
the	O
expense	O
of	O
additional	O
translation	O
steps	O
(	O
using	O
idmap	O
daemon	O
processes	B-Operating_System
)	O
,	O
which	O
can	O
introduce	O
additional	O
failure	O
points	O
if	O
local	O
UID	O
mapping	O
mechanisms	O
or	O
databases	O
get	O
configured	O
incorrectly	O
,	O
lost	O
,	O
or	O
out	O
of	O
sync	O
.	O
</s>
