Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Problem modifying hosts file, change file permissions?

23 Mar 2015   #1
kapalu

Windows 7 Home Premium, 64 bit
 
 
Problem modifying hosts file, change file permissions?

Hi all,win7 Home Premium 64 bit. I'm having difficulties modifying my hosts file. Following guidance from this forum, I open Notepad++ as administrator & can navigate to and open the hosts file. But the "Save" option is greyed out, so I can't save directly to the original location. I can Save As (eg to the Desktop), then copy paste into the original location.
This is actually part of a larger troubleshooting issue, in which the person helping has suggested changing the file permissions on the hosts file. I'm worried about doing that, as it seems quite a security risk. But the immediate question is, is the behavious of my hosts file unusual, or is that how Windows 7 is meant to work?</p>


My System SpecsSystem Spec
.
23 Mar 2015   #2
logicearth

Windows 10 Pro (x64)
 
 

Drag the file to your desktop, edit and save then drag it back. Done. This is how it should work, you want strong permissions on those directories and files to avoid malware from modifying them.
My System SpecsSystem Spec
24 Mar 2015   #3
kapalu

Windows 7 Home Premium, 64 bit
 
 

Hi logicearth, and thanks for responding.
I'm aware that I can drag & drop the hosts file after modification, and indeed referenced the same in my OP. I also said in my OP that this is part of a larger troubleshooting issue, in which the inability to modify the hosts file as administrator has been cited as the reaon why a program is not running properly.
The suggested solution is to change permissions on the hosts file, which I am unhappy about. What I'm not clear about - and the question in my OP - was whether what I am seeing is normal behavious for the hosts file, or whether in fact this is not normal, some process has locked the hosts file, and it is appropriate to change its permissions to reverse the process.
My System SpecsSystem Spec
.

24 Mar 2015   #4
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

Hey there Kapalu,

Quote   Quote: Originally Posted by kapalu View Post
But the immediate question is, is the behavious of my hosts file unusual, or is that how Windows 7 is meant to work?</p>
Is this hosts file we're referring to located in C:\Windows\System32\drivers\etc? If so, you're certainly experiencing unusual behaviour, for any elevated process should have full-control access over this file.

Are you confident that the permissions on this hosts file of yours is set correctly?

If you would like us to check, in a Command Prompt run the command,
Code:
icacls C:\Windows\system32\drivers\etc\hosts
and post back the result.
My System SpecsSystem Spec
24 Mar 2015   #5
kapalu

Windows 7 Home Premium, 64 bit
 
 

Hi Pyprohly,

Yes, thats the hosts file in question.

I ran the icalcs command and this is the result:

C:\Windows\system32\drivers\etc\hosts BUILTIN\Users:F)
NT AUTHORITY\SYSTEM:I)(F)
BUILTIN\Administrators:I)(F)
BUILTIN\Users:I)(RX)

Successfully processed 1 files; Failed processing 0 files
My System SpecsSystem Spec
24 Mar 2015   #6
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

That's just about correct, except for the listed explict grant permission on the Users group (indicated by BUILTIN\Users:(F)) which isn't supposed to be there. Did you end up granting that permission yourself?

BUILTIN\Users:(F) means that all users (on the local machine) have full-control over this file (talk about worrying about security risks), so you should have absolutely no problems editing this hosts file.

Are you sure Notepad++ is not letting you Save?? Does Ctrl+S do anything?

The issue you have does not A) relate to permissions, or B) is caused by another process locking the file (Notepad++ would state otherwise).

Try editing this hosts file using Windows Notepad / another text editing program. If that works, consider uninstalling and reinstalling Notepad++.
My System SpecsSystem Spec
24 Mar 2015   #7
kapalu

Windows 7 Home Premium, 64 bit
 
 

OK, tried opening the hosts file with Notepad2 - and it opens and saves just fine. So it seems I have a local problem with my copy of Notepad++. How frustrating, I wish I'd thought to check that earlier.

That leaves 2 issues I guess:
1) PERMISSSIONS - I'm not aware of having granting permissions to the Users Group (BUILTIN\Users:F)). Please could you tell me how I can reverse this?

2) Since Notepad2 can save the hosts file, that indicates that the problem is NOT related to Permissions, and also NOT to another process blocking the file? Is that right?

Thanks very much for taking the time to help me out with this
My System SpecsSystem Spec
24 Mar 2015   #8
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

Quote   Quote: Originally Posted by kapalu View Post
OK, tried opening the hosts file with Notepad2 - and it opens and saves just fine. So it seems I have a local problem with my copy of Notepad++. How frustrating, I wish I'd thought to check that earlier.
Yep. Sounds like an issue with the application, Notepad++.

Quote   Quote: Originally Posted by kapalu View Post
I'm not aware of having granting permissions to the Users Group (BUILTIN\Users:F)). Please could you tell me how I can reverse this?
Simply remove the non-inherited listed entry of the Users group on the hosts file from the GUI. Or you may instead just choose to run the command
Code:
icacls C:\Windows\System32\drivers\etc\hosts /remove Users
Quote   Quote: Originally Posted by kapalu View Post
Since Notepad2 can save the hosts file, that indicates that the problem is NOT related to Permissions, and also NOT to another process blocking the file? Is that right?
That's right. Notepad2 being able to save to the hosts file would suggest that both of those possible problems are not the issue.

Quote   Quote: Originally Posted by kapalu View Post
Thanks very much for taking the time to help me out with this
Your welcome. Glad the issue was identified.

And welcome to SevenForums too, Kapalu.
My System SpecsSystem Spec
Reply

 Problem modifying hosts file, change file permissions?




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Unexplained change in file permissions
Hi I wonder if anyone has come across this problem and can offer any suggestions. I keep copies of much of my music collection on an external HD and until a week ago everything was working fine. Last week when I booted up my machine and went to play some music I discovered that somehow the...
Music, Pictures & Video
Easy change back folder & file permissions
I've made a complete mess of My Pictures folder and files. What I did: logged in as non admin user, right clicked Picures folder, then Properties, then Security tab. With Authenticated users selected clicked Edit next to change permissions. Gave admin password, then clicked Full control Deny...
System Security
Changed file permissions now cant change them back
Hello i am running win 7 ultimate x64 and have this major problem, here is what i did: i needed to pawn my laptop for a short time and didnt want my files to be viewed by anyone while it was not in my possesion, so what i did i changed the file permissions of my c: drive so that only admin had...
General Discussion
Another batch file permissions problem
Just recently there was a batch file permissions problem posted here. I'm also trying to run a command window, but my problem is a bit different. I have a batch file that cleans out programs' cache before shutting down the system, that I use every night to sign off. Since I demoted my normal...
General Discussion
Problem with file permissions - help!
I've just bought a new Windows 7 computer and I'm having a problem with my e-mail and newsgroup program, Forte Agent. It's perhaps unusual in that it has a Data folder as a subfolder of the main program folder in C:\Program Files (x86). Because of this, I think Windows 7 has assumed that the...
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 11:48.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App