Hi,
I am working on an assignment to replace our current FTP connections with the new sFTP connections. A new user SFTPUSER is setup/configured on our 'IBM i' (V6R1) to access new sFTP site. I am able to login on green screen using SFTPUSER and get/put files from/to the sFTP site but when I am trying to do that using my profile DEVUSER, it says permission denied. (The length of teh actual user names are <= 8 characters)
My admin suggested me to use the batch mode and submit my CL (with below commands) under SFTPUSER after logging in with profile DEVUSER. It worked! PS - These commands are based on Scott Klement's guide.
DCL VAR(&USER) TYPE(*CHAR) LEN(10) +
VALUE('SFTPUSER')
DCL VAR(&HOST) TYPE(*CHAR) LEN(100) +
VALUE('HOST')
DCL VAR(&CMD) TYPE(*CHAR) LEN(500)
ADDENVVAR ENVVAR(SFTP_USER) VALUE(&USER) REPLACE(*YES)
ADDENVVAR ENVVAR(SFTP_HOST) VALUE(&HOST) REPLACE(*YES)
CHGVAR VAR(&CMD) VALUE('PATH=$PATH:/QOpenSys/usr/bin && +
sftp -b /home/sftpuser/sftpuser.sftp $SFTP_USER@$SFTP_HOST')
ADDENVVAR ENVVAR(QIBM_QSH_CMD_OUTPUT) +
VALUE('FILE=/tmp/sftplog.txt') +
QSH CMD(&CMD)
MONMSG MSGID(QSH0000) EXEC(DO)
SNDMSG MSG('File transfer failed! See /tmp/sftplog.txt') +
TOUSR(DEVUSER)
sftpuser.sftp scripts
************Beginning of data**************
cd /inbox
ls *.csv
************End of Data********************
The above method is run in batch to execute the scripts. I want to know a way to run these scripts (and some more of them) one by one Interactively under any user including SFTPUSER.
Is it doable? I tried many things but not able to come right with it. It's really urgent. Please help.
Thanks
I am working on an assignment to replace our current FTP connections with the new sFTP connections. A new user SFTPUSER is setup/configured on our 'IBM i' (V6R1) to access new sFTP site. I am able to login on green screen using SFTPUSER and get/put files from/to the sFTP site but when I am trying to do that using my profile DEVUSER, it says permission denied. (The length of teh actual user names are <= 8 characters)
My admin suggested me to use the batch mode and submit my CL (with below commands) under SFTPUSER after logging in with profile DEVUSER. It worked! PS - These commands are based on Scott Klement's guide.
DCL VAR(&USER) TYPE(*CHAR) LEN(10) +
VALUE('SFTPUSER')
DCL VAR(&HOST) TYPE(*CHAR) LEN(100) +
VALUE('HOST')
DCL VAR(&CMD) TYPE(*CHAR) LEN(500)
ADDENVVAR ENVVAR(SFTP_USER) VALUE(&USER) REPLACE(*YES)
ADDENVVAR ENVVAR(SFTP_HOST) VALUE(&HOST) REPLACE(*YES)
CHGVAR VAR(&CMD) VALUE('PATH=$PATH:/QOpenSys/usr/bin && +
sftp -b /home/sftpuser/sftpuser.sftp $SFTP_USER@$SFTP_HOST')
ADDENVVAR ENVVAR(QIBM_QSH_CMD_OUTPUT) +
VALUE('FILE=/tmp/sftplog.txt') +
QSH CMD(&CMD)
MONMSG MSGID(QSH0000) EXEC(DO)
SNDMSG MSG('File transfer failed! See /tmp/sftplog.txt') +
TOUSR(DEVUSER)
sftpuser.sftp scripts
************Beginning of data**************
cd /inbox
ls *.csv
************End of Data********************
The above method is run in batch to execute the scripts. I want to know a way to run these scripts (and some more of them) one by one Interactively under any user including SFTPUSER.
Is it doable? I tried many things but not able to come right with it. It's really urgent. Please help.
Thanks
Comment