Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Computing Products:
macOS - Operating System
Tip: Unlocking Hosts file in Lion
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Shikarnov" data-source="post: 1364391" data-attributes="member: 49413"><p>Hi All,</p><p></p><p>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. </p><p></p><p>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."</p><p></p><p>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...</p><p></p><p>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.</p><p></p><ol> <li data-xf-list-type="ol">In Finder, navigate to /private/etc/</li> <li data-xf-list-type="ol">Locate the hosts file</li> <li data-xf-list-type="ol">Right-click on it and select Get Info</li> <li data-xf-list-type="ol">Unclock the Get Info pane and authenticate</li> <li data-xf-list-type="ol">Add yourself as a user (note - after adding, your username still won't appear in the list)</li> <li data-xf-list-type="ol">Close the Get Info box</li> <li data-xf-list-type="ol">Open Terminal</li> <li data-xf-list-type="ol">sudo nano /etc/hosts</li> <li data-xf-list-type="ol">CTRL + O to save</li> <li data-xf-list-type="ol">Go back to Finder, right-click on the hosts file and Get Info again.</li> <li data-xf-list-type="ol">Your username will be there. Set its permissions to Read and Write.</li> </ol><p></p><p>Cheers,</p><p></p><p>Z</p></blockquote><p></p>
[QUOTE="Shikarnov, post: 1364391, member: 49413"] 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. [LIST=1] [*]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. [/LIST] Cheers, Z [/QUOTE]
Verification
Post reply
Forums
Apple Computing Products:
macOS - Operating System
Tip: Unlocking Hosts file in Lion
Top