LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-16-2009, 02:47 AM   #1
ahmed_as8
Member
 
Registered: Nov 2008
Location: Egypt
Distribution: Ubuntu, SuSE
Posts: 101

Rep: Reputation: 16
root permissions on Ubuntu


Hi all .. I am using Ubuntu 8.10 & the User I am using its maing group is root & suppose to have full root permissions .. although I cant take full permissions I want to edit the grub files menu.lst but I cant because I don't have full permission .. so what do u suggest .. is their is a way to login as root or how can I make this account having full permissions? Thanks.
 
Old 02-16-2009, 03:01 AM   #2
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Ubuntu configures sudo with full rights for the user that is created during setup (users added later must be configured manually; this is because otherwise they could do anything they wanted). To do something with root privileges, use
Code:
sudo command
or
Code:
gksudo command
The difference between these is that 'sudo' asks for your password in the command line, whereas 'gksudo' pops up a graphical box asking for it. So if you wanted to edit the menu.lst file, you could do something like this:

- open a terminal and run
Code:
sudo gedit /boot/grub/menu.lst
- hit ALT+F2 to bring up the Run dialog and run
Code:
gksudo gedit /boot/grub/menu.lst
When asked, type in your password and you'll get the file opened (gk/sudo makes you run the command with root privileges). If you use 'sudo' or 'gksudo' many times in a short time, you'll probably be asked for the password only once (it remembers it for a moment).

If you insist on having a root account, you can do that as well -- simply set a known password for root (type this in terminal):
Code:
sudo passwd root
Though I don't recommend doing that, as sudo is already configured and it's basically all you need -- if you needed to be logged in as root, you could do that with sudo as well, for example
Code:
sudo su - root
 
Old 02-16-2009, 04:23 AM   #3
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

Rep: Reputation: Disabled
Though the user you login IS in root group but by default the permissions for menu.lst or for that matter the entire grub directory is only writable to root.

Code:
-rw-r--r-- 1 root root    197 2008-12-22 11:55 default
-rw-r--r-- 1 root root     30 2008-12-22 11:55 device.map
-rw-r--r-- 1 root root   8056 2008-12-22 11:55 e2fs_stage1_5
-rw-r--r-- 1 root root   7904 2008-12-22 11:55 fat_stage1_5
-rw-r--r-- 1 root root     16 2008-12-22 11:55 installed-version
-rw-r--r-- 1 root root   8608 2008-12-22 11:55 jfs_stage1_5
-rw------- 1 root root   4864 2009-02-07 12:42 menu.lst
-rw-r--r-- 1 root root   4864 2009-02-07 12:42 menu.lst~
-rw-r--r-- 1 root root   4718 2009-02-03 12:04 menu.lst.090203120403
-rw-r--r-- 1 root root   4703 2008-12-24 18:39 menu.lst.backup
-rw-r--r-- 1 root root   7324 2008-12-22 11:55 minix_stage1_5
-rw-r--r-- 1 root root   9632 2008-12-22 11:55 reiserfs_stage1_5
drwxr-xr-x 2 root root   4096 2009-02-03 12:04 splashimages
-rw-r--r-- 1 root root    512 2008-12-22 11:55 stage1
-rw-r--r-- 1 root root 108356 2008-12-22 11:55 stage2
-rw-r--r-- 1 root root   9276 2008-12-22 11:55 xfs_stage1_5
As adviced before you need to edit the menu.lst file with sudo.
 
Old 02-16-2009, 04:31 AM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,501

Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
And don't forget to backup the file before editing.
 
Old 02-16-2009, 06:18 AM   #5
ahmed_as8
Member
 
Registered: Nov 2008
Location: Egypt
Distribution: Ubuntu, SuSE
Posts: 101

Original Poster
Rep: Reputation: 16
Thanks alot it works .. another Question please, If I want to reorder the lines of the operating systems their i.e I wanna grab the Line of Ubuntu above the Line of Windows so it goes automatically to Ubuntu not Windows
 
Old 02-16-2009, 06:22 AM   #6
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

Rep: Reputation: Disabled
No need to reorder the lines for that. Change the default option in menu.lst to point it to Ubuntu.
If you have two options one is windows and another is Ubuntu and Windows lines are written above Ubuntu then change the default option from 0 to 1. It will make grub to boot Ubuntu by default and not windows.
 
Old 02-16-2009, 09:31 AM   #7
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
There are actually (at least) two ways of making a certain boot entry the default in Grub configuration, and there may be a difference between the methods.

One way is to use the
Code:
default n
where n is the list index number, starting from zero (first list item). With this method the easiest way, taking into account that when you upgrade your kernel, the system adds new entries into the list (the "magical section"), is to put the to-be-default OS entry to the very top of the list, then set
Code:
default 0
or leave the default completely undefined; this means the topmost entry is the default.

Another way is to define
Code:
default saved
in which case the default entry will be the one that was last "saved". This works so that you add
Code:
savedefault
to the boot entry/entries that you want to "save" as defaults; then when you let Grub to boot the "default" entry, it boots the entry that has "savedefault" set, and if there are multiple, the one that was booted last. This means that you could put the "savedefault" into the Windows entry only and have it anywhere in the menu.lst file (no need to be the first on the list) -- now Grub would boot it as the default entry.

What's good in here is that you don't need to have the default entry at the top of the list (obviously there are other uses as well). Might or might not be useful to you, but at least it's possible..

Last edited by b0uncer; 02-16-2009 at 09:33 AM.
 
Old 02-16-2009, 03:10 PM   #8
ahmed_as8
Member
 
Registered: Nov 2008
Location: Egypt
Distribution: Ubuntu, SuSE
Posts: 101

Original Poster
Rep: Reputation: 16
Gr8 .. Works :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu Feisty Automounts USB Hard Drives with Permissions for Root Only cdrom600 Ubuntu 4 05-14-2007 08:37 PM
Creating a shortcut with root permissions in Gnome/Ubuntu rhawkes Linux - Software 2 04-22-2007 04:04 AM
root-like permissions ? bbbb Linux - Newbie 7 11-12-2005 06:03 AM
root permissions wass29 Slackware 3 05-10-2004 10:58 AM
root permissions explorer Linux - Newbie 3 03-06-2003 04:17 PM


All times are GMT -5. The time now is 10:58 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration