Just to add to this: be extremely careful which folders you do this to.
If, for example, you decided you didn't want anyone looking in your home folder, and you did this procedure on your home folder, then you would severely bork OS X's ability to log you in. If, for example, you did this to the System folder thinking that you're keeping everyone from messing around with the contents of the System folder, you would have then prevented OS X from booting properly, and it would be a severe hassle to get things back to normal.
I would only advise using this procedure on folders you, yourself created -- not any folders that are pre-existing on the system already.