I need to able to hide a directory that is already created. More importantly when an ftp user logs in I want them to not be able to see a certian directory. It already has root permissions, any ideas?

12 Years
Discussion Span
Last Post by knalb


Inside of linux, you can make a hidden directory by placing a period in front of it, such as /home/testuser/.hiddendir The directory will not show up with a casual dir or ls command, but it will show up with a ls -al or ls -a command. It does nothing to prevent someone from getting into the directory either.

We also need some clarification concerning your FTP process. You can already restrict a FTP user to a certain directory tree, just by editing where they can go within the FTP server, and the /etc/passwd files which control the scope of the user. What are you specifically trying to do? What is your OS of choice?




If the user is not in the appropriate group, or if they're not the owner of the folder, they fall in the "Other" category. If you place a period in front, like Christian mentioned, you'll hide it. If you simply remove the read priviledge from the other group, that would do it. That way, they couldn't get a listing of the directory

For instance, if you wanted the group and the owner associated with read/write privs, but didn't want non-group members to read it, you could do chmod 660 foldername

Of course, if you really don't want people to access it, put it in a place they can't get to. If you've got an FTP root directory, put that folder in a directory that the unauthorized user has no access to.


also, most decent ftp daemons allow you to deny access to dot files, and directories.. so if its 'hidden' they can't get at it...

Votes + Comments
Grea tfollowup post!
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.