- Joined
- Feb 26, 2008
- Messages
- 542
- Reaction score
- 25
- Points
- 28
Hi All,
As my job involves developing websites, I spend a LOT of time in my hosts file adding domain names that point to my local server, and etc.
Well, after upgrading to Lion, I found that my hosts file (which I keep as an alias on my dock) opened in TextEdit instead of TextMate, like I had it set to open with in Snow Leopard. "No matter," I thought, "I'll just edit in TextEdit and go on with my day."
So I edited, but it wouldn't save. Of course, Lion locked the hosts file, which I suppose shouldn't have been unexpected. What was unexpected was that the Get Info pane wouldn't let me make changes, even after authenticating. My username wasn't there, and I couldn't add it either. I thought I was screwed...
Anyway, long story short, I found a procedure that let me reclaim control over my hosts file by pushing through what I think is a bug, and the terminal.
Cheers,
Z
As my job involves developing websites, I spend a LOT of time in my hosts file adding domain names that point to my local server, and etc.
Well, after upgrading to Lion, I found that my hosts file (which I keep as an alias on my dock) opened in TextEdit instead of TextMate, like I had it set to open with in Snow Leopard. "No matter," I thought, "I'll just edit in TextEdit and go on with my day."
So I edited, but it wouldn't save. Of course, Lion locked the hosts file, which I suppose shouldn't have been unexpected. What was unexpected was that the Get Info pane wouldn't let me make changes, even after authenticating. My username wasn't there, and I couldn't add it either. I thought I was screwed...
Anyway, long story short, I found a procedure that let me reclaim control over my hosts file by pushing through what I think is a bug, and the terminal.
- In Finder, navigate to /private/etc/
- Locate the hosts file
- Right-click on it and select Get Info
- Unclock the Get Info pane and authenticate
- Add yourself as a user (note - after adding, your username still won't appear in the list)
- Close the Get Info box
- Open Terminal
- sudo nano /etc/hosts
- CTRL + O to save
- Go back to Finder, right-click on the hosts file and Get Info again.
- Your username will be there. Set its permissions to Read and Write.
Cheers,
Z