LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 08-17-2010, 04:30 PM   #1
turf
Member
 
Registered: Nov 2009
Posts: 94

Rep: Reputation: 15
how to be a root in ubuntu?


how to be a root in ubuntu?

i wanted to edit a text file in a folder and i can't since i'm not the root so i need to know how to be a root. but how?
 
Old 08-17-2010, 04:33 PM   #2
snowpine
Senior Member
 
Registered: Feb 2009
Posts: 3,915

Rep: Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047
Use the "sudo" command:

Code:
sudo nano /name/of/file
When prompted for a password, enter your regular user password.

If you prefer a GUI text editor, use "gksu" (or "kdesu" if you're using Kubuntu)

Code:
gksu gedit /name/of/file
Lots more details here: https://wiki.ubuntu.com/RootSudo

Well worth reading this page, as Ubuntu's security model is a little different than many other distributions.
 
Old 08-17-2010, 04:35 PM   #3
turf
Member
 
Registered: Nov 2009
Posts: 94

Original Poster
Rep: Reputation: 15
so i don't need to login as a root?

thanks
 
Old 08-17-2010, 04:37 PM   #4
snowpine
Senior Member
 
Registered: Feb 2009
Posts: 3,915

Rep: Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047
Quote:
Originally Posted by turf View Post
so i don't need to login as a root?

thanks
You can if you want, but I can't think of a single instance it is necessary. ps You're welcome!
 
Old 08-17-2010, 04:45 PM   #5
turf
Member
 
Registered: Nov 2009
Posts: 94

Original Poster
Rep: Reputation: 15
how bout this..
Quote:
turf@turf-ubuntu:/$ cd root/
bash: cd: root/: Permission denied
how can i get into the /root?
 
Old 08-17-2010, 04:46 PM   #6
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 5.4, Mac OS 10.4 (tiger)
Posts: 1,005

Rep: Reputation: 79
Single user mode or any maintenance mode similar to that, and generally doing maintenance... you can do "sudo passwd root" to set the root password, in Ubuntu the root password is made of an unusable password by default what means root can not be logged in as. The only real advantage of sudo in my opinion is that it's usually a time limited idle before it dis-activates and thus needs the password. it's harder for people to break in while you have left the computer... but why would you be leaving the computer unlocked anyway if you were leaving it where other people could get to it? else wise putting sudo infront of something can become so common a lot of people would do the same mistakes with or without sudo anyway... as generally logging in as root as a main user is just ill-advised anyways... and why I prefer "su -".

Last edited by r3sistance; 08-17-2010 at 04:49 PM.
 
Old 08-17-2010, 04:51 PM   #7
blue_print
Member
 
Registered: May 2010
Location: In world
Distribution: RHEL, CentOS, Ubuntu
Posts: 275
Blog Entries: 3

Rep: Reputation: 49
Turf, If you want to enter into /root directory, you will need to login as root user. Try to change the user to root suing sudo command.

sudo su

Then enter the password of the user turf.
 
Old 08-17-2010, 04:52 PM   #8
snowpine
Senior Member
 
Registered: Feb 2009
Posts: 3,915

Rep: Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047
Quote:
Originally Posted by turf View Post
how bout this..

cd root/

how can i get into the /root?
Unless you have a folder called "root" in your turf-ubuntu folder, try:

Code:
cd /root
It is not a permissions problem as a couple of other posters above seem to think (the 'cd' command does not require root privileges!) but rather bad command line syntax (the / character is in the wrong place).

Please take a minute to read through the document I linked to in post #2, it should answer many of your questions. You might also want to brush up on some command line basics before you go issuing commands with sudo, here is a good tutorial: http://www.tuxfiles.org/linuxhelp/cli.html

Last edited by snowpine; 08-17-2010 at 04:59 PM.
 
Old 08-17-2010, 04:53 PM   #9
dixiedancer
Member
 
Registered: Feb 2010
Location: Florida, Occupied CSA
Distribution: Xubuntu
Posts: 98
Blog Entries: 3

Rep: Reputation: 37
This is "cheating" I guess, because it's just too easy! But I installed an awesome, ultralight file manager using Synaptic, called PCManFM (one of the jewels of the LXDE project). I use that to navigate to the folder that has the stuff I want to change, and then click on Tools > Open Current Folder as Root. Enter your computer's root password when prompted. Bingo! A new window opens up with a little caption that says, "Warning! You are now in Super User Mode!"

Click on whatever file you want to edit, modify, delete, move, whatever. When you close that Super User window, you're back to "ordinary user" but all your changes are saved. Sweet, huh?

Simple enough for even a silly little dixiedancer to do, lol.

-Robin
 
Old 08-17-2010, 05:15 PM   #10
turf
Member
 
Registered: Nov 2009
Posts: 94

Original Poster
Rep: Reputation: 15
finally got in by providing a root password this time. i'd like it that way where users need to give the root password.

but after getting into the grub,i seem can't see my menu.lst.
where the hell are they hiding these things, it seems complicated unlike most distros.where its easy to spot the lilo.conf or the menu.lst
 
Old 08-17-2010, 05:23 PM   #11
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 5.4, Mac OS 10.4 (tiger)
Posts: 1,005

Rep: Reputation: 79
menu.lst is from grub 1, grub 2 uses grub.cfg and I know Ubuntu (since 9.10) uses grub 2, however I am not certain of the changes you should be making with the grub 2 boot loader so if you could say what you are trying to do, perhaps other users could help you out with that?
 
Old 08-17-2010, 05:28 PM   #12
snowpine
Senior Member
 
Registered: Feb 2009
Posts: 3,915

Rep: Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047
Quote:
Originally Posted by turf View Post
finally got in by providing a root password this time. i'd like it that way where users need to give the root password.

but after getting into the grub,i seem can't see my menu.lst.
where the hell are they hiding these things, it seems complicated unlike most distros.where its easy to spot the lilo.conf or the menu.lst
Turf, you seem very confused. Please read the Ubuntu documentation I linked to in post #2, it will explain why you don't need to enable a root password. You can of course do so if you choose (it's your computer) but it means you won't be able to follow the official Ubuntu documentation or use their support forums, both of which assume the use of 'sudo'.

Speaking of the Ubuntu documentation, it is excellent, and they have an entire chapter on GRUB (hint: there is no "menu.lst"): https://wiki.ubuntu.com/Grub2

I know it is tricky when a lot of different people on the internet are shouting conflicting advice at you. When in doubt, I encourage you to look for answers from sites with ubuntu.com in the URL. This will ensure you are getting accurate and up-to-date information. I hope I'm not coming off as a know-it-all... I certainly don't know all the answers! I just know where to look.
 
Old 08-17-2010, 09:23 PM   #13
turf
Member
 
Registered: Nov 2009
Posts: 94

Original Poster
Rep: Reputation: 15
the link really help thanks a lot.

i got my 2nd OS working after creating a bashscript for the OS entry in etc/grub.d/
then i run update-grub

seems working now. thanks
 
Old 08-17-2010, 10:55 PM   #14
sag47
Senior Member
 
Registered: Sep 2009
Location: Philly, PA
Distribution: Kubuntu x64, RHEL, Fedora Core, FreeBSD, Windows x64
Posts: 1,431
Blog Entries: 33

Rep: Reputation: 358Reputation: 358Reputation: 358Reputation: 358
If the sudo command annoys you you could emulate the root login in one of two ways... I can't remember the second but I use the following all the time because 1) I like and use bash to it's easy to remember and 2) when I switch to root user with this method it uses my users .bash_aliases and .vimrc file so I have all of my aliases and settings I want.

Code:
sudo bash
 
Old 08-18-2010, 12:02 AM   #15
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 54
Quote:
Originally Posted by sag47 View Post
Code:
sudo bash
Or even better:

Code:
sudo passwd
Then just enter your new root password and you'll be able to log in as root as much as you want...
 
  


Reply

Tags
pcmanfm, root


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
did not find any option for root password for root user in ubuntu 9.10 linux.ab Linux - Newbie 1 03-02-2010 02:58 AM
Ubuntu? no root? matesol Ubuntu 11 05-31-2007 05:36 AM
ubuntu, I can no longer become root or have root rights TroelsSmit Linux - Newbie 7 03-24-2007 07:17 PM


All times are GMT -5. The time now is 05:33 PM.

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