Does anyone know if it is possible to submit a remote command on an iSeries server using SSH (sftp) using a different user than what is configured for SSH?
For example, if I wanted to make a change to a user profile, I would run this command:
CHGUSRPRF USRPRF(USERPROFILE) LMTCPB(*YES)
If I wanted to run that command as another user (called SUPERUSER) - I would run:
SBMJOB CMD(CHGUSRPRF USRPRF(USERPROFILE) LMTCPB(*YES)) JOB(SFTPCMD) USER(SUPERUSER)
Wondering if there is a way to submit the above command (using the SUPERUSER user profile) via SSH (with the cavaet that the SUPERUSER user profile is not the user configured for SFTP. The following code "should" work - but when it does it tells me I don't have access to the CHGUSRPRF command (which the SFTPUSER doesn't - but the SUPERUSER does)
SBMJOB CMD(QSH CMD('ssh -T sftpuser@servername ''system "SBMJOB CMD(CHGUSRPRF USRPRF(USERPROFILE) LMTCPB(*YES)) JOB(SFTPCMD) USER(SUPERUSER)" ''')) JOB(SFTPJOB) USER(SFTPUSER)
Hopefully that makes sense
I was just hoping to get around having to configure SFTP for the SUPERUSER if I didn't have to...
Any help would be appreciated.