Bauer, Bobby (NIH/CIT) [E] writes:
> That's interesting, it is prompting for the password!?
> 
> ftp -inv $HOST << EOF
>  user $USER
>  PASS $PASS

Many of the user-visible commands to ftp clients are the same as
or similar to the underlying ftp protocol commands that the ftp
client sends over the network to the server. That sometimes makes
it easy to conflate the two concepts and can cause confusion with
what's actually going on.

In the ftp protocol itself, the client program sends a "user ..."
followed by a "pass ..." to the server to complete the logon process.
However, the ftp client program gets the information from the end
user differently. In your case, you're using the -i option (or else
it would prompt interactively for the username) and you're using the
-n option so it's not auto-logging in with username/password from the
~/.netrc file. (You might wish to consider holding the password there
instead of stashing it in the script).

So the program starts up and you use the end-user
"user username [password]" command. The program uses the "username"
component and sends a "user username" protocol command. However, it
then needs the password to send. To get it, it either takes it from
the second argument of your "user" command or, if not there, prompts
you on the terminal for it (bypassing stdin). Although the ftp client
program then sends a "pass ..." protocol command to the server, it's
not an end-user command which can be used.

So, to return to your original try:

> HOST=nih
> USER=me
> PASS=password
> ftp -inv $HOST << EOF
> user $USER $PASS
[...]
> Remote system type is MVS.
> (username) 331 Send password please.
> 530 new passwords are not the same
> Login failed.
> 
> I know the password is correct. I don't know what it is doing/complaining 
> about when it says the new password is not the same. Anybody know how to do 
> this?

I look up the "530 new passwords are not the same" error from
the z/OS Communications Server IP and SNA Codes manual and find:

    530 new passwords are not the same
    Explanation:

    The PASS command was issued using the format
    old_password/new_password/new_password to change the password of
    the user ID, but the second “new password” was not identical to
    the first “new password”. Both “new passwords” must be the same.

So I wonder if there may have been a slash character in your
password? Then the z/OS ftp server interprets a slash as
an implicit logon-and-change-password request which is failing.
I'm mildly surprised it would have decided to check the equality
of the two new passwords (and return the error) before verifying
that the actual password (to the left of the first slash) was valid.

--Malcolm

-- 
Malcolm Beattie
Mainframe Systems and Software Business, Europe
IBM UK

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/

Reply via email to