New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

OS 10.5 - Host file modification


Post Reply New Thread Subscribe

 
Thread Tools
mastertag

 
Member Since: Jul 11, 2008
Posts: 11
mastertag is on a distinguished road

mastertag is offline
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.
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,638
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
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!
QUOTE Thanks
mastertag

 
Member Since: Jul 11, 2008
Posts: 11
mastertag is on a distinguished road

mastertag is offline
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.
QUOTE Thanks
mastertag

 
Member Since: Jul 11, 2008
Posts: 11
mastertag is on a distinguished road

mastertag is offline
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.
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,638
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
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!
QUOTE Thanks

Post Reply New Thread Subscribe


« Leopard install issues | dramatic overhaul of function keys »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Moving mp3's to your Audiobooks folder bobtomay iPod Hardware and Accessories 10 10-10-2009 12:02 PM
ZFS To Become Default File System In Leopard kaidomac Apple Rumors and Reports 21 06-26-2007 02:29 PM
Windows 2003 File Server & Quark kegwell OS X - Operating System 0 01-15-2007 02:35 PM
Unix Executable File problem fender1100 OS X - Apps and Games 9 01-07-2007 06:20 AM
File icons not displaying properly mrgee OS X - Operating System 7 09-10-2005 06:49 AM

All times are GMT -4. The time now is 07:31 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?