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

Derek~san

macrumors newbie
Original poster
Aug 4, 2003
9
0
Alright, I have people who use my laptop at school, and there are sites that they frequent that I'd prefer them not going to. Is there any way I can block the websites from being accessed? I know in Windows there is something called a "host file", or something like that that can do something along these lines. Any ideas?
 
Yup. As long as you have admin rights to the Mac.

Open up Terminal.

Then type (I use Pico so kill me): su pico /etc/hosts

It'll ask you for your password. Then edit the hosts file (an example is given). For instance, to block www.google.com just type:

0.0.0.0 www.google.com

You might also have to add google.com so that both are blocked although I'm not sure. I use my hosts file to get rid of all the ads that are shown with my Hotmail (I don't need *any* form of adult friend finder!).
 
Thanks, that worked, abliet having to use sudo in place of su. su wouldn't accept my admin password (and yes, I am the computer's administrator). Also, a friend of mine was telling me to use 127.0.0.1 so that the request never even leaves your computer. Seems to work just as well, in any case.

Also, thanks to this little exercise in Unix, I can now use vi. (emacs is teh suck :D) ^_^
 
Ahhhh... you're right. It is sudo instead of su. And 127.0.0.1 does make sense to use instead.

I don't use vi or emacs. I can never figure out how to quit them! :)
 
SilentPanda said:
Ahhhh... you're right. It is sudo instead of su. And 127.0.0.1 does make sense to use instead.

I don't use vi or emacs. I can never figure out how to quit them! :)
Well, it takes a little getting used to. vi is much than emacs in regards to things like that though, as long as you know how to do it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.