Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ProFTPd - hiding stuff

Status
Not open for further replies.

Donboy

IS-IT--Management
Aug 20, 2002
73
US
This should be an easy one...

When I login to my FTP client, I can see a bunch of stuff in there that I'd rather not see.

For example, I'm seeing the folders .kde, .xemacs, and a bunch of .bash files (and other dot files).

I want to hide these, but I don't want to turn off hidden files in proftpd.conf. I still want to be able to see hidden files like .htaccess.

I currently have my settings to hide files owned by root and that works great, but I'm wondering if I should change these files (mentioned above) to be owned by root so they will also not be shown.

Is that a good idea? Can somebody explain what these files/directories are for? (Sorry! Linux noob!) And do they need to be owned by the user? Or can they be owned by root? Is there a good way of filtering these from view in the FTP client?

Thanks in advance.
 
edit /etc/passwd....
Ex.
User:x:1284:1284:Example User ,,,:/home/Example User/public_html:/bin/bash

This example puts the user into the public_html directory (the users specified home directory) ...If they are a user who should just be accessing their web directory. When they log in they will be dropped into this directory...
By defualt the user when created would look like this
Example User:x:1284:1284:Example User ,,,:/home/Example User:/bin/bash ... If you would like to research it further you can actually chroot your users so that they cannot browse any other directory besides the one specified.
 
Ah, ok. That's a better approach. Rather than trying to hide the files, I'll just change their root directories to something else.

Thanks for the help!
 
np.
Also check for an /etc/ftpchroot directory... Add your users to that to keep them from seeing anything else... Don't know if this is of any interest to you or not :) ...I just found this out since last night when I posted.
 
Don't have that directory. Actually I'm using their logins which send them to their home directories by using this directive...

<Global>
DefaultRoot ~
</Global>
 
Rory, I think that that ftpchroot file is specific to your FTP daemon. From what I know, the only way to chroot ProFTPd users is with the DefaultRoot directive. Do me a favor and run &quot;rpm -qf /etc/ftpchroot&quot; to find out which package thats from.

Donboy, only change the users home directories if they don't need any kind of shell access (ssh, telnet, console), because users need most of those .files (hidden files) for when they log in (especially the .bash* files).

I haven't used this before, but this &quot;HideFiles&quot; directive looks like it might work for you...


ChrisP
 
I don't expect my users would need shell access, but you never know.

I actually did look at this directive before, but I had a hard time coming up with a regex that would accomplish the needed goal. The trouble is, I want to hide all of the dot files except for .htaccess or .htpasswd.

I also ran into some trouble with other directives that were depreciated. I kept finding ones that seemed to accomplish my goal, but the docs said to use other directives instead. I even tried using one that seemed to be OK, but when I restarted ProFTPd, it returned a message saying that I was trying to use a depreciated directive!

So that's when I got fed up with trying to do it myself and came to the forums.

I think for now, I will just forego the ability to shell and change all of their home directories to something else. If I need shell back, I'll revisit the issue... unless of course you can direct me to a good site that explains how to construct a decent regex?

I looked here, but it was so disappointing that they didn't provide anything more than this.


I looked at this and thought, &quot;gee, that helped&quot;.
 
I would think that
[tt]HideFiles !^\.ht(passwd|access)$[/tt]
should work.

//Daniel
 
Didn't work. Now I can't see any files or directories at all. I think this is a good starting point. I'll try to mess around with it a little now that i know the basic idea.
 
fliud11... I am not a Red Hat user it is actually a debian distro (Woody)

This is the ftpd that I am running...
ftpd 0.17-13
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top