# Ubuntu: Can't log into root



## norin (Dec 28, 2004)

last nite i installed Ubuntu and i setup a main user, but for some reason i don't think it asked for a root setup. anytime i need to update a package or something it asks me for the root password so i type one in and it works, but in bash/login screen when i try to use that password with the root login name it won't let me. i'm trying to gain access to the /boot/grub folder to clean up my grub boot list. but i need root privs to save the changes. i tried making a new user/group with root privs and/or admin privs but no luck. btw this is just my own personal computer. but i am finickey liek that and need that list cleaned up 

any help would be appreciated thnx guys.

-NoRiN


----------



## hal8000 (Dec 23, 2006)

Ubuntu doesnt use a root password it uses "sudo" priveledges. Look closely at the message it says enter "your" password, which is your normal user password.
If you want to set a password for thr root account at a terminal type
sudo passwd
then enter and confirm a new root password.


----------



## shuuhen (Sep 4, 2004)

It's not recommended to log in as root from the login screen (security risk). What you can do instead is use 'sudo _command_' (without quotes) from your account when you only have one or two commands to run. If you need to do a lot more as root, you can use 'sudo su -' (again without quotes). If you set a root password, you can just use the command su, but the sudo su should work fine (and it leaves the root account disabled, which can be a good thing).


----------



## norin (Dec 28, 2004)

ok that helps. thanks  but now how can i edit the menu.lst in the /boot/grub/ directory? i want to remove the old Linux Kernel entries.

i tried typing:


```
cd /boot/grub/
gedit menu.lst
```
but it wouldn't work. ne ideas? are there any parameters or attributes i need to use? like -v or something, i don't think that would work tho cuz that's verbose.

thanks again in advance


----------



## PureEvilDan (May 26, 2005)

It should be _sudo gedit menu.lst_ or just _sudo su -_ and gedit menu.lst


----------



## shuuhen (Sep 4, 2004)

Either

```
sudo su -
cd /boot/grub/
gedit menu.lst
```
or 


```
sudo cd /boot/grub/
sudo gedit menu.lst
```
should work (although I haven't really used gedit - fan of vi/vim personally). For both you should be able to use your password. Do you get messages from any of the commands?

If you get error messages at any point, feel free to post them. Also mention which method gives you the problem. You shouldn't need any extra parameters.


----------



## K-B (Oct 24, 2005)

Just do:

```
sudo gedit [[I]pathname[/I]]
```
For example:

```
sudo gedit /boot/grub/menu.lst
```
Check this out if you're still having trouble:
http://www.techsupportforum.com/f21...lt-boot-operating-system-in-linux-134958.html


----------



## norin (Dec 28, 2004)

ok well i tried:


```
sudo su -
cd /boot/grub/
gedit menu.lst
```
and this is the error i got:


```
[email protected]:~$ sudo su -
[email protected]:~# cd /boot/grub/
[email protected]:/boot/grub# gedit menu.lst
cannot open display: 
Run 'gedit --help' to see a full list of available command line options.
[email protected]:/boot/grub#
```
i got the same error message while using


```
sudo cd /boot/grub/
sudo gedit menu.lst
```
and again same error while using the command 

```
sudo gedit /boot/grub/menu.lst
```
/angry gedit. is there any other alternative for Ubuntu other than gedit? what about that vi/vim u were talking about? do i "sudo apt-get vi/vim" for that? i'm posting this now and then im going to take a look at that tutorial.

EDIT: after trying what u mentioned in the tutorial i get this new error:

```
(gksudo:6358): Gtk-WARNING **: cannot open display:
```
thanks again for all your help  still trying to figure this out. i remember it was easy when i was using FC4


----------



## hal8000 (Dec 23, 2006)

Try gksu command:

gksu gedit /boot/grub/menu.lst

Thats should hopefully allow root privelidges to the display.

If gksu is not installed,

sudo apt-get install gksu


----------



## norin (Dec 28, 2004)

well when i used the install feature it said gksu was already at the newest version. weird. and i used that b4 the last post i made and it didn't work, but now when i tried it worked. and i could edit the menu.lst. altho i did get this error to let u guys know about:


```
(gedit:6731): GnomeUI-WARNING **: While connecting to session manager:
Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed.
```
so on that note you can go ahead and mark this as [RESOLVED] thnx


----------



## Grao (Aug 31, 2006)

shuuhen said:


> It's not recommended to log in as root from the login screen (security risk).


Why is that such a big deal? Especially if your running a headless server or something. Anybody who walks by your computer while you are in the bathroom for example, probably wont know how to screw up your linux distro anyway, you would be just as screwed as if you left your windows computer on the admin account. And as far as remote security issues are concerned, well it takes a pretty stupid person to put a hole in their security enough to do that...


----------



## shuuhen (Sep 4, 2004)

Grao said:


> Why is that such a big deal? Especially if your running a headless server or something. Anybody who walks by your computer while you are in the bathroom for example, probably wont know how to screw up your linux distro anyway, you would be just as screwed as if you left your windows computer on the admin account. And as far as remote security issues are concerned, well it takes a pretty stupid person to put a hole in their security enough to do that...


Besides the people walking by the computer (which may or may not matter), you have all of your processes running as root. If there are any weaknesses in programs you're running that launch malicious code, it will run as root and therefore be able to do whatever it wants to your machine. Minimum privileges is one of first things to have on your security policy. Not everything is secure by default and many programs will have problems like buffer overflows.

It's also quite easy to type in a bad command or two; Experts can even have this happen.


----------

