Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

From a Windows computer I logged into My Mac after updating it to Lion. I have noticed that I am able to access all files on the Mac (including /dev /usr etc)

Is there a way to deny such access?

share|improve this question

If you want a file to only be accessible by one user, you use: chown user foldername to assign that folder to that owner, then restrict access using the chmod 700 foldername command. Of course, you can achieve a lot of this by calling up a file's info and just setting it so that other people no longer have access to it under the privileges tab. I once had a folder that I assigned a chmod 000 (meaning nobody could access it, not even the user) and then used su (super-user) commands to bring it up if I needed it. Another option is to use chown root filename after locking down all the privs, so that you'll have to chown it back to your own username to use it.

The vital thing is to make sure that no-body else has administrator privileges, as they will be able to access anything from anywhere, as long as they know the right commands.

You can also keep a file in your root directory hidden by adding its name to the /.hidden file. Then, you can call it up with Apple-~ in Finder, enter its name, and Voila! Make sure you clear this out afterward, as someone might stumble across it.

And be careful. If you're not sure what I just said means, just stick to using the privs menu in the file-info box, and make sure no-one else has Admin access.

share|improve this answer
That's not advisable if the whole root of the file system is exposed since you can't just go ahead and chmod system files like you want. There are certainly methods to hide files in the user's own home directory, like you said, but that's not the solution if suddenly the whole filesystem is shared as-is. – slhck Jun 13 '12 at 19:55

Check your System Preferences » Sharing. It could be that you have your Macintosh HD shared, which would expose its root filesystem, e.g. /dev, /usr et cetera.

There's no other possible reason for your whole file system being shared I can think of.

share|improve this answer
According to system sharing preferences only my public directory is being shared. Running smbclient from terminal => smbclient: command not found – Lea Hayes Jun 13 '12 at 21:28
Ah, Lion doesn't have that command anymore, sorry. Which credentials do you use from Windows to log in on your Mac? How are these folders presented in Windows Explorer? Which shares are available in Windows? "Macintosh HD", or are they called something else? Maybe you can edit your question and add a few details. – slhck Jun 13 '12 at 21:51
I logged in using my regular Mac user name and password (which was setup when I first setup my Mac before Lion). On Windows I see "Macintosh HD", "Mac User's Public Folder" and "macuser" folders. Before updating to Lion I could only see "Mac User's Public Folder" – Lea Hayes Jun 14 '12 at 23:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .