Problem modifying hosts file, change file permissions?

kapalu

New member
Local time
2:13 AM
Messages
4
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 Computer

Computer type
PC/Desktop
OS
Windows 7 Home Premium, 64 bit
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 Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Alienware Aurora ALX R4
OS
Windows 10 Pro (x64)
CPU
Intel Core i7-3930K (3.2GHz - 4.5GHz)
Motherboard
Alienware Aurora-R4 x79
Memory
4x Samsung 4GB PC3-12800 DDR3 (16GB 1600MHz)
Graphics Card(s)
Nvidia Geforce GTX 690
Sound Card
SteelSeries Siberia Elite
Monitor(s) Displays
Dell UltraSharp U3011
Screen Resolution
2560x1600
Hard Drives
Samsung 850 Pro 256 GB, Seagate 1TB Desktop Hybrid HDD, 2x Western Digital 4TB Green HDD
PSU
875W Some Dell PSU <.<
Case
Alienware Aurora ALX
Cooling
Custom Liquid Cooling (EK CPU & GPU blocks) dual EK 480RAD
Keyboard
Logitech G710+ Mechanical
Mouse
Logitech G700s
Internet Speed
Verizon Fios (50 mbps average)
Other Info
Server: Intel NUC D54250WYK: i5-4250U, 16GB, 256 GB mSATA, Windows Server 2012 R2
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 Computer

Computer type
PC/Desktop
OS
Windows 7 Home Premium, 64 bit
Hey there Kapalu,

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 Computer

Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
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 Computer

Computer type
PC/Desktop
OS
Windows 7 Home Premium, 64 bit
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 Computer

Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
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 Computer

Computer type
PC/Desktop
OS
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.
Yep. Sounds like an issue with the application, Notepad++.

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

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.

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 Computer

Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
Back
Top