Is there a way to create a hidden account?

The GUI tools ignore accounts with uid < 1000, which are reserved for system accounts. Give the account an unused uid in that range and it won't show up in the gui tools. Short of patching in a backdoor into the login program though, you can't hide it from the command line tools or direct inspection of /etc/passwd.


Since any user needs to have a password entry in /etc/passwd the answer is No. Anyone with root access can see the contents of the file and therefore know about your user. Even if you use directory services such as ldap, the user has to be registered somewhere.

When it comes to hiding from other desktop users, you can do some things to make it harder. Disabling the user list in gdm is one of them. You also probably want to put the home directory somewhere other than /home. But someone with a bit of knowledge might still be able to find out.


You can have shell users without a home directory:

useradd --no-create-home new_username

But this probably won't cut it if you need to be able to log in with this user. As Carsten says, there's always going to be a trail back to the user at some point because the system needs to authenticate them.

If you're just trying to hide somebody from the login screen, that's fairly easy.


A perhaps tangential but super-paranoid way to have a hidden user would be to have an encrypted partition (possibly on a USB stick or other portable device) with some combination of -- hidden files (a given), hidden scripts (to proxy or hide local and or internet data use), hidden OS/VM. Note that if you're interested in covering your tracks, your might need to obfuscate your local file usage, memory data, and tcp/ip activity.

encrypt-fs is included in recent Ubuntu releases. Another option is something like Truecrypt (which I have used but am not currently using) that allows you to do crazy things like "[provide] plausible deniability, in case an adversary forces you to reveal the password: [via] Hidden volume (steganography) and hidden operating system."