From: Will Kemp on
On 08/31/2009 09:19 AM, Bilky White wrote:
> Linux newbie here. I installed Ubuntu on my wife's laptop and, like an
> idiot, I entered her account details first instead of setting up an overall
> admin account. After installing I created an admin account thinking that
> I'd be able to delete the original account and re-create it. It allowed me
> to delete the user account via the Admin/Users and Groups menu item but if I
> try to recreate it I get an error telling me that it already exists.
>
> I've tried this
>
> sudo userdel -r<username>
>
> but that returns a "<username> does not exist" error, which doesn't make
> sense.
>
> I'm getting the feeling that it might be worth starting the install from
> scratch, any opinions or advice?

It would be ridiculous to reinstall just because of a problem with a
user. This is Linux, not Windows - don't reinstall to fix problems
(unless they were serious problems related to the installation itself,
which this isn't).

To manually delete a user, delete the line for that user from
/etc/passwd , /etc/shadow , /etc/group .

Delete /home/<username> and /var/spool/mail/<username> (if it exists).

I haven't got a Ubuntu installation handy to check, but you may need to
delete them from /etc/sudoers as well (but read any comments at the top
of that file first).

Go through all these steps - some of them should have been done for you
by whatever you used to delete the user in the first place - and delete
whatever hasn't been deleted.

Then you shouldn't have trouble adding that user again.



--
http://NovemberEchoRomeoDelta.com

From: Bilky White on
"chris" <ithinkiam(a)gmail.com> wrote in message
news:h7g2g3$noo$1(a)news.eternal-september.org...
>
>
> Simply create your account first and then your wife's.

That's what I *meant* to do and is what I've always previously done but
rushing and doing something else at the same time led me to make a mistake.
The purpose of starting this thread was to try to find out if I could either
correct the mistake or if I'd have to start again. It looks like the latter
would be easier for me.

:)

From: Bilky White on
"Will Kemp" <will(a)xxxx.swaggie.net> wrote in message
news:CGMmm.58014$fN.16570(a)newsfe09.ams2...
>
> It would be ridiculous to reinstall just because of a problem with a user.
> This is Linux, not Windows - don't reinstall to fix problems (unless they
> were serious problems related to the installation itself, which this
> isn't).

That's what I wanted to hear!

>
> To manually delete a user, delete the line for that user from /etc/passwd
> , /etc/shadow , /etc/group .
>
> Delete /home/<username> and /var/spool/mail/<username> (if it exists).
>
> I haven't got a Ubuntu installation handy to check, but you may need to
> delete them from /etc/sudoers as well (but read any comments at the top of
> that file first).
>
> Go through all these steps - some of them should have been done for you by
> whatever you used to delete the user in the first place - and delete
> whatever hasn't been deleted.
>
> Then you shouldn't have trouble adding that user again.
>

Many thanks Will, I will try that as soon as I can.

From: Bilky White on
"Will Kemp" <will(a)xxxx.swaggie.net> wrote in message
news:CGMmm.58014$fN.16570(a)newsfe09.ams2...
>
>
> To manually delete a user, delete the line for that user from /etc/passwd
> , /etc/shadow , /etc/group .
>
> Delete /home/<username> and /var/spool/mail/<username> (if it exists).
>

/etc/group proved to be the clincher, having 2 lines of code pertaining to
the deleted user. I have now re-created the account as a desktop user.
Thanks so much, you've saved me from re-installing!

From: Geoffrey Clements on
"Bilky White" <here(a)where.com> wrote in message
news:4a9cd18a_1(a)glkas0286.greenlnk.net...
> "Will Kemp" <will(a)xxxx.swaggie.net> wrote in message
> news:CGMmm.58014$fN.16570(a)newsfe09.ams2...
>>
>>
>> To manually delete a user, delete the line for that user from /etc/passwd
>> , /etc/shadow , /etc/group .
>>
>> Delete /home/<username> and /var/spool/mail/<username> (if it exists).
>>
>
> /etc/group proved to be the clincher, having 2 lines of code pertaining to
> the deleted user. I have now re-created the account as a desktop user.
> Thanks so much, you've saved me from re-installing!

As said elsewhere you rarely need to reinstall unless you do bloody stupid
things like I am wont to do on occasion; a year or so ago I copied /etc to
go under /home (a different partition) whilst I did some things that were
potentially dangerous, this was just meant to be temporary. I couple of
weeks ago I realized I still had the copy so to remove it I did:
# cd /home
# rm -fr /etc

DOH!

--
Geoff