[Novalug] Recover a dummy user?
Mackenzie Morgan
macoafi at gmail.com
Sun Jul 20 12:26:24 EDT 2008
On Sun, 2008-07-20 at 09:22 -0700, Beartooth wrote:
> On Sun, 20 Jul 2008, Kevin Cole wrote:
>
> > On Sun, Jul 20, 2008 at 10:57, Beartooth <karhunhammas at lserv.com> wrote:
> [...]
> >> 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.)
>
> Hmmm ... I can do most of that, a line at a time, with
> "nano -w" afaict; I've never touched any serious editor, sed nor
> vi nor perl (which I take it you're using, in effect, as an
> editor here). I can certainly c&p; the question then would
> become, I suppose, whether I have enough of perl installed.
The sed way is to get rid of the -p, get rid of the semi-colons, and
change the | inside the "" to /
--
Mackenzie Morgan
http://ubuntulinuxtipstricks.blogspot.com
apt-get moo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://calypso.tux.org/pipermail/novalug/attachments/20080720/6ba42987/attachment.bin
More information about the Novalug
mailing list