Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am attempting to modify nsswitch.conf from:

hosts: files dns


hosts: dns files

But, it is read-only. I have tried using:

sudo vi /etc/nsswitch.conf

And even with


It is unable to modify the file. How can I go about doing this? Currently my system is unable to

share|improve this question
up vote 2 down vote accepted

Change permissions on the file first:

sudo chmod u+w /etc/nsswitch.conf

That will give write permission to the owner (should be root). Then try editing it as you tried before:

sudo vi /etc/nsswitch.conf
share|improve this answer
Tried this, and it gives me the same result, perhaps the chmod is not working? When I attempt it says: Changing permissions of '/...': Read-only file system. Then, when I attempt to save with vim it says: "nsswitch.conf" E212: Can't open file for writing. – Serodis Dec 27 '11 at 16:04
Read-only file system? Are you running from an Ubuntu Live CD? – Doug Harris Dec 27 '11 at 16:41
I am not, I am actually on a VPS, I am trying a reinstall, I'll check back a little later. – Serodis Dec 27 '11 at 16:50
Well, that's quite odd. I've reinstalled and it is no longer a read-only system. Not sure what happened, but everything seems great. Thank you. – Serodis Dec 27 '11 at 17:03
Btw: I will vote you up when I get the reputation. haha. – Serodis Dec 27 '11 at 17:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.