Password authentication requires normally user interaction. For situations where user interaction is not possible, for example when running SSH Tectia client programs from JCL, you can set up the password in file or dataset.
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 dataset, 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 password-in-file authentication:
Create a file, for example
Make sure the file is readable only by the user that created it:
$ 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 in file, for example with sftpg3, run the following:
$ sftpg3 --password=file:///home/userid/passwd_file
To set up password-in-dataset authentication:
Allocate a dataset or a dataset member, for example:
Make sure that the dataset is accessible only by the correct UserID.
Edit the password dataset to contain your password on the remote system. The format of the password dataset is one line containing only the password. For example:
To use the password in dataset, for example with sftpg3, run the following:
$ sftpg3 --password=file:////'USERID.PASSWD'