LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 08-19-2004, 05:15 PM   #1
osat3ch
Member
 
Registered: Jan 2004
Location: Portsmouth, NH
Distribution: FC3, FC4
Posts: 45

Rep: Reputation: 15
Question how to edit a file without logging in as root?


How do I edit a protected file without logging in as root?
 
Old 08-19-2004, 05:27 PM   #2
dubya
Member
 
Registered: Mar 2004
Location: Kitchener, Ontario, Canada
Posts: 386

Rep: Reputation: 30
From my knowledge, you can't. That's why you need to; any joker could come along and mess up something important.

But if you're talking about logging in graphically, there's a shortcut:

Open a terminal.
Type su.
Type the root password.
Then type gedit (or text editting app) /path/to/file/to/edit/

Sorry if you already know this, but it's the best way I know. Hope it helps, any more questions, ask.
 
Old 08-19-2004, 05:37 PM   #3
osat3ch
Member
 
Registered: Jan 2004
Location: Portsmouth, NH
Distribution: FC3, FC4
Posts: 45

Original Poster
Rep: Reputation: 15
ty

someone told me how to do that once and i forgot

your solution is the one i was looking for

thank you
 
Old 08-21-2004, 11:16 PM   #4
Kristijan
Member
 
Registered: Sep 2003
Location: Melbourne, Australia
Distribution: NetBSD 3.0.1, Slackware 10.1
Posts: 394

Rep: Reputation: 30
Another option is using -c with su, man su. -c passes a single command to the shell as "that" user.

So you can;
Code:
su -c "pico /etc/fstab"
Which will run pico as root, just for that one command. Very usefull for doing those one off root things

Kristijan
 
  


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
Edit /ect/profile with root? Tony33221 Linux - Security 11 09-04-2005 06:02 PM
Elementary Question - Can't Edit File - Need Root rrrssssss Linux - Newbie 2 04-12-2005 03:05 AM
Can't edit /etc/X11/XF86Config file in ANY editor under root! please help Fear58 Mandriva 6 12-12-2004 01:19 AM
cannot edit file as root with write permissions set? Mishley Red Hat 4 08-05-2004 12:23 PM
using red-carpet without logging out and logging as root. packman Linux - Software 1 12-09-2002 02:55 AM


All times are GMT -5. The time now is 05:01 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