How do I set permissions in Hosts

Discussion in 'MacBook Pro' started by okizen, Mar 29, 2012.

  1. macrumors member

    Joined:
    Jan 21, 2012
    #1
    I've been trying to edit the host file in private/etc/ but when I try to save the files it says 'You don’t have permission to write to the folder that the file “hosts” is in. How do I set the read/write permission?
     
  2. simsaladimbamba

    Joined:
    Nov 28, 2010
    Location:
    located
  3. macrumors 68020

    Joined:
    Feb 28, 2011
    #3
    simsaladimbamba is right on the permissions settings, but I'd just sudo in terminal and edit there without resetting since you really don't need to for what you're doing.

    sudo nano /private/etc/hosts

    should get you there.
     
  4. thread starter macrumors member

    Joined:
    Jan 21, 2012
    #4
    I've tried 'sudo nano /private/etc/hosts' and this is the response:

    sudo: /private/etc/sudoers is mode 0666, should be 0440
    sudo: no valid sudoers sources found, quitting
    Macs-MacBook-Pro:~ mac$

    How should I change the mode to 0440?
     
  5. macrumors 68020

    Joined:
    Feb 28, 2011
    #5
    Your /etc/sudoers file has somehow got the wrong file permissions. You could fix this using chmod but unfortunately I think you would need to use sudo to do that. So instead, try using Disk Utility in /Applications/Utilities select your HD and chose Repair Disk Permissions from the First Aid tab.
     
  6. macrumors regular

    Joined:
    Feb 27, 2012
    #6
  7. thread starter macrumors member

    Joined:
    Jan 21, 2012
    #7
  8. macrumors newbie

    Joined:
    Nov 28, 2012
    #8
    Also having a problem with permissions (as administrator) for the hosts file. Seems like Gas Mask has done just what I expected and it took less time than to log in and write this reply. Thanks a lot for the software tip.
     

Share This Page