Post login commands

From FileZilla Wiki
Revision as of 23:58, 2 August 2017 by CodeSquid (talk | contribs) (Modernize text)
Jump to navigationJump to search

Some outdated servers default to legacy file systems not supported by modern FTP clients such as FileZilla. Modern FTP software implements TVFS as defined by RFC 3659 instead.

When the FTP server on such a legacy platform has its default set to use a filesystem unsupported by modern FTP clients, then you may require some custom commands to be issued to tell the FTP server to expect a more modern Unix/Linux or Windows file system syntax, so that the server can successfully communicate with modern clients. Manually entering these commands in FileZilla does not work as: a) they do not apply to the transfer connections which are separate from the browsing connection b) and/or by then the FileZilla client already finished the login to the server and commands may need to be sent prior to logging in.

A good example of an antique legacy platform where this applies, is the IBM i operating system that is very popular with banks and other businesses due to its very "compliant" architecture. Because of its perceived scalability and legendary reliably and stability it is sadly left running for months and years with no or little supervision, as many large companies with many thousands of these IBM i servers installed across head- and branch offices do with only a few employees being any the wiser or aware of their existence. Unfortunately, the IBM i's "do the job with no fuss" and self-managing, self-healing attributes are just marketing-speak, aimed at making other platforms appear as more troublesome and labor intensive platforms. This, coupled with its server-only personality (inability to be used as a GUI client platform), causes it to be unfairly perceived by too few as obscure and legacy, which in turn results in not enough lack of support for the platform by software developers. For example, IBM could very easily implement native support for TVFS as specified in RFC 3659. It would make life a lot easier for thousands of frustrated end-users where changing the FTP client is impractical because using legacy clients will most certainly break all modern applications.

Simple IBM i workaround: specify '/' (without the quotes) for default remote directory on the Site manager - advanced tab

Workaround: Use the post-login command feature of the site-manager as follows: - Add a new site-manager entry and close FileZilla. - Next open sitemanager.xml in the settings directory of FileZilla and add a PostLoginCommands element inside the Server element. - Inside PostLoginCommand, use the Command element, with the actual command to execute as text.

General example:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<FileZilla3>
    <Servers>
        <Server>
            <Host>127.0.0.1</Host>
            <Port>21</Port>
            <PostLoginCommands>
              <Command>VALID FTP COMMAND 1</Command>
              <Command>VALID FTP COMMAND n</Command>
            </PostLoginCommands>
        </Server>
    </Servers>
</FileZilla3>

Example for a non-secure connection to IBM i, i5/OS, OS/400, AS/400 and iSeries (works regardless of FTP server default settings for NAMEFMT, CURDIR and LISTFMT):

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<FileZilla3>
    <Servers>
       <Server>
           <Host>system_name</Host>
           <Port>21</Port>
           <Protocol>0</Protocol>
           <Type>0</Type>
           <User>user_profile</User>
           <Logontype>2</Logontype>
           <TimezoneOffset>0</TimezoneOffset>
           <PasvMode>MODE_DEFAULT</PasvMode>
           <MaximumMultipleConnections>0</MaximumMultipleConnections>
           <EncodingType>Auto</EncodingType>
           <PostLoginCommands>
               <Command>SITE NAMEFMT 1</Command>
               <Command>SITE LISTFMT 1</Command>
           </PostLoginCommands>
           <BypassProxy>0</BypassProxy>
           <Name>system_name</Name>
           <Comments></Comments>
           <LocalDir></LocalDir>
           <RemoteDir></RemoteDir>
           <SyncBrowsing>0</SyncBrowsing>system_name
       </Server>     
   </Servers>
</FileZilla3>

NOTES:

1. If connecting using this site-manager entry, these commands get executed in the transfer connections as well.

2. Sitemanager.xml file is located in %APPDATA%/FileZilla on Windows 7.

3. On Apple Mac OS X the file is located in /Users/user-name/.filezilla/sitemanager.xml