{ 7 comments… read them below or add one }

1 C Baltimore September 25, 2009 at 4:32 am

I think you blew this one. Though the analysis of why they couldn’t “su -” directly was right on, the answer is to run “sudo su -” to gain root.

2 Chuck Gregory September 25, 2009 at 4:43 am

Normally you only need root access once in awhile. To execute a single command with root privileges, just use sudo in front of the command, such as:
sudo gedit somefileyounormallycouldnotaccess

If you will be doing several commands in a row that need root access, use:
sudo su

In either case, you will be asked to enter your password before proceeding. That’s all you need. No need to change root password, just use your own.

3 LaMi September 25, 2009 at 6:32 am

> To execute a single command with root privileges,
> just use sudo in front of the command, such as:
> sudo gedit somefileyounormallycouldnotaccess

And if you need to execute multiple commands simply execute “sudo -s” and enter you own user password. Then you get a root prompt. Nearly the same as using su.

4 counterdutch September 25, 2009 at 9:43 am

it’s saver not to enable root account.
When you need it do :
sudo su -

5 Ronald September 26, 2009 at 6:23 am

Any thoughts about ’sudo bash’ ? I use that quite often actually..

6 Ramesh Natarajan October 5, 2009 at 10:18 pm

@C Baltimore,

Ofcourse. We have to use sudo to execute any root commands in Ubuntu. I did mention this in the article under “Warning” section. I’ve moved the warning section to the top of the article, to make it visible.

The purpose of this article is only as a FYI for those who come from other Linux distro (for e.g. Red Hat), where they typically do ’su – ‘ to gain root. If they still want to continue doing ’su – ‘ on Ubuntu without doing ’sudo su -’, they can use the method mentioned here. (which is still not recommended as I’ve mentioned in the warning section).

7 Pradeep December 11, 2009 at 7:35 pm

Thanks Ramesh, I was stuck in the same issue and it helped me.

Leave a Comment

Previous post:

Next post: