FTP issue with password

55 pts.
Tags:
FTP
iSeries
I have to sign on an FTP server via a batch process. The FTP server has a password with a special character within it. The FTP log shows the following text after the password > xxx*** Subcommand 'xxx' not valid. (above xxx represents the first portion of the text of the password, the first * is where the special character is, and the last two of the characters display as asterisk also) In the TXT source member, I tried enclosing the special character with a single quote, by two single quotes, by double quotes, none of which worked. I tried changing the special character to its hex value with a % symbol before the hex value. I've tried putting the user:password in the RMTSYS parm within the CL FTP command. That did not work. Does anyone know of a method of signing onto an FTP server from an iSeries when the FTP server requires a password which has a special character within it? I asked the company if they could change the password for us, but they said they use the same password for all their customers. I don't know if they are FTPing from systems other than an iSeries though. I have to sign on an FTP server via a batch process. The FTP server has a password with a special character within it. The FTP log shows the following text after the password: > xxx*** Subcommand 'xxx' not valid. (xxx represents the first portion of the text of the password, the first * is where the special character is, and the last two of the characters display as asterisk also) In the TXT source member, I tried enclosing the special character with a single quote, by two single quotes, by double quotes, none of which worked. I tried changing the special character to its hex value with a % symbol before the hex value. I've tried putting the user:password in the RMTSYS parm within the CL FTP command. That did not work. Does anyone know of a method of signing onto an FTP server from an iSeries when the FTP server requires a password which has a special character within it? I asked the company if they could change the password for us, but they said they use the same password for all their customers. I don't know if they are FTPing from systems other than an iSeries though.
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

It’s a closing parenthesis “)”. Details from FTP Log regarding user and password below.  I’ve tried it with pass and without.  Currently have the TXT script coded with the user on first line and pass password on second line.

