Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

yesiam

macrumors newbie
Original poster
Sep 26, 2017
2
0
Hello guys,

I have an issue with the admin rights on my yosemite os.
Even though I am logged in as an administrator, I don't have permission to edit some of the system files (e.g hosts file).
I totally don't get it. Do you have any clue why is that so and how can I gain permission to edit my files?

Thanks a lot, I would appresiate your help.
 

BrianBaughn

macrumors G3
Feb 13, 2011
9,852
2,506
Baltimore, Maryland
See if you can copy the file to the desktop, make another copy of that as a backup, edit the first copy, then drop the edited version back to the original location to overwrite with authentication.
 

yesiam

macrumors newbie
Original poster
Sep 26, 2017
2
0
Yay! It works!

T h a n k s, Brian.

I owe you a good beer ;)
 

ocabj

macrumors 6502a
Jul 2, 2009
548
202
Who exactly are you logged in as? /etc/hosts should be owned by root. You still need to sudo to edit root owned files unless you actually logged in as root.
Code:
$ ls -al /etc/hosts
-rw-r--r--  1 root  wheel  307 Sep 20 06:32 /etc/hosts
$ sudo vi /etc/hosts
Password:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.