login as root user to change a file permission

Asked by Patrick Schneider on 2010-04-11

I've installed Ubuntu 9.10 and wanted to apply some recommended security fixes (see www.itsecurity.com/features/ubuntu-secure-install-resource/.) One fix is to open a text editor and add this line to the '/etc/fstab' file...

tmpfs /dev/shm tmpfs defaults,ro 0 0

But this file is owned by the Root user and is set to read-only for my login id and so it can neither be modified and saved nor can I do a 'save as' because I get a permissions violation. I opened a 'Terminal' window and tried doing a 'SUDO SU-' and entering my user password when requested but it seemed to have no effect on my work in the text editor. How do I affect these recommended security changes?

Question information

English Edit question
Ubuntu yelp Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:

gksudo gedit /etc/fstab

Ian Ace (iaculallad) said : #2

Their is no need for you to login as root in order to edit the /etc/fstab file. As johnnynyquist had posted above, you can just pre-append the command 'gksudo' to an editor (be it vi (sudo) or gedit (gksudo)) in order for you to edit and save any changes to the file.

Neil (goofandfroggie) said : #3

Hi this will let you will in root, type this into terminal

gksu nautilus

regards Neil

Thanks johnnynyquist, that solved my question.