1

I am attempting to modify nsswitch.conf from:

hosts: files dns

to

hosts: dns files

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

sudo vi /etc/nsswitch.conf

And even with

:w!

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

1 Answer 1

2

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
5
  • 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, 2011 at 16:04
  • Read-only file system? Are you running from an Ubuntu Live CD? Dec 27, 2011 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, 2011 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, 2011 at 17:03
  • Btw: I will vote you up when I get the reputation. haha.
    – Serodis
    Dec 27, 2011 at 17:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .