Salt-the-Earth.net
PureFTPd Script

Here's a quick script I threw together for a friend of mine who's a busy sysadmin. It's not very complex but it was a fun little problem to solve and might be useful to someone else.potentially. He uses PureFTPd to serve up a bunch of stuff to a group of geeks. This geek group uses one particular id, but there are tons of other ids on the box doing file transfers. This presents a problem. Because the geeks are all working together on projects, starting a file transfer depends on if another is done uploading it. Not wanting to step on each other, we started using the reporting system that PureFTPd provides which is a command called ftpwho. The command presents data about downloaders into several formats including a web page or XML. The information though, is open to abuse. The geek users could potentially see all the other user names and what they were transferring, even their host names. We needed a way to limit what the geek users saw to activity on the username they had access to. This script is the result. It presents the user with a choice of auto refreshing, and then moves to another page where current usage is displayed for that user name.

If it looks over modularized, that's just my coding style for CGIs. I always do that because I don't know where the thing will end up when I'm done adding all the cool features I think of along the way. Feel free to edit anyway you want!

Update: I got an e-mail from the individual who originally asked me to write the script. It seems that the command I was using was symlinked after ripping out an old install of proftp. I've updated the script. Below you'll find the system commands to make the script work.

i guess if they don't have security concerns with pure-ftpwho command they should do the following to make your script work (as root):
   # chmod +s /path/to/pure-ftpwho (if you don't know the path to pure-ftpwho then type:
   # which pure-ftpwho    /usr/local/sbin/pure-ftpwho //that's mine so i'll use it in the rest of the examples now make the symlink:
# ln -s /usr/local/sbin/pure-ftpwho /bin/ftpwho
that's it...
test it by logging in as a normal (non-root) user and running ftpwho command.
hope i didn't forget a step any where...


I'm sure this is probably a security no-no and will bring ruination or something, so use at your own risk.

Back to Tools
Back to Salt-the-Earth

Username:

Password:


Remember Me



Sign Up


What am I grooving to?

Not playing anything right now.


What's playing on the house box?

Not playing anything right now.




This site blocks the RIAA/MPAA Copyright ©2003 salt-the-earth.net Some Rights Reserved