Administrator Can't Edit Hosts File

B

Boris

I'm running a new Vista machine, and as Administrator, I want to edit
my hosts file, but when I complete the edit and try to save, I get: "C:
\Windows\system32\drivers\etc\hosts was denied".

Here's the details:

When I set up the machine, I created only one account, ME, and a Guest
account was also created. If I go to the User Accounts panel, I see
that the only two accounts listed are, "ME-Administrator", and "Guest-
Turned off". So, I'm set up as the administrator.

If I do a "Properties" on the hosts file, and go to the "Security"
tab, I see three groups of users, who have the following permissions:

System-Full, Modify, Read and Execute, Read, Write
Administrator (VISTA_MACHINE\Administrators)-Full, Modify, Read and
Execute, Read, Write
Users (VISTA_MACHINE\Users)-Read and Execute, Read

According to the permissions that the system shows, above, I, as
Administrator, should be able to edit the hosts file. Why can't I?

Thanks.
 
J

JCS

You aren't THE Administrator. That account is hidden/disabled by default in
Vista. You could either enable THE Administrator account or you could go to
your notepad.exe shortcut, right-click, and select "Run as administrator".
You can do a search of these forums or on Google to find out how to enable
THE Administrator account so that it appears on the Welcome screen.
 
B

Boris

You aren't THE Administrator. That account is hidden/disabled by default in
Vista. You could either enable THE Administrator account or you could go to
your notepad.exe shortcut, right-click, and select "Run as administrator".
You can do a search of these forums or on Google to find out how to enable
THE Administrator account so that it appears on the Welcome screen.












- Show quoted text -

So what you're saying is that I'm not REALLY the big cheese. OK.

I did some searching, and foud out how to enable the REAL
administrator account, but decided to do as you suggested, use Notepad
and "Run as administrator". It worked fine, except that I had to open
Notepad and navigate to the file itself. It's much easier to double
click the hosts file, and have Notepad open it. But your workaround
is just fine.

Question...Do I (ME-Administrator, as listed in the User Accounts
Panel), fall into the Users (VISTA_MACHINE\Users) category, as listed
in the security tab? If that is indeed ME in the Users group, will
enabling Full permissions (if Vista will allow that), or at least
write permission, let me then edit the hosts file as originally
planned?

Thanks again.
 
R

Rick Rogers

Hi Boris,

Even an admin account has to self-elevate to open and edit system files.
They would not be accessible under normal running mode. Click start and type
notepad, then right click the entry in the menu and select 'run as
administrator'. Then click file/open and navigate to the HOSTS file and
select it.

--
Best of Luck,

Rick Rogers, aka "Nutcase" - Microsoft MVP

Windows help - www.rickrogers.org
My thoughts http://rick-mvp.blogspot.com
 
A

Andrew McLaren

Boris said:
I'm running a new Vista machine, and as Administrator, I want to edit
my hosts file, but when I complete the edit and try to save, I get: "C:
\Windows\system32\drivers\etc\hosts was denied".

JC and Rick Rogers have already replied with good info.

To add an explantory note ... it was a favourite method of viruses, bots and
trojans, to write false IP address entries into the HOSTS file. Since name
resolution will often be by HOSTS lookup before DNS, it was a neat way to
hijack URLs to bogus stes.

Hence, the HOSTS file is well-protected in Vista, to prevent exactly this
kind of attack.

But an elevated administrator can edit the file.

Hope it helps,
 
B

Boris

JC and Rick Rogers have already replied with good info.

To add an explantory note ... it was a favourite method of viruses, bots and
trojans, to write false IP address entries into the HOSTS file. Since name
resolution will often be by HOSTS lookup before DNS, it was a neat way to
hijack URLs to bogus stes.

Hence, the HOSTS file is well-protected in Vista, to prevent exactly this
kind of attack.

But an elevated administrator can edit the file.

Hope it helps,

Thanks for all the tips, everyone. Much appreciated.
 
D

DevilsPGD

In message <[email protected]> Boris
Question...Do I (ME-Administrator, as listed in the User Accounts
Panel), fall into the Users (VISTA_MACHINE\Users) category, as listed
in the security tab? If that is indeed ME in the Users group, will
enabling Full permissions (if Vista will allow that), or at least
write permission, let me then edit the hosts file as originally
planned?

Yes. Pretend you're not a member of the Administrators group except
when you use the "Run as administrator" feature, or otherwise have a UAC
popup.

Give yourself, or "Users" the ability to write a file and you won't need
to run as administrator to do it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top