Password authentication normally requires user interaction. For situations where user interaction is not possible, for example when running Tectia client programs from JCL, you can have the password stored in a file or data set.
With sshg3, scpg3, and sftpg3, use the
FILE option to provide the password. With ssh-keydist-g3, use the
FILE option to provide the password.
When storing a password in a file or data set, make sure that the access permissions are correct.
For non-interactive batch jobs, we recommend that you use public-key authentication without a passphrase, or host-based authentication. These methods provide more security than a password stored in a file.
To set up authentication with a password stored in a file:
Create a file, for example
The file must be readable to the user that created it only:
$ chmod 600 /home/userid/passwd_file
Edit the file with your favorite text editor to contain one line with your password on the remote system, for example:
To use the password stored in a file, for example with sftpg3, run the following:
$ sftpg3 --password=file:///home/userid/passwd_file
To set up authentication with password stored in a data set:
Allocate a data set or a data set member, for example:
Make sure that the data set is accessible only by the correct user ID.
Edit the password data set to contain your password on the remote system. The format of the password data set is one line containing only the password. For example:
To use the password stored in a data set, for example with sftpg3, run the following:
$ sftpg3 --password=file://"//'USERID.PASSWD'"