Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
103
rated 0 times [  103] [ 0]  / answers: 1 / hits: 201129  / 2 Years ago, sun, april 3, 2022, 6:00:25

After I read List all human users I noticed that there is a user account named 'nobody' in my Ubuntu system.



Also I noticed that I can login in this account from terminal using the following command and my password:



sudo su nobody


su nobody



It doesn't mind me at all, but I want to know what is the purpose of this user? Is it created by default on a fresh install of Ubuntu or is created by installing a particular package?


More From » users

 Answers
6

It's there to run things that don't need any special permissions. It's usually reserved for vulnerable services (httpd, etc) so that if they get hacked, they'll have minimal damage on the rest of the system.


Contrast this with running something as a real user, if that service were compromised (web servers are occasionally exploited to run arbitrary code), it would run as that user and have access to everything that user had. In most cases, this is as bad as getting root.


You can read a little bit more about the nobody user on the Ubuntu Wiki:



To answer your follow-ups:


Why I can't access this account with su nobody?


sudo grep nobody /etc/shadow will show you that nobody doesn't have a password and you can't su without an account password. The cleanest way is to sudo su nobody instead. That'll leave you in a pretty desolate sh shell.


Can you give a particular example when is indicated to use this account?


When permissions aren't required for a program's operations. This is most notable when there isn't ever going to be any disk activity.


A real world example of this is memcached (a key-value in-memory cache/database/thing), sitting on my computer and my server running under the nobody account. Why? Because it just doesn't need any permissions and to give it an account that did have write access to files would just be a needless risk.


[#30045] Monday, April 4, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ciousuntru

Total Points: 352
Total Questions: 124
Total Answers: 95

Location: Grenada
Member since Tue, Oct 12, 2021
3 Years ago
;