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

Chizzled

macrumors member
Original poster
Jul 12, 2009
47
0
Hello,

I followed the steps provided by the Dev team to prepare myself for future jailbreaks, but i do not have permission to save the file i needed to edit.

Link...http://www.saurik.com/id/12#howto

File to edit.../etc/hosts

entered...74.208.105.171 gs.apple.com

I could not save file. I changed permission to read and write, but still do not have permission to save file.

I have Snow Leopard and iTunes 9.

Anybody else have any success?
 

GoCubsGo

macrumors Nehalem
Feb 19, 2005
35,741
153
You need to be logged in as root before you can save to that file.
You have to first enable the root user, log out and edit, log out and return to the admin or whatever account you use, and you should be set.
 

jared_kipe

macrumors 68030
Dec 8, 2003
2,967
1
Seattle
In case you haven't figured this out yet, if you're using the command line to edit the file. Just type in "sudo -s" and enter your password before you try to edit the file with nano or whatever editor you prefer.
 

spamdumpster

macrumors 6502a
Jan 22, 2008
574
0
You could also copy the host file to the desktop, edit it there, and then copy it back to /etc. When you do that, the computer will ask for your password to authenticate and you'll be all set.
 

Chizzled

macrumors member
Original poster
Jul 12, 2009
47
0
Done!

Thanks you guys,

I went ahead and edited the file under root user. To enable root user with Snow Leopard, follow the steps in the provided link...

http://stringfoo.com/2009/09/07/tutorial-enabling-root-access-in-os-x-snow-leopard/

When I opened the 'hosts' file, it automatically opened a 'hosts copy' file. I could not edit the original 'hosts' file. Instead, I edited the 'hosts copy' file, erased the original 'hosts', then renamed the 'hosts copy' to 'hosts.'

Seems to work just fine.

Hope this helps someone else as well.

Thanks again for your super fast replies!!
 

ViViDboarder

macrumors 68040
Jun 25, 2008
3,447
2
USA
You can also use the command-line and use vi to edit it by doing
Code:
sudo vi /etc/hosts
I believe. I did this when I was trying to make my fake .mac server. :D
 

badgerman

macrumors 6502a
Jun 9, 2008
546
1
That's the full filepath... /etc/hosts

How do you find this without terminal, i can not see any folders called etc in finder.

Text Wrangler requires you to find the file...

In terminal I get after typing /etc/hosts

-bash: /etc/hosts: Permission denied
 

badgerman

macrumors 6502a
Jun 9, 2008
546
1
technically it's /private/etc/hosts

;)

Cant find that either and in Terminal still get permision error despite enabling acount as root and logging on and off again.

Driving me nutz this. How long have I got to do this? 3GS JB 3.0
 

jared_kipe

macrumors 68030
Dec 8, 2003
2,967
1
Seattle
Well in finder you can use the menu option Go->GoToFolder
In the popup dialog type "/etc"
The hosts file will be in there.
You can copy paste, but you may end up with bad permissions.

You can right click hosts, and click the little lock icon at the bottom of it, authinticate and then change everyone acces to read/write.


Then edit it with Textwrangler or whatever.
Then change back the privileges if you want to.


OR open terminal and type "sudo nano /etc/hosts" type in password (you won't see your password being typed so do it from memory)

Edit with the keyboard arrows for moving around (no mouse), then press "control+o" then press return (to save the file). And reboot computer.

EDIT: I routinely do this on mac and windows computers to allow a unique name website like blah.local to pass to a specific IP address on my network. This allows for MAMP to prototype websites in different OS/browser combinations even from within a virtual machine.
 

Enigmafan420

macrumors 6502a
Apr 18, 2008
898
1
Puget Sound, U.S.A.
Well in finder you can use the menu option Go->GoToFolder
In the popup dialog type "/etc"
The hosts file will be in there.
You can copy paste, but you may end up with bad permissions.

You can right click hosts, and click the little lock icon at the bottom of it, authinticate and then change everyone acces to read/write.


Then edit it with Textwrangler or whatever.
Then change back the privileges if you want to.


OR open terminal and type "sudo nano /etc/hosts" type in password (you won't see your password being typed so do it from memory)

Edit with the keyboard arrows for moving around (no mouse), then press "control+o" then press return (to save the file). And reboot computer.

EDIT: I routinely do this on mac and windows computers to allow a unique name website like blah.local to pass to a specific IP address on my network. This allows for MAMP to prototype websites in different OS/browser combinations even from within a virtual machine.

Okay I just did this (basically) by copying hosts to the desktop, changing the permissions, then using textedit to add the line.

I have a 3GS and 3.0.1. I KNOW I AM NOT SUPPOSED TO UPDATE YET :) But what do I do now? Should I Sync the phone? I have downloaded the 3.1 ipsw but not installed it yet, and I have set itunes (8.x.x) to not remind me again about the update.

Cheers!
 

Enigmafan420

macrumors 6502a
Apr 18, 2008
898
1
Puget Sound, U.S.A.
Okay I just did this (basically) by copying hosts to the desktop, changing the permissions, then using textedit to add the line.

I have a 3GS and 3.0.1. I KNOW I AM NOT SUPPOSED TO UPDATE YET :) But what do I do now? Should I Sync the phone? I have downloaded the 3.1 ipsw but not installed it yet, and I have set itunes (8.x.x) to not remind me again about the update.

Cheers!

Anyone?!?

Thanks :)
 

thelatinist

macrumors 603
Aug 15, 2009
5,937
51
Connecticut, USA
In my opinion, the easiest way to edit hosts is to open terminal and type:

Code:
sudo nano /etc/hosts

Edit the file, save (ctrl + o) and exit (ctrl + x).

what do I do now? Should I Sync the phone? I have downloaded the 3.1 ipsw but not installed it yet, and I have set itunes (8.x.x) to not remind me again about the update.

You don't need to do anything else. Now if you need to restore, you can do so using the 3.0 ipsw.

And feel free to sync your iPhone as long as you are very careful not to upgrade.
 

Enigmafan420

macrumors 6502a
Apr 18, 2008
898
1
Puget Sound, U.S.A.
In my opinion, the easiest way to edit hosts is to open terminal and type:

Code:
sudo nano /etc/hosts

Edit the file, save (ctrl + o) and exit (ctrl + x).



You don't need to do anything else. Now if you need to restore, you can do so using the 3.0 ipsw.

And feel free to sync your iPhone as long as you are very careful not to upgrade.

Okay done all this-thanks for the info. However, does doing this step mean I can restore 3.X AUTOMATICALLY? I thought that something had to be stored on Suarik's server and as far as I know, I have not stored the ECID there.

Cheers! :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.