Page 1 of 1

Root and user accounts

Posted: Mon Jan 16, 2012 4:44 am
by PiMinto
I'm still a relative newbie, who finally got round to installing LM12 this weekend - coming from a few months of Fedora 16. WOW, SO impressed with Mint, absolutely loving it!

However I'm a little confused about the default accounts setup. In the installation process I was only asked for a username, and password. In the F16 installation, it specifically asks for a root password, and then user. How do I login as root in Mint?

Re: Root and user accounts

Posted: Mon Jan 16, 2012 5:09 am
by Pilosopong Tasyo
PiMinto wrote:How do I login as root in Mint?
There should be an option to login as "other" in the login screen?
Username = root
Password = the one you used for your main account

That said, the usual method used in performing privileged functions in Ubuntu-based distros is to use sudo in a terminal window. Or, in the case of GUI apps (Mint Update, Synaptic, etc), it will automatically prompt you for your password.

Re: Root and user accounts

Posted: Mon Jan 16, 2012 5:44 am
by xenopeek
You don't need to login as root. Any commands you want to run as root, you prefix with sudo (or gksudo for graphical applications). sudo then asks for your password and grants the application you run temporary root privileges. So, for example:

Code: Select all

sudo apt-get install virtualbox
gksudo gedit /etc/default/grub
First one install virtualbox, second one edits the given file with gedit.

Within a terminal session, sudo remembers for a short time (15 minutes by default, IIRC) your credentials and you do not need to enter your password again on subsequent sudo commands.

To become root in the terminal, run:

Code: Select all

sudo -i

Re: Root and user accounts

Posted: Mon Jan 16, 2012 8:44 am
by PiMinto
Oh ok, I had tried

Code: Select all

su -
without success and got worried that I'd somehow locked myself out of root. Ok so no root for Mint, I can live with that :)
Thanks for replies.

Re: Root and user accounts

Posted: Mon Jan 16, 2012 9:15 am
by xenopeek
PiMinto wrote:Oh ok, I had tried

Code: Select all

su -
without success and got worried that I'd somehow locked myself out of root. Ok so no root for Mint, I can live with that :)
Thanks for replies.
You can do su -, but then as:

Code: Select all

sudo su -
That is exactly what sudo -i does :wink:

Re: Root and user accounts

Posted: Mon Jan 23, 2012 4:36 am
by Pythzor
I recall from having used PCLinuxOS for a while a couple of years ago that during installation, the installer sets up a root acount and a user account. Same password for both acccounts (but you could have a different root password if you wanted). Then for normal usage, you'd always log into your user account. You could even forget about the root account, since su covers root activities.

Being much more of a noob then than I am now, that came in very handy. No matter how much I trashed my computer, the root account remained a prestine-fresh install. I could go to the root account, set up another user account and start over again without having to do a fresh install.

It reminds me (now) about something I read in anouther forum (maybe PCLinuxOS) about how (with motherboard alterations) you can connect more than one monitor-mouse-keyboard set to a single computer and have different folks using all of them simultaneously without any user affecting any other user. I don't know about proprietary OSes, but Linux will support that, so I've heard. One could trash his/her part of the computer without bothering the other users (short of turning the computer into a kamakazi mission).

For some reason (I don't know what), Ubuntu is developed with the root account disabled.

Re: Root and user accounts

Posted: Mon Jan 23, 2012 6:51 am
by AlbertP
Here's a page about the pros and cons of Ubuntu's setup: https://help.ubuntu.com/community/RootSudo

You can run sudo passwd root to create a root password; you'll then be able to select "Other..." and type "root" as username on the login screen. But I'd read the page first to know the consequences of running this. Anyway, you can always use sudo passwd -dl root to revert it.

Re: Root and user accounts

Posted: Mon Jan 23, 2012 9:54 am
by Pythzor
AlbertP wrote:Here's a page about the pros and cons of Ubuntu's setup: https://help.ubuntu.com/community/RootSudo
Thank you for sharing that page with me. Maybe, little-by-little, I might be starting to learn something. The tone and authority with which the writer(s) pontificated, was, for noobie-me, like sitting at the feet of Gamalial:

" . . . On a more esoteric level, sudo provides some features which encourage different work habits, which can positively impact the security of the system. sudo is commonly used to execute only a single command, while su is generally used to open a shell and execute multiple commands. The sudo approach reduces the likelihood of a root shell being left open indefinitely, and encourages the user to minimize their use of root privileges . . .."

Often, at my computer, I marvel over what must have been the impact of then-Bishop Desmond TuTu's Ubuntu theology as the basis of his anti-apartheid work and 1984 Nobel Peace Prize on a then-11-year old, privileged Afrikaner boy (Mark Shuttleworth)?

Cheers

P.S. I'll leave my Mint and Ubuntu as is.