Hosts file unlock

I'm having problems unlocking the hosts file - my Acrobat isn't working and the online tech needs access to the file to fix the problem. The hosts file doesn't allow administrator access. Any ideas?

MacBook Pro with Retina display, iOS 9.2.1, El Capitan

Posted on Jan 29, 2016 9:35 PM

Reply
20 replies
Sort By: 

Feb 1, 2016 6:18 AM in response to angndal

I was able to modify my /etc/hosts files on my El Capitan system using "sudo nano /etc/hosts" and SIP was enabled on my system

csrutil status

System Integrity Protection status: enabled.

If you think it is SIP that is stopping you, then you can disable it, modify /etc/hosts, then re-enable SIP (a lot of steps)

<http://www.imore.com/el-capitan-system-integrity-protection-helps-keep-malware-a way>

Or Google "disable os x sip" and you will find more links.


But, I did test "sudo nano /etc/hosts" both before I posted my reply, and just now. So I do not know why it likes me, but it did work for me.

Reply

Feb 2, 2016 1:30 PM in response to angndal

SIP does not apply to the hosts file.


I'm skeptical about the approach that this tech is following, too. While it might be correct, this is also something that some folks use to either break Adobe licensing, or that can be used to gain access to your system. If the hosts file is at its default configuration, then there's no need to access it. If the hosts file is not at its default configuration, then something (or someone) changed it — and you'll want to determine what happened.


A typical hosts file looks something like this:


##

# Host Database

#

# localhost is used to configure the loopback interface

# when the system is booting. Do not change this entry.

##

127.0.0.1 localhost

255.255.255.255 broadcasthost

::1 localhost

fe80::1%lo0 localhost

#


To gain access — as others have indicated — use the following command, and the nano text editor:


sudo nano /etc/hosts


Here's a related description, using TextEdit and the GUI.


Here's a related discussion over in the Adobe forums. (Does Adobe really modify the hosts file? Seriously?)

Reply

Feb 4, 2016 8:08 PM in response to angndal

I know of no reason that Adobe Acrobat would need to alter Hosts, but to fix an altered Hosts file please refer to Advanced steps for fixing issues with iTunes Store connection - Apple Support.


Don't be misled by the title. The instructions for fixing a modified Hosts file appears in that document, under the heading If the hosts file blocks the iTunes Store in Mac or Windows.


Use those instructions to edit the offending entries in your Mac's Hosts file. By default that file should resemble what MrHoffman wrote, repeated here for reference:


##

# Host Database

#

# localhost is used to configure the loopback interface

# when the system is booting. Do not change this entry.

##

127.0.0.1 localhost

255.255.255.255 broadcasthost

::1 localhost

fe80::1%lo0 localhost


Your Mac's Hosts file will probably start with entries like the above. Do not alter them. A modified Hosts file is likely to contain one or more lines in addition to them. Those offending entries will prevent communication with their corresponding addresses. The example screenshot in the Apple Support document shows an line ending in gs.apple.com which is used as an example of an offending entry. Either delete the ones you have, or add a # and space character to the beginning of each line as described.


Back up your Mac prior to making any changes. If you do not perform the above instructions correctly, then you will not be able to connect to the Internet, and you will need to rely upon that backup.

Reply

Feb 1, 2016 6:09 PM in response to angndal

What happens when you follow BobHarris' instructions?


Also, execute the following terminal and let us know what the result is:

ls -ale /etc/hosts

The instructions to use nano as sudo WILL work on any version of Mac OS and would not be restricted by any of Apple's security features. The only requirement is that the user that you are logged in as must be an administrator.


About the only thing that I can imagine that might restrict sudo access to the hosts file would be security or anti-virus software installed on your Mac. If you have any security or anti-virus installed, remove it completely and then try again. You may also find that your Adobe problem also goes away.


Honestly, if Adobe support is having to edit your hosts file then you have some other serious DNS resolution problems or abnormal firewalling or filtering. Even if modifying your hosts file solves your Adobe problem, it is really a symptom of a more significant network problem.

Reply

Feb 1, 2016 11:49 PM in response to etresoft

the message once I change the hosts file and try to save is "[error writing /etc/hosts: Operation not permitted ] - when I access the file in the folder it's locked and won't let me unlock it because access is only for system not me as administrator. I'll try the safe reboot and see what happens.

Reply

Feb 2, 2016 9:03 PM in response to angndal

Great. That looks like the ownership and permissions are correct.


