Difference between revisions of "Post login commands"

From FileZilla Wiki
Jump to navigationJump to search
m
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
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 [http://tools.ietf.org/search/rfc3659 RFC 3659] instead.
 
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 [http://tools.ietf.org/search/rfc3659 RFC 3659] instead.
  
When the FTP server on such a legacy platform has its default set to use a filesystem unsupported by FileZilla, 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 FileZilla client can successfully connect and communicate with the FTP server. Manually entering these commands does not work as:
+
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
 
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 issued the initial handshaking commands and had failed to obtain a successful directory and file listing. As a result the FileZilla client disables the server navigation pane.
+
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 a modern and mainstream platform where this applies, is the IBM i operating system that is very popular with banks and other businesses due to its very secure and advanced object-based architecture. Because of its scalability and legendary reliably and stability, and because it can run for months and years with no or little supervision, many large companies have literally many thousands of these IBM i servers installed across head- and branch offices 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 also removes it from the daily limelight of 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 many as obscure and legacy, which in turn results in lack of proper support for the platform by uninformed Unix/Linux/Windows-centric software developers. For example, FileZilla could very easily provide native support for this platform by simply adding IBM i to the Server Type drop down list on the Advanced tab of Site Manager, and by issuing the following two commands directly after log-on: SITE NAMEFMT 1 and SITE LISTFMT 1. It would make life a lot easier for thousands of frustrated IBM i end-users where changing the FTP server defaults is impractical because it will most certainly break some existing applications. In the meantime use the IBM i specific work around shown below:
 
  
'''Simple IBM i workaround: specify '/' (without the quotes) for default remote directory on the Site manager - advanced tab
+
There is a workaround using the post-login command feature of the site-manager. 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.
'''
 
  
Workaround:  Use the post-login command feature of the site-manager as follows:
+
Example:
- 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" ?>
 
  <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
Line 24: Line 17:
 
             <Port>21</Port>
 
             <Port>21</Port>
 
             <PostLoginCommands>
 
             <PostLoginCommands>
               <Command>VALID FTP COMMAND 1</Command>
+
               <Command>PWD</Command>
               <Command>VALID FTP COMMAND n</Command>
+
               <Command>QUIT</Command>
 
             </PostLoginCommands>
 
             </PostLoginCommands>
 
         </Server>
 
         </Server>
Line 31: Line 24:
 
  </FileZilla3>
 
  </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
+
If connecting using this site-manager entry, these commands get executed in the transfer connections as well.

Latest revision as of 16:54, 23 October 2017

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.


There is a workaround using the post-login command feature of the site-manager. 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.

Example:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<FileZilla3>
    <Servers>
        <Server>
            <Host>127.0.0.1</Host>
            <Port>21</Port>
            <PostLoginCommands>
              <Command>PWD</Command>
              <Command>QUIT</Command>
            </PostLoginCommands>
        </Server>
    </Servers>
</FileZilla3>


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