0010.00 Enter login ID (import):
0011.00 331 User        OK. Password required
0012.00 UNIX Type: L8
0013.00 Enter an FTP subcommand.
0014.00 > pass ******
0015.00 Number of arguments not valid for subcommand pass.
0016.00 Enter an FTP subcommand.
0017.00 > status
0018.00 530 You aren’t logged in
0019.00 Enter an FTP subcommand.

             

                

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TheRealRaven
    What is the "special character"?

    Technically, RFC 959 says that passwords can consist of any of the 128 7-bit ASCII characters other than <CR> and <LF>. It might be a problem with EBCDIC<>ASCII conversion or other problem, depending on the character.
    33,690 pointsBadges:
    report
  • TheRealRaven
    Try this form for the user/password line:
    userID "passwd)"
    Instead of separate USER and PASS lines in the script, try a single combined line.

    Also, you said you tried quotes. Was that done like this?
    USER  userID
    PASS  "passwd)"
    I've had some success sending passwords with a trailing parenthesis character, so it's not clear exactly what you've tried. The FTP client seems fairly forgiving in what forms are allowed. Seeing actual failing script examples could help. (Modify USER/PASS values as needed.)
    33,690 pointsBadges:
    report
  • Chrisvj

    I did not see a way to attach a document.  So below I have pasted a copy of each of the tests I did.  The FTP script is displayed first, then the ftp log from each of the various attempts.  The parentheses is in the middle of the password.  I've tried everything I can think of.  Can you think of anything else I should try.       


    TSTCVJ/QTXTSRC


           XXXSEND


            *************** Beginning of data *****


    0001.00 xxx)xx                              


    0002.00 status                                


    0003.00 locstat                               


    0004.00 lcd qs36f                             


    0005.00 put xxx_out    217026.csv             


    0006.00 quit                                  


            ****************** End of data ********


     


     


    TSTCVJ/QTXTSRC


         XXXFTPLOG


    0001.00 Output redirected to a file.                                                   


    0002.00 Input read from specified override file.                                      


    0003.00 Number of arguments not valid for subcommand CONNECT.                         


    0004.00 Enter an FTP subcommand.                                                       


    0005.00 > xxx***                                                                      


    0006.00 Subcommand 'xxx' not valid.                                                   


    0007.00 For a list of available FTP subcommands, enter subcommand HELP.               


    0008.00 Enter an FTP subcommand.                                                      


    0009.00 > status                                                                      


    0010.00 You must first open a connection.                                              


    0011.00 Enter an FTP subcommand.                                                      


    0012.00 > locstat                                                                     


    0013.00 Not connected to an FTP server.                                                


    0014.00 Local port is 0.                                                              


    -----------------------------------------------------------------------------------------------------------------------                                                            


     


    TSTCVJ/QTXTSRC


           XXXSEND


     


            *************** Beginning of data *******************


    0001.00 xxx')'xx                                            


    0002.00 status                                              


    0003.00 locstat                                             


    0004.00 lcd qs36f                                           


    0005.00 put xxx_out    217026.csv                           


    0006.00 quit                                                


            ****************** End of data **********************


     


     


    TSTCVJ/QTXTSRC


         XXXFTPLOG


    0001.00 Output redirected to a file.                                         


    0002.00 Input read from specified override file.                             


    0003.00 Number of arguments not valid for subcommand CONNECT.                


    0004.00 Enter an FTP subcommand.                                             


    0005.00 > xxx'****                                                           


    0006.00 Subcommand 'xxx'' not valid.                                         


    0007.00 For a list of available FTP subcommands, enter subcommand HELP.      


    0008.00 Enter an FTP subcommand.                                             


    0009.00 > status                                                             


    0010.00 You must first open a connection.                                     


    -----------------------------------------------------------------------------------------------------------------------                                                            


     


    TSTCVJ/QTXTSRC


           XXXSEND


            *************** Beginning of data *************


    0001.00 xxx)xx                                        


    0002.00 status                                        


    0003.00 locstat                                        


    0004.00 lcd qs36f                                     


    0005.00 put xxx_out    217026.csv                     


    0006.00 quit                                          


            ****************** End of data ****************


     


     


    TSTCVJ/QTXTSRC


         XXXFTPLOG


    0001.00 Output redirected to a file.                                                       


    0002.00 Input read from specified override file.                                           


    0003.00 Connecting to host                  at address               using port 21.


    0004.00 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------                      


    0005.00 220-You are user number 1 of 50 allowed.                                           


    0006.00 220-Local time is now 13:01. Server port: 21.                                      


    0007.00 220-This is a private system - No anonymous login                                  


    0008.00 220-IPv6 connections are also welcome on this server.                              


    0009.00 220 You will be disconnected after 15 minutes of inactivity.                       


    0010.00 Enter login ID (xxxxxx):                                                           


    0011.00 Number of arguments for a prompted login to the server not correct.                


    0012.00 Enter an FTP subcommand.                                                           


    0013.00 > status                                                                           


    0014.00 530 You aren't logged in                                                            


    -----------------------------------------------------------------------------------------------------------------------                                                            


     


    TSTCVJ/QTXTSRC


           XXXSEND


            *************** Beginning of data *********


    0001.00 xxx')'xx                                  


    0002.00 status                                    


    0003.00 locstat                                   


    0004.00 lcd qs36f                                  


    0005.00 put xxx_out    217026.csv                 


    0006.00 quit                                      


            ****************** End of data ************


     


     


    TSTCVJ/QTXTSRC


         XXXFTPLOG


    0001.00 Output redirected to a file.                                                        


    0002.00 Input read from specified override file.                                           


    0003.00 Connecting to host                          at address            using port 21.


    0004.00 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------                      


    0005.00 220-You are user number 1 of 50 allowed.                                           


    0006.00 220-Local time is now 13:04. Server port: 21.                                      


    0007.00 220-This is a private system - No anonymous login                                  


    0008.00 220-IPv6 connections are also welcome on this server.                              


    0009.00 220 You will be disconnected after 15 minutes of inactivity.                        


    0010.00 Enter login ID (xxxxxx):                                                           


    0011.00 Cannot find closing ' delimiter for subcommand parameter.                          


    0012.00 Enter an FTP subcommand.                                                            


    0013.00 > status                                                                           


    0014.00 530 You aren't logged in                                                           


    -----------------------------------------------------------------------------------------------------------------------                                                            


     


    TSTCVJ/QTXTSRC


           XXXSEND


            *************** Beginning of data ****************


    0001.00 xxx")"xx                                          


    0002.00 status                                           


    0003.00 locstat                                          


    0004.00 lcd qs36f                                        


    0005.00 put xxx_out    217026.csv                         


    0006.00 quit                                             


            ****************** End of data *******************


     


     


    TSTCVJ/QTXTSRC


         XXXFTPLOG


    0001.00 Output redirected to a file.                                                       


    0002.00 Input read from specified override file.                                           


    0003.00 Connecting to host                       at address                using port 21.


    0004.00 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------                      


    0005.00 220-You are user number 1 of 50 allowed.                                           


    0006.00 220-Local time is now 13:07. Server port: 21.                                      


    0007.00 220-This is a private system - No anonymous login                                   


    0008.00 220-IPv6 connections are also welcome on this server.                              


    0009.00 220 You will be disconnected after 15 minutes of inactivity.                       


    0010.00 Enter login ID (xxxxxx):                                                            


    0011.00 Cannot find closing " delimiter for subcommand parameter.                          


    0012.00 Enter an FTP subcommand.                                                           


    0013.00 > status    &nb

    55 pointsBadges:
    report
  • Chrisvj
    Well, don't know why all the spacing appeared in my reply. It prevented all of my test examples from being shown. If you can provide an email address I would gladly send you my Word document of testing examples to get your advice. If not I understand though. Thank you, Chris
    55 pointsBadges:
    report
  • TheRealRaven
    A Word document wouldn't be a good choice a basic text document (Notepad) would be much better. You can click the {code} button and copy plain text into the {code} input box.

    However, none of your input script examples show anything like the forms that have been suggested. There are two forms that I've seen work successfully. The first form has a USER FTP command on the first line and a PASS command on the second line. The first two lines would be like this:
    USER  userID
    PASS  passwd
    It looks your user ID was "import", so the first line would actually be:
    USER  import
    You show a (fake) password as "xxx)xx", so normally the second line would be:
    PASS  xxx)xx
    However, the odd character in the password has special meaning to FTP, so it needs to be delimited in a way that FTP knows that the character should be ignored:
    PASS  "xxx)xx"
    The quotes don't go around just the single character. They should go around the entire password.

    The second possible form doesn't specify the USER and PASS commands. It simply has a single line that has the userID and password values:
    import  "xxx)xx"
    And again, quotes go around the entire password. So there are two alternative forms -- one starts with two lines and the other combines the userID and password on a single line.

    But maybe it's just that your script didn't display very well. It is difficult to get things to display nicely here sometimes.
    33,690 pointsBadges:
    report
  • Chrisvj
    I ended up having to FTP the file as a .csv to one of our servers, then RUNRMTCMD to execute a .bat file (utilizing a .txt file with the sign on, and put code) to FTP the .csv file from our server to their server.  Thank you for your assistance.  Chris 
    55 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: