No, given your description, you did not lose any of your files (except /etc/passwd
, which you deleted, but which you had backed up).
Boot an Ubuntu live CD/DVD or live USB flash drive. Select Try Ubuntu
(not Install Ubuntu
). When the desktop loads, open a Nautilus (file browser) window. You can find the partition for your Ubuntu system under Devices
. Click on it to mount it.
Now you can restore the backup. You have to do it as root, however. Here's one pretty easy way to do it.
Open a Terminal window (Ctrl+Alt+T). In the Terminal, type cd
and type the Space key, but don't press Enter yet.
In Nautilus, find the etc
directory inside the installed Ubuntu system. (This is not the same as the etc
directory for the live CD. The etc
directory inside the installed Ubuntu system is in the partition you just mounted.)
Drag this etc
directory into the Terminal, which will paste its full path into the Terminal, completing the cd ...
command.
Press Enter to run the command. Now you're in the directory that contained your passwd
file. I am assuming that your backup file, passwd_bkp
, is also located here.
Run this command:
sudo cp passwd_bkp passwd
That restores the passwd
file from your backup, so now you should be able to reboot, remove the CD/DVD or USB flash drive, and boot back into your installed Ubuntu system. Your installed Ubuntu system should work again.
For the future, you should be aware that it is not recommended to manually edit /etc/passwd
, /etc/group
, /etc/shadow
, or /etc/gshadow
. Instead, you should use the utilities provided as part of Ubuntu to make any changes you need to users and groups on your system. You're probably aware that you can edit this in System Settings or with users-admin
. But there are also very powerful command-line utilities for this, which are still much safer and easier than manually editing the configuration files yourself. Here's documentation on the most relevant such utilities in Ubuntu:
You can change your username with some of those utilities. This answer explains one way in detail. However, you should be aware (as is currently touched on by a comment there) that some applications assume your username remains the same. So changing your username might cause some problems.
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.
Best Answer
This is a user that is created by installing
tor
ortor-browser
.For instance, if you look into
postinst
script oftor
package, you'll see:But this user is not removed when you uninstall
tor
. I don't see anything that removes the user inprerm
, orpostrm
script.So it means that you have
tor
installed, or installed it previously.There is no harm in having some extra user in your system, but you can remove it if you like.
You can remove the user by running