Thread: Mountain Lion Hosts File
04-01-2013, 09:50 AM #1Mountain Lion Hosts File
First, please know I'm well aware of how to edit the Hosts file using Terminal... But what I really want to do is edit it using Smultron 4 (which I'd done in the past with Lion and Snow Leopard). That said, I just can't seem to defeat Apple's security in Mountain Lion... Now, setting aside the security implications -- and I know some of you have strong feelings about users being "rightly" disallowed dominion over their own computers -- do any of you have advice on how I can accomplish my desired goal of editing my Hosts file using any text-editing application I want?
Things I've tried already:
- Changing permissions on the Hosts file using the Get Info window to give myself read/write privileges
- Taking ownership of the file
- AppleScript (do shell script "open /Applications/Smultron\\ 4.app/ /etc/hosts" with administrator privileges)
- Changing permissions for the entire ETC folder (which works - but is somewhat less than ideal given that it leaves everything else exposed that doesn't need to be)
Thanks in advance!
04-01-2013, 11:18 AM #2
First off, don't take any route that involves changing permissions. There's a difference between having control over the filesystem and deferring to the Unix system of permission management.
Try the following:Code:
sudo /Applications/Smultron\ 4.app/Contents/MacOS/Smultron /etc/hosts
04-01-2013, 11:39 AM #3
That did the trick. Thank you!
For anybody else that edits the host file frequently, Using Vansmith's detail, I created an AppleScript with the following code, so I can keep an icon on my dock next to MAMP.
do shell script "sudo /Applications/Smultron\\ 4.app/Contents/MacOS/Smultron\\ 4 /etc/hosts" password "mypassword" with administrator privileges
04-01-2013, 12:04 PM #4
No problem, glad I could help.
One piece of advice (for anyone out there) - make a backup of a working hosts file before you do this, especially if the hosts file is new to you.
04-01-2013, 01:27 PM #5
- Member Since
- Feb 14, 2004
- Groves, Texas
- 21in. iMac 10.11 --- HP Linux Mint 18
I just use Gasmask. Lot easier.
Download Gas Mask for Mac - Hosts file manager, edit hosts files and switch between them. MacUpdate.comAny priest or shaman must be presumed guilty until proved innocent.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By DrDandroid in forum OS X - Operating SystemReplies: 0Last Post: 09-16-2013, 01:40 AM
By AJAYK in forum OS X - Operating SystemReplies: 4Last Post: 04-25-2013, 07:03 AM
By kjeand in forum OS X - Operating SystemReplies: 0Last Post: 10-02-2012, 04:56 AM
By shellback3 in forum OS X - Operating SystemReplies: 6Last Post: 09-16-2012, 05:48 PM
By Shikarnov in forum OS X - Operating SystemReplies: 9Last Post: 02-06-2012, 01:19 PM