[Novalug] Recover a dummy user?

Kevin Cole dc.loco@gmail.com
Sun Jul 20 11:26:37 EDT 2008


On Sun, Jul 20, 2008 at 10:57, Beartooth <karhunhammas@lserv.com> wrote:

>        Meanwhile, I have installed Fedora 7, which it runs fine,
> at odd moments gradually tweaking some things and downloading
> others, so that it's nearly as useful to me as ever. But I did it
> with a dummy user, called simply "user" (who has a trivial
> password), and a very weak but easily remembered password for
> root, since I meant to hand the machine over any day.
>
>        I can change root's password easily enough. And I can add
> btth as a new user, then copy /home/user to /home/btth, then
> chown it all. But what about all the various settings of the
> panel, the preferences on the browsers, etc.?
>
>        Is there an easy way to keep those things, too, or will
> it be less bother just to do it all over? (If only FEBE worked
> for all browsers ...)

Although, if I recall, there may be a few "edge cases", the easier(?)
thing to do is login as root and edit /etc/passwd, /etc/shadow and
/etc/group. Change "user" to "btth" in each.

Then rename /home/user to /home/btth, and finally either "passwd btth"
as root, or login as btth using the trivial password and do a "passwd"
and "upgrade" your password.

In a nutshell, using perl because I'm not sure exactly how to do it in sed...

perl -p -i -e "s|user|btth|g;" /etc/passwd
perl -p -i -e "s|user|btth|g;" /etc/shadow
perl -p -i -e "s|user|btth|g;" /etc/group
mv /home/user /home/btth
passwd btth

"user" is currently associated with a particular numeric user id and a
numeric group id.  The above just changes the name of the user that is
associated with that number.  There are a few other places deep in the
bowels of various apps that may remember "user" as a name but as I
recall they were easily remedied as the need arose, and very rare.

But you may want to wait for a second opinion on the advice above.
(It's worked okay for me in the past, but perhaps I was playing with
fire.)

-- 
Ubuntu Linux DC LoCo
Washington, DC
http://dc.ubuntu-us.org/



More information about the Novalug mailing list