• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3177
  • Last Modified:

unable to edit hosts files on server 2008 r2

I am trying to edit hosts files on some servers and getting an access denied. I am logging in with the local administrator account and running notepad as an administrator but it will not allow me to save the updated hosts file in the etc folder. I also cannot save the file elsewhere and copy it to the etc folder; I still get access denied. I have tried to take ownership of the file and also get access denied message. I have other servers that allow editing of the hosts file with my normal domain admin account and no elevated privileges on notepad. Is there a registry setting or GPO entry that could cause this type of behavior? The servers are all general application servers with no special settings or permissions applied. Some of them are SQL servers but some of them are not and still have the same issue.
0
MehtaJasmin
Asked:
MehtaJasmin
1 Solution
 
Santosh GuptaCommented:
hi,

run CMD as elevated command "Run As Administrator".
type notepad
it will open the notepad, now open the host file , edit and save it.
0
 
kchallCommented:
if you copy the file to your desktop then edit the file then save it back to your desktop then copy it back to the original location
0
 
Patrick BogersDatacenter platform engineer LindowsCommented:
Hi

Did you disable UAC on that box?
0
 
MehtaJasminAuthor Commented:
Santosh and kchall, thank you for your replies but as I stated, I'm running notepad as administrator and it doesn't allow me to save the file elsewhere and copy it to the etc folder.

Patrick, no I did not disable UACs because I was able to edit the hosts file on another server with the UACs enabled. I will try disabling them to see if it makes a difference. Thanks for the reply.
0
 
Santosh GuptaCommented:
check the permission of ETC folder and HOST file. if administrators is not added then pls add.

if you are still unable to modify the host file  then take the ownership of EC folder. Do not remove any permission.  and then try.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now