After I saw this answer, I realized that there are many guest accounts on my system:

grep guest /etc/passwd

Moreover, in this moment there is nobody logged as guest, but if somebody will login as guest, a new guest account is created - why, since there are already other guest accounts? After the new guest will log out, his account will be deleted. But why the other guest accounts remain? For what use/purpose?

It doesn't mind me at all this guest account, but I want to know if it is okay to delete them manually.

  • Which Ubuntu version are you using? By default a new guest account is created whenever you login as guest and deleted when you logout, so creating a new user account is normal. Maybe something went wrong while deleting those user accounts... – Salem Aug 27 '13 at 12:15
  • BTW if you are curious you can see how guest accounts are created/deleted in /usr/sbin/guest-account. – Salem Aug 27 '13 at 13:12

The guest-XXXXXX entries in /etc/passwd and /etc/group are normally removed when you log out from a guest session. Maybe you have somehow rebooted a few times without logging out first.

You can safely delete the entries. If you do it like this:

sudo deluser guest-jzXeRx

for respective guest username, both /etc/passwd and /etc/group will be cleaned up.

  • Yep, these accounts are not removed only if I force a reboot (without logging out, of course). – Radu Rădeanu Feb 2 '14 at 10:12

I'm putting in my two cents. It's normal to see that.

In Ubuntu 1000 + User ID (uid) are allowed for Normal user and below 1000(uid) are assigned to system application and daemons. Plus guest accounts are removed periodically. So if you want to check completely how many user are on you system, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

cat /etc/passwd | grep /home


For me guest accounts are removed periodically (I logged in as guest more than 10 times, but none stayed very long in /etc/passwd). You might want to try it yourself.

Now, Ubuntu's Guest account is a special type of account, which has its home directory set to the mount point of a tmpfs filesystem, which is used to store data which gets lost after a reboot.

The data in tmpfs is stored in RAM, which uses the swap space as a fall back, so it is likely the data has never been written to disk in the first place, so there's basically nothing to recover.

Since tmpfs is temporary storage. It is intended to appear as a mounted file system, but stored in volatile memory instead of a persistent storage device. Everything stored in tmpfs is temporary in the sense that no files will be created on the hard drive; however, on reboot, everything in tmpfs will be lost.

  • When nobody is logged as guest on your system, what is the output of grep guest /etc/passwd command in your case? – Radu Rădeanu Aug 29 '13 at 13:35
  • Here is an image of the outcome. – Mitch Aug 29 '13 at 14:04
  • And nobody was logged as guest on that moment? I ask because normaly the default shell /bin/bash is set for a guest only when is logged in. – Radu Rădeanu Aug 29 '13 at 14:21
  • Nobody logged in as guest, and I even rebooted the system, right before I added the screen output. – Mitch Aug 29 '13 at 14:28
  • So, I'm not the only one with this "problem". I am not clear from where these accounts appear. As I said and as you said, after the guest will log out, his account will be deleted. – Radu Rădeanu Aug 29 '13 at 14:56

As you know that every time a guest session starting by a user , a temporary user will be created with limited privileges and when he ends the session the data will be erased about his session.

but next time if any other user trying to do guest session means again a new guest session have to create with new guest ID.

so Ubuntu setting all the created guest id's to false , so that when you set a users shell to /usr/bin/false, they will not be able log in with older guest ID's and new Id have to create everytime.In your question we have many guest users guest-jzXeRx ,guest-l5dAPU ,guest-FdSAkw ,guest-eBU0cU. these are the guest ID's and with those you will not be able to login next time.

hope that helps my friend.


To remove all guest accounts:

for line in $(grep -o 'guest-......'  /etc/passwd | sort -u); do sudo deluser $line; done

Sample output:

Removing user `guest-2LGMce' ...
Warning: group `guest-2LGMce' has no more members.
Removing user `guest-5T4CBr' ...
Warning: group `guest-5T4CBr' has no more members.
Removing user `guest-8eZELT' ...
Warning: group `guest-8eZELT' has no more members.
  • this was helpful. – Ali Nov 7 '16 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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