# FTP Username

**URL:** <https://community.f5.com/t/ftp-username/30904>\
**Category:** Technical Forums\
**Tags:** dev, irules, devops, application-delivery\
**Created:** [January 5, 2007, 6:04pm UTC](https://community.f5.com/t/ftp-username/30904 "2007-01-05T18:04:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Woods\_5](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@Michael\_Woods\_5](https://community.f5.com/u/Michael_Woods_5)\
**Post date:** [January 5, 2007, 6:04pm UTC](https://community.f5.com/t/ftp-username/30904/1 "2007-01-05T18:04:06Z")

</div>

Is there anything similar to HTTP::username for FTP? I’d like to be able to create an iRule that will read in the username entered during authentication and do whatever I want with it afterwards.

Thanks!

---

<div class="post-metadata">

**Author:** ![Deb\_Allen\_18](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@Deb\_Allen\_18](https://community.f5.com/u/Deb_Allen_18)\
**Post date:** [January 5, 2007, 6:49pm UTC](https://community.f5.com/t/ftp-username/30904/2 "2007-01-05T18:49:14Z")

</div>

You can use TCP::collect to capture the connection details, then look for the USER request command in TCP::payload & save the argument off to a variable:

when CLIENT\_ACCEPTED {

TCP::collect

}

when CLIENT\_DATA {

if {[TCP::payload] starts\_with “USER” }{

set user [getfield [TCP::payload] " " 2]

log local0. $user

}

TCP::release

}

---

<div class="post-metadata">

**Author:** ![Michael\_Woods\_5](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@Michael\_Woods\_5](https://community.f5.com/u/Michael_Woods_5)\
**Post date:** [January 5, 2007, 9:29pm UTC](https://community.f5.com/t/ftp-username/30904/3 "2007-01-05T21:29:04Z")

</div>

Thank you…I’ll give it a try!

-mike

---

<div class="post-metadata">

**Author:** ![Greg\_Phillips\_3](https://avatars.discourse-cdn.com/v4/letter/g/b19c9b/32.png) [@Greg\_Phillips\_3](https://community.f5.com/u/Greg_Phillips_3)\
**Post date:** [January 26, 2007, 1:41am UTC](https://community.f5.com/t/ftp-username/30904/4 "2007-01-26T01:41:42Z")

</div>

Just tried this and for some reason “CLIENT\_ACCEPTED” causes a hang where the client waits on the login prompt until timing out… Did this work on your system?

Thanks,

Greg
