LinuxQuestions.org
Help answer threads with 0 replies.
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 09-13-2007, 06:19 PM   #1
sixsidepentagon
Member
 
Registered: Sep 2007
Posts: 41

Rep: Reputation: 15
How to Edit System Files?


To fix my wi-fi, I think I need to edit some files that are in linux. I'm using Ubuntu Fiesty Fawn with the Gnome desktop. Whenever I try to save my modifications, it tells me that I do not have the priveleges to change it. Do I have to get adminstrative rights or something?

Thanks in advance,

sixside
 
Old 09-13-2007, 06:48 PM   #2
oskar
Senior Member
 
Registered: Feb 2006
Location: Austria
Distribution: Ubuntu 12.10
Posts: 1,142

Rep: Reputation: 49
Quote:
Originally Posted by sixsidepentagon View Post
Do I have to get adminstrative rights or something?
Yup

In most distributions 'sudo' is already set up. This is quite handy for performing a single action as root. just use 'sudo [your text editor] [file]'

there are graphical versions, if you're starting something from the run dialog (alt-f2): 'gksu' for Gnome, and 'kdesu' for KDE.

Last edited by oskar; 09-13-2007 at 06:49 PM.
 
Old 09-13-2007, 06:55 PM   #3
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Rep: Reputation: 168Reputation: 168
Yes you need to be root, or su to edit system files. You can do that from a terminal, invoke su
Code:
su
password
Once you've done that just issue the editor and path/to/the/file
Code:
pico /etc/host
That's just an example.
Good luck. ;-)
 
Old 09-13-2007, 07:14 PM   #4
sixsidepentagon
Member
 
Registered: Sep 2007
Posts: 41

Original Poster
Rep: Reputation: 15
Yeehaw! Thanks for the help guys, that worked perfectly!
 
Old 09-13-2007, 11:41 PM   #5
oskar
Senior Member
 
Registered: Feb 2006
Location: Austria
Distribution: Ubuntu 12.10
Posts: 1,142

Rep: Reputation: 49
Yes, but if you change to root permanently (su) - be shure to change back with
Code:
# su [user name]
if you don't need it, because if you keep working as root, every file you edit will not be writable by you as a user + there are hundreds of ways to do irreversible damage just with typos like
Code:
# rm -r / usr/share/crap/
- as user you would just get 'permission denied'.
Thats why I almost never actually change to root.

Last edited by oskar; 09-13-2007 at 11:42 PM.
 
Old 09-14-2007, 01:08 AM   #6
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by oskar View Post
Yes, but if you change to root permanently (su) - be shure to change back with
Code:
# su [user name]
"exit" also works.
 
Old 09-14-2007, 02:17 AM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
In fact 'exit' works better because it doesn't actually change your orig login, it moves you 'up' (loosely speaking) a chain of logins, so if you su repeatedly, you can end up effecively logged in
myuser>root>otheruser
etc. Each time you 'exit' you'll move back 'down' the chain. It's the 'exit' that causes the 'su-ed to' session to shutdown.
 
  


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
How come I can't edit files? SentralOrigin Linux - Hardware 12 11-07-2006 09:56 AM
vi to edit files?? Andknig Linux - Newbie 2 04-22-2005 05:18 AM
how do i edit files???? zexter Mandriva 9 11-06-2004 11:02 AM
Edit files help flira Linux - Newbie 2 05-27-2004 10:31 PM
Cannot edit system files in Mandrake Linux... Tommi Linux - Newbie 7 08-14-2003 02:53 PM


All times are GMT -5. The time now is 04:38 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration