I have several ID's that share the same UID. Some times the wrong ID gets used and the default home directory does not contain a RSA key. Is there a way to pass which or where to look for the RSA key within STDIN. Here is a sample of STDIN:
remoteuser="ossbissh"
server="xsabcl01.abccorp.com"
cozsftp $ssh_opts -vvv -b- $remoteuser@$server <<EOB
lzopts mode=text
lpwd
pwd
EOB
There is a warning that if multiple ID's share the same UID that it won't necessary use "your" .ssh directory for keys.
Any help would be appreciated.
Thank You
RACF OMVS segment duplicate
Re: RACF OMVS segment duplicate
Co:Z SFTP uses IBM Ported Tools OpenSSH for its ssh connection.
The problem that you are seeing is because Ported Tools ssh looks up the home directory via UID number.
(in Co:Z SFTP, we are more careful in how we look up the home directory).
Keys, specifically the default "~/.ssh/id_rsa" key file is looked up by Ported Tools ssh, and it gets confused if you share UID numbers.
(IMO, sharing UID numbers is not best practice).
two suggestions:
1) use the -oIdentityFile= ssh option to point to a specify key. Since the z/OS Unix shell knows $HOME as the right directory, you could do this:
ssh_opts="$ssh_opts -oIdentityFile=~/.ssh/id_rsa"
2) even better, put your RSA key in a RACF key ring:
ssh_opts="$ssh_opts -k *:MYLABEL"
We recently did a two-part webinar on using keys with IBM Ported Tools OpenSSH,
see: http://dovetail.com/webinars.html for slides and recordings.
The problem that you are seeing is because Ported Tools ssh looks up the home directory via UID number.
(in Co:Z SFTP, we are more careful in how we look up the home directory).
Keys, specifically the default "~/.ssh/id_rsa" key file is looked up by Ported Tools ssh, and it gets confused if you share UID numbers.
(IMO, sharing UID numbers is not best practice).
two suggestions:
1) use the -oIdentityFile= ssh option to point to a specify key. Since the z/OS Unix shell knows $HOME as the right directory, you could do this:
ssh_opts="$ssh_opts -oIdentityFile=~/.ssh/id_rsa"
2) even better, put your RSA key in a RACF key ring:
ssh_opts="$ssh_opts -k *:MYLABEL"
We recently did a two-part webinar on using keys with IBM Ported Tools OpenSSH,
see: http://dovetail.com/webinars.html for slides and recordings.