Editing hosts file on Mac without admin rights

hosts-filemac-osxvirtualhost

I currently work in a place where every developer programs on the same server and I don't believe it is a very good usage since I have to work on a network share, so it's a bit slow.

I setup a copy of BitNami MAMPstack and everything is working pretty good on port 8080 (I don't have any admin rights on my workstation).

The only problem is: I don't always work on the same project so I have to work on multiple local network vhosts. I'd like to make local vhosts that would point on my local machine. (Usually done simply by editing the hosts file). But since I don't have any admin rights, I can't edit /etc/hosts…

I use Firefox for development and I saw an add-on that was supposed to do so, but still at the end it edits the hosts file and needs admin rights…

Any ideas? Anyone knows how to do so?

Thanks a lot!

Best Answer

You really want to talk to your support personnel so that you get the rights you need AND don't fall afoul of your workplace's service agreements. That said, this is a question worth answering for folks who get locked out.

If you boot the system in single-user mode (hold down COMMAND-S while booting), you will get access to the file system to modify the hosts file (you will need to invoke a CLI editor like nano from its full path). Remember that OS X doesn't always use the same info as other Unix services, but I think MAMP should do so. It is possible that your admins have disabled single-user mode, but most likely not.