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

haraldstoll

macrumors newbie
Original poster
Sep 8, 2010
3
0
I need to add something to the HOSTS file, here is the error message that appears when I try to log in.

TextEdit[190:c0b] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x4403, name = 'com.apple.TextEdit.ServiceProvider'
See /usr/include/servers/bootstrap_defs.h for the error codes.

Using: sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts

It does open the file, but it is empty. Should it be empty? I can not save it after editing it.

But, if i use sudo open -t /etc/hosts OR $ sudo nano /private/etc/hosts

It doesn't give me any error, and it also opens the HOSTS file. But its empty!

Im using MAc Osx 10.5

Any ideas of what's going on?
 
I need to add something to the HOSTS file, here is the error message that appears when I try to log in.

TextEdit[190:c0b] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x4403, name = 'com.apple.TextEdit.ServiceProvider'
See /usr/include/servers/bootstrap_defs.h for the error codes.

Using: sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts

It does open the file, but it is empty. Should it be empty? I can not save it after editing it.

But, if i use sudo open -t /etc/hosts OR $ sudo nano /private/etc/hosts

It doesn't give me any error, and it also opens the HOSTS file. But its empty!

Im using MAc Osx 10.5

Any ideas of what's going on?

Here's what I have in /etc/hosts on my 10.5.8 system:

Code:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost 
fe80::1%lo0     localhost

Did you inadvertently wipe yours? I wouldn't consider trying to invoke TextEdit from the command line. :eek:
 
I would also not invoke text edit from a command line. I'd log in as root and open the host file there. What are you trying to add?
 
I wanted to add a foreign server as being a local one.
Meaning, "127.0.0.1 www.google.com" (example)

The file hasn't been changed in the past. I have done the trick on a windows machine.

Should i use the editor outside the terminal? Will i then have admin rights?
Can i actually find the file using explorer?

Please advise me on the best course of action to add this line to the HOSTS using Mac.
 
I wanted to add a foreign server as being a local one.
Meaning, "127.0.0.1 www.google.com" (example)

The file hasn't been changed in the past. I have done the trick on a windows machine.

Should i use the editor outside the terminal? Will i then have admin rights?
Can i actually find the file using explorer?

Please advise me on the best course of action to add this line to the HOSTS using Mac.

At Terminal command line, could do

sudo nano /etc/hosts

Then type in the line you want, press control-o to save and control-x to exit.

You can then use the chown command to change ownership if you wish.

Are you sure you know what you're doing?
 
Alternatively and (arguably) way simpler:

Code:
echo 127.0.0.1 www.google.com | sudo tee -a /etc/hosts

This will append that line to the bottom of /etc/hosts.

Yes, but since the OP had mentioned nano earlier ...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.