Hi, I was hoping someone could point me in the right direction here!
I look after a server which accepts automatic overnight PASV FTP uploads from remote clients. When the uploads are complete, my Bash script copies the files to another location.
The problem is, my script needs to be a bit smarter when it comes to detecting active FTP sessions.
I was using:
Code:
netstat -n | grep ":21 " | grep ESTABLISHED
to test if there were active sessions, but came unstuck when a local user left an unrelated FTP session active. The result - my script hung around all night thinking there was an active upload from a remote client.
My server is behind a firewall, so remote clients all show an internal (NAT) address, so I can't differentiate by source IP address.
I can't install LSOF or FUSER for security reasons.
Is there a way I can test for active FTP sessions from specific users?
I am running Red Hat Enterprise Linux Server release 5.2 (Tikanga).
Thanks for reading!
DZ