Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am wondering whether is it possible to log in in a computer with users like www-data or postgres as I do with my own user. Are some users "allowed to log in" while others not? Is there any difference between my own user and the ones created by programs like apache, postgres besides name? They got password?? As you may see I have lots of doubts, maybe you could recommend me some reading about this topic!

The question born when I was trying to create a new group and add new users to that group in Ubuntu 11.04 via the gnome GUI. I was able to create a new group "test" but the system only allowed me to add my user to that group and not the other users in the system like the ones that appear in /etc/passwd (I was running the Add Users/Group GUI with sudo privileges).

share|improve this question
up vote 1 down vote accepted

It is possible to disable (password) login into an account, using the -l option in passwd. That is how most of the system users, such as www-data and postgres in your examples, are set up.

share|improve this answer
Thanks for your answer... Ok, so I know now that users may not be able to login with password. I have read the adduser and useradd manpages and they say that the user can still log in with RSA keys for example. My question now is, www-data or other system users, login with this way?? Does it make sense if a user cannot login? How? – flyer88 Nov 1 '11 at 20:03
Yes, system users can log in via key-pair ssh (no local token auth that I've heard of, but I suppose it could happen), but root would have to create the key pair and install it to the authorized_keys file. If you're asking why there can be (system) accounts that can't be logged into, it's because the processes that use those accounts can still be run as them (read about the suid bit). – Kevin Nov 1 '11 at 20:40
@flyer88: If you're worried about these users logging in, another small step is to check that their shell in /etc/passwd is something that doesn't give them a shell. Usual choices for this are /sbin/nologin or /bin/false. – Ulrich Schwarz Nov 2 '11 at 6:50
Thanks! Got it! – flyer88 Nov 2 '11 at 18:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.