I used Systemback to make a restore points. Yesterday I was doing something and couldn't make things work properly, so I used Systeback to restore the system to a point in the past. The machine had about 10 people's account(though most of them are doing almost nothing yet..) The problem is, at that restore point, there were only 3 persons. I have the latest /etc/passwd file and all the 10 peoples' account intact. I tried editing /etc/passwd adding some entries for the added accounts but found users with the new accounts added after the restore point cannot log in. How can I use the /etc/passwd file and old home directories without making new accounts and linking them to old directories? (ubuntu 16.04.6)
1 Answer
Some password info is also stored in /etc/shadow
, so entries in that file may also need to be made (or that file restored; not just /etc/passwd
)
In comments I was also asked about the location of sudoers file; it's /etc/sudoers
. It's risky to edit that file directly (which I do on occasion anyway) as when it's read, if an error is detected it's treated as the EOF (end-of-file) which means any users with rights from that line on in file are ignored which can stop them using sudo
. The command visudo
command edits the file (using your default editor) and checks for errors before exit.
-
thanks! I once used visudo but the editor was something that I am not familiar with, so I made a mistake (by joining some lines..) and sudo didn't work. So I had to do
su
(as root) and correct the /etc/sudoers file. I thinks using visudo is trickier. :)– Chan KimJul 2, 2019 at 10:36 -
1Have a look at askubuntu.com/questions/539243/… (ie.
visudo
to me makes perfect because I prefervim
being the modern version ofvi
) but you can change $EDITOR to something more to your tastes.– guivercJul 2, 2019 at 10:51
visudo
(it checks for errors as the file is ignored from the point an nn error is detected, and thus you can lock yourself out of sudo with a typo)