LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Deleting Users (https://www.linuxquestions.org/questions/linux-newbie-8/deleting-users-751430/)

wilbyforce 08-31-2009 04:13 AM

Deleting Users
 
I think I've made a complete hash of the Ubuntu install on my wife's laptop.

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?

Many thanks.

XavierP 08-31-2009 04:17 AM

Firstly, if you have simply installed it and not actually used it, a reinstall would be the quickest fix. Secondly, and Admin account? Rot is both built in and disabled - Ubuntu do not support installations which have the root account enabled, what will this admin account give you that an account+sudo won't?

wilbyforce 08-31-2009 05:11 AM

Quote:

Originally Posted by XavierP (Post 3663659)
and Admin account? Rot is both built in and disabled - Ubuntu do not support installations which have the root account enabled, what will this admin account give you that an account+sudo won't?

Well this is probably the newbie in me coming out but when I install Ubuntu the first account it creates has admin priviledges. This is the account that I use to install apps and apply updates. All other accounts are "desktop" users.

Are you saying that the primary account that Ubuntu creates should be have its Admin priviledges revoked?

Thanks for responding :)

Wim Sturkenboom 08-31-2009 05:23 AM

No that is not what he's saying, at least that's not what I understand. He's questioning why you need a seperate admin account if you have a normal user account with sudo (which equeals to an admin account).

wilbyforce 08-31-2009 05:35 AM

Well I'm totally confuzzled now! Ubuntu creates an Admin account during installation doesn't it? I don't mean Root, I mean the account that you name and supply a password for during installation. Sorry, I'm being a bit thick.

Wim Sturkenboom 08-31-2009 06:19 AM

The first account that is created is a normal user account that is added to sudoers and therefor can behave as an admin. You can indeed call that the admin account.

Quote:

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.
You already had that overall admin account, the first user that was created during install. So why create another one?

XavierP 08-31-2009 06:46 AM

Ok, I see what you're saying here. If you only want one account with rights to use sudo, just install as normal. If you want to have multiple accounts with some having access and some not, you will need to run sudo visudo and amend the sudoers file to specify who should have access and who shouldn't

mrrangerman 08-31-2009 06:48 AM

wilbyforce

In Debian, Slackware, Fedora and such when you install, a root account is setup and then users are added after. The Ubuntu's create a Primary user with sudo admin rights, which means the first user can make admin changes to the system. But there is NOT a root admin account as that you can log into like in other linux distros. If you have a root account you can log into that account and leave it open and work from it for any length of time. With a sudo account you perform the admin task at hand and that's it your left in a terminal as a user. With a root account it would be easy to walk away from the pc logged into a root session and have someone come up after you and do all kinds of damage. This is one way that Ubuntu helps in keeping a system secure, a terminal window left unattended and someone coming in after can not make changes affecting the system. Also if someone were to crack your system they can't get use of a root account because there is no root account, they would HAVE to get the passwd to make changes.

Hope that helps

wilbyforce 08-31-2009 06:54 AM

Many thanks to all who have responded, I think my penny is dropping at last. I'll take another look when I next have access to the laptop.

wilbyforce 08-31-2009 06:55 AM

Quote:

Originally Posted by mrrangerman (Post 3663796)
Hope that helps

Thanks for clarifying that.

linuxlover.chaitanya 08-31-2009 07:08 AM

Ok if you have deleted the normal user account and have not yet set the password for the root user you can still do that by booting into single user mode. You can then set the password for root account and then create the normal user account as well from there.

wilbyforce 08-31-2009 07:31 AM

Quote:

Originally Posted by linuxlover.chaitanya (Post 3663819)
Ok if you have deleted the normal user account and have not yet set the password for the root user you can still do that by booting into single user mode. You can then set the password for root account and then create the normal user account as well from there.

I think there's way too much potential for me to royally screw things up as root ;) but thanks for responding :)

linuxlover.chaitanya 08-31-2009 11:49 PM

Quote:

Originally Posted by wilbyforce (Post 3663844)
I think there's way too much potential for me to royally screw things up as root ;) but thanks for responding :)

Not just for you. But you can still create a user and then use that instead.

saifkhan123 09-01-2009 12:04 AM

hmmm
 
well!!!when i get stuck in users, i prefer looking at /etc/passwd file for,

wilbyforce 09-01-2009 01:36 AM

I deleted the phantom user from the Group file using vi and I was then able to re-create it as a desktop account. All is well, many thanks for all the advice :)


All times are GMT -5. The time now is 01:40 AM.