Results 1 to 5 of 5
  1. #1
    Host file modification

    Member Since
    Jul 11, 2008
    Posts
    11
    Host file modification
    I am trying to edit the host file on a leapord computer. I have been able to open the file and edit the file. The issue is that it keeps telling me that I do not have rights to save the file. It does not allow me to edit the file then save it. I try to open the file using the sudo command followed by the open /private/etc/hosts It asks for a password and either tells me incorrect password, or it just goes down like I typed it in correctly but does not open the file. I have also turned on the root user and changed the password of the root user. This still tells me that I have the wrong password. The goal is to edit the hosts file and save it.

  2. #2
    Host file modification
    Dysfunction's Avatar
    Member Since
    Mar 17, 2008
    Location
    Tucson, AZ
    Posts
    6,821
    Specs:
    Way... way too many specs to list.
    the password required is the user in sudoers.. that is.. your password. Assuming you're logged on as an administrative user. What are you trying to change in hosts?
    mike
    This machine kills fascists
    Got # ? phear the command line!

  3. #3
    Host file modification

    Member Since
    Jul 11, 2008
    Posts
    11
    I am trying to add the ip address of our intranet website. So the computer knows where to go. I found out a solution that worked for me. I will add it in the next post.

  4. #4
    Host file modification

    Member Since
    Jul 11, 2008
    Posts
    11
    Answer

    First you have to enable the root user on the Leapord. It is defaulted that the root user is turned off on Leapord. To turn it on go to:

    Application-utilities-Directory utility.app
    unlock it if it is locked
    click edit- enable root user and then type in the root user password that you want to make it.

    Then you have to allow finder to show the hidden files and folders. To do this go to a terminal

    application-utility-terminal
    in terminal type
    defaults write com.apple.finder AppleShowAllFiles -bool true
    press return
    then type in killall Finder
    press return and then the screen will flicker.

    Now click on your hardrive
    click on the private folder to highlight it
    click apple I at the same time to view the folder permissions
    at the bottom of the folder permission page that pops up there will be a spot labelled sharing and permissions
    click on add user it is a little plus sign
    add the user that you are logged into as to the folder.
    Give the user read and write permissions then
    click apply to enclosed items.

    Now go back to finder and open
    private-etc-hosts
    Host should open in editor if not click apple I and change it to open in editor. Add whatever to the host file and click on save. This should allow you to save the changes to the file. Without doing all these steps I was getting an error saying that I did not have the rights to modify and save the file.

    Hope this helps someone. It was a pain for me.

  5. #5
    Host file modification
    Dysfunction's Avatar
    Member Since
    Mar 17, 2008
    Location
    Tucson, AZ
    Posts
    6,821
    Specs:
    Way... way too many specs to list.
    You do not have to enable root. sudo su - and you will be root. You also do not need to make all items visable in Finder, ls -a will do the same in terminal. Nano and vi work quite well for editing. Lets not make it more complicated than need be. Actually, I'd sudo su - then
    echo "xxx.xxx.xxx.xxx hostname" >> etc/hosts
    mike
    This machine kills fascists
    Got # ? phear the command line!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Host file
    By bubba2012 in forum Switcher Hangout
    Replies: 4
    Last Post: 05-01-2012, 07:08 AM
  2. Help! Messed up my host file in /etc/!
    By white book in forum OS X - Operating System
    Replies: 1
    Last Post: 03-24-2011, 02:40 AM
  3. Host File
    By barry in forum Switcher Hangout
    Replies: 2
    Last Post: 03-30-2009, 11:49 AM
  4. Host File
    By egandolfi in forum Internet, Networking, and Wireless
    Replies: 5
    Last Post: 01-25-2007, 11:06 PM
  5. Host file from Hell
    By CannonFotter in forum Running Windows (or anything else) on your Mac
    Replies: 4
    Last Post: 01-21-2004, 12:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •