problems editing /etc/fstab

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

problems editing /etc/fstab

Postby miki65 on Wed Nov 14, 2012 10:25 am

I am trying to edit /etc/fstab and keep being told that I "do not have permission" to save a replacement. I've used the chmod command to enable write access to the file, but gedit still refuses to save it. When I use terminal with the su and gedit commands, I get told that gedit cannot open because of some system nonsense. Please help.
miki65
Level 1
Level 1
 
Posts: 7
Joined: Wed Nov 14, 2012 8:15 am

Linux Mint is funded by ads and donations.
 

Re: problems editing /etc/fstab

Postby altair4 on Wed Nov 14, 2012 12:05 pm

To edit /etc/fstab you need to have elevated privileges:
Code: Select all
gksu gedit /etc/fstab

If you get some kind of error when you do that it's probably because you've been doing things like this:
I am trying to edit /etc/fstab and keep being told that I "do not have permission" to save a replacement. I've used the chmod command to enable write access to the file

My advice is to not mess around with permissions of system files.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 13
Level 13
 
Posts: 4651
Joined: Tue Feb 03, 2009 10:27 am

Re: problems editing /etc/fstab

Postby miki65 on Wed Nov 14, 2012 2:46 pm

Thanks. :) Since I did

chmod +w /etc/fstab


should I now do

chmod -w /etc/fstab


in order to set things back to normal? Or do I need to do something else?
miki65
Level 1
Level 1
 
Posts: 7
Joined: Wed Nov 14, 2012 8:15 am

Re: problems editing /etc/fstab

Postby karlchen on Wed Nov 14, 2012 6:32 pm

Hello, miki65.

Running the command
Code: Select all
chmod +w /etc/fstab
under a normal user account will merely yield an error message (see proof below). Therefore more likely than not you have not changed any file permissions, hence there is no need to revert the failed action.

Proof:
Code: Select all
ls -l /etc/fstab; chmod +w /etc/fstab; ls -l /etc/fstab
-rw-r--r-- 1 root root 681 Aug 31 23:36 /etc/fstab
chmod: changing permissions of `/etc/fstab': Operation not permitted
-rw-r--r-- 1 root root 681 Aug 31 23:36 /etc/fstab


As much as you cannot simply
Code: Select all
gedit /etc/fstab
from a normal user account and save any changes back to disk, you cannot change the file permissions of /etc/fstab from a normale user account.

Kind regards,
Karl
Enlightened by Lucid Lynx, enchanted by Maya Mint, productive on Precise Pangolin's Minty sister
User avatar
karlchen
Level 5
Level 5
 
Posts: 851
Joined: Sat Dec 31, 2011 7:21 am


Return to Newbie Questions

Who is online

Users browsing this forum: tommyb., trapperjohn and 36 guests