Are you sure that your user account is an administrator on the Mac? You cannot run commands as sudo if you are not logged in as an administrator, or, unless you have an administrator account that you can first "su" to in the terminal.


Assuming that Adobe just wants to remove bogus entries from your hosts file, lets first make sure that there is a problem. MrHoffman has posted what a clean hosts file looks like below. You should compare the contents of your to that.


To do so, type the following into Terminal to view your hosts file:

cat /etc/hosts


Does your's contain ANY entries that are not listed in the example below?

Reply

Feb 2, 2016 10:11 PM in response to angndal

angndal wrote:


I'm having problems unlocking the hosts file - my Acrobat isn't working and the online tech needs access to the file to fix the problem.


What "online tech"?


There should be no need to alter etc/hosts, unless you are a website developer or have a similar legitimate need to do so.


I suspect you were not in contact with legitimate Adobe support personnel. If Acrobat isn't working for you, describe what's wrong, or contact Adobe for support.


Never use Google to search for legitimate support contact information. Most of its search results will be scam outfits misrepresenting themselves as legitimate support, and will seek to intrude upon your Mac to install software in an attempt to steal your personal information or to defraud you in some other manner. If you need Adobe product support, navigate on your own to Adobe's website and proceed from there.

Reply

Feb 3, 2016 5:25 AM in response to John Galt

Hello John,

I'm pretty sure that Adobe realizes there are millions of Macs with hacked up hosts files to run pirate versions of their software. In fact, that is part of Adobe's two-sided market strategy. But if someone wants to upgrade from pirate versions to legitimate versions, they are going to have to fix that hosts file. To its credit, Adone dosn't seem to judge people. If someone wants to pay, Adobe will help and forgive trespasses.

Reply

Feb 4, 2016 7:55 PM in response to angndal

Hello again angndal,

I haven't seen the file, so I can't comment on it. However, hacking the hosts file to pirate Adobe software is extremely common. I'm not necessarily saying that you did that, but that would be my initial assumption in these cases - just the law of averages at work. I'm quite sure it would be Adobe's initial assumption too. There are legitimate reasons to edit the hosts file, but that particular Adobe tech you talked to probably assumes the most common reason, like I did.


A bigger question is why you can't edit that file. It is not part of El Capitan's System Integrity Protection (AKA rootless). There are only two reasons why you wouldn't be able to edit it:

1) You are using a standard user who cannot execute sudo, or

2) Your sudoers file is corrupt.


1) is the most likely. In the Terminal, you can type "su <admin>" where <admin> is the short name of an administrator account on your machine. Then, you should be able to use the "sudo" command.

2) should cause some other error message, but it's hard to tell these things on the internet.


Maybe try to edit the file again and take a screen shot of the error message. And maybe copy and paste the command you used for editing the file to begin with.

Reply

Feb 4, 2016 11:08 PM in response to angndal

Sudo is not root, sudo stands for substitute user do. By default, sudo substitutes as root but you can be logged into any account to substitute as any user.


$ sudo -u username nano /etc/hosts


System Integrity Protection does not protect /private and /etc is actually a symlink to /private/etc. SIP is irrelevant to modifying the hosts file.


If you are trying to edit the hosts file and it's "not working" then a good place to start is with what is happening.

Reply

Nov 14, 2017 4:14 AM in response to angndal

Had the same issue, since im used to linux cmd i figured out that if your user isn't sys admin, you need to sudo su to become root admin. Follow steps below


$ Sudu su

Password: Enter your user password

# nano /etc/hosts

You are now in hosts file

Do your changes

Save by Control O

Exit by Control X


Now flush your dns or reboot

Reply

Nov 14, 2017 4:29 PM in response to danadalis

danadalis wrote:


Had the same issue, since im used to linux cmd i figured out that if your user isn't sys admin, you need to sudo su to become root admin. Follow steps below

Technically, you can ONLY use 'sudo' if you are an 'admin'. That is to say "id -a" includes "80(admin)" in the output.


If "sudo su" worked for you, then you were logged in as an 'admin' and "sudo su" is similar, to "sudo sh", where you just run a the Bourne shell as as 'root'


If you are NOT an 'admin', then you would need to use:

su <unix_name_for_an_admin>

Password: <admin_user's_password>

Now you are running as the admin, so you can now use 'sudo'

sudo nano /etc/hosts

Password: <admin_user's_password>

Reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Hosts file unlock

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.