View Full Version : /etc/host (Mac users) No permission
Chizzled
Sep 15, 2009, 12:55 PM
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?
jessica.
Sep 15, 2009, 12:56 PM
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
Sep 15, 2009, 01:10 PM
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
Sep 15, 2009, 01:33 PM
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
Sep 15, 2009, 01:36 PM
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
Sep 15, 2009, 01:49 PM
You can also use the command-line and use vi to edit it by doingsudo vi /etc/hosts I believe. I did this when I was trying to make my fake .mac server. :D
dhlizard
Sep 15, 2009, 02:36 PM
Just get TextWrangler (for Mac) it's free and does this simply. No terminal, just find the file, touch the pencil, edit and save.
badgerman
Sep 15, 2009, 03:00 PM
Just get TextWrangler (for Mac) it's free and does this simply. No terminal, just find the file, touch the pencil, edit and save.
How did you find this etc/host file?
ViViDboarder
Sep 15, 2009, 03:19 PM
How did you find this etc/host file?
That's the full filepath... /etc/hosts
jaikob
Sep 15, 2009, 03:23 PM
That's the full filepath... /etc/hosts
technically it's /private/etc/hosts
;)
badgerman
Sep 15, 2009, 03:25 PM
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
Sep 15, 2009, 03:40 PM
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
Sep 15, 2009, 04:40 PM
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
Sep 16, 2009, 12:44 AM
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
Sep 16, 2009, 10:54 PM
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
Sep 17, 2009, 12:26 AM
In my opinion, the easiest way to edit hosts is to open terminal and type:
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
Sep 17, 2009, 04:12 PM
In my opinion, the easiest way to edit hosts is to open terminal and type:
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! :)
dhlizard
Sep 17, 2009, 05:16 PM
How did you find this etc/host file?
I enabled show hidden files so it would show up.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.