limit FTP time for user using firewall

Hello,
it it posiable to make a firewall rule (or something) that say that when a ftp user connect 5 min he will be remove?
max connection will be 5 min?
Thanks ,