× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Check the authorities on those directories, AND the PARENT directories. The
fact that it can not see the existing directory points straight to
authorities.

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Jay
Vaughn
Sent: Monday, April 16, 2018 8:07 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: Re: ssh configuration for sftp execution

ok, i seemed to have gotten the log straightened out... and this is what it
shows...

exec: 02222: A file or directory in the path name does not exist.
Connection closed


the ifs script batch file only contains...

lcd /LSAMS/SFTP/EXPORT
cd /put/lsams/sftp/export
put pritstftp.TXT

all of these paths/filenames on local and remote DO exist....??? what am i
missing?



On Mon, Apr 16, 2018 at 8:43 AM, Jay Vaughn <jeffersonvaughn@xxxxxxxxx>
wrote:

Jim,

thank you - big help... i've modeled my code after your's now... when
I run it, the joblog shows...

4800 - QSH CMD('echo "-pgm:FTP1001------------------------"; date;
echo
"-------------------------";') Command ended normally with exit status 0.
5603 - ADDENVVAR ENVVAR(SFTP_USER) VALUE('omegasonics-scotty')
REPLACE(*YES)
Environment variable added.
5604 - ADDENVVAR ENVVAR(SFTP_HOST) VALUE('104.197.192.61')
REPLACE(*YES) Environment variable added.
5610 - QSH CMD('PATH=$PATH:/QOpenSys/usr/bin/ && sftp -vvv -P02222 -b
/tmp/sftpBatchFile.TXT $SFTP_USER@$SFTP_HOST') Command ended
normally with exit status 255.


So everything appears to be in place except the sftp execution itself
as it is returning the exit status 255...

Also, my log is only producing the following...

-pgm:FTP1001------------------------ Mon Apr 16 08:36:08 Eastern
Daylight Time 2

Any idea whats going on? why no more details in the log?

Jay



On Sun, Apr 15, 2018 at 5:33 PM, midrange <franz9000@xxxxxxxxx> wrote:

Coy,

Not seeing any of the code or actual messages makes it hard to diagnose.
Also not sure if you are following a particular doc or set of
instructions.
This worked pretty well for me
http://ibmsystemsmag.com/ibmi/administrator/systemsmanagement/sftp-ti
ps/

One thing I do remember is the profile name used in the execution has
to be authorized to the various directories and files.
Also, just because it's in the log "no file or directory" doesn't
mean its not working- it's going through a list of possibilities and
many really don't exist - the log below is working code...
The -vvv on the sftp cmd makes the log "very verbose" - lots of details..
I worked out all my problems with that log, but it is many pages long
for a simple upload.
I did parameterize many of the variables so that can switch from test
to production easily.

I did set mine up to log to a file:
DCL VAR(&LOGF) TYPE(*CHAR) LEN(100) +
VALUE('/xyz/log/logxyz31.txt')

/* get parms from postal control for test or active */
CALL PGM(XYZ30) PARM(&test &user &host)
/* set log file - will build a new log file each execution */

RMVLNK OBJLNK(&LOGF)
MONMSG MSGID(CPF0000)
CHGVAR VAR(&ENVCO) VALUE('FILEAPPEND=' *TCAT &LOGF)

ADDENVVAR ENVVAR(QIBM_QSH_CMD_OUTPUT) VALUE(&ENVCO)
REPLACE(*YES)
/* write a comment in the log to note program and date and time */

QSH CMD('echo "-pgm:xyz31c---------------------"; +
date; +
echo "---------------------------------";')
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 -vvv -b +
/xyz/script/ls_receive.sftp +
$SFTP_USER@$SFTP_HOST')


From the log file

Sun Apr 15 16:45:00 Eastern Daylight Time 2018

---------------------------------

OpenSSH_6.9p1, OpenSSL 1.0.2n 7 Dec 2017

debug1: Reading configuration data
/QOpenSys/QIBM/ProdData/SC1/OpenSSH/openssh-4.7p1/etc/ssh_config
debug2: ssh_connect: needpriv 0

debug1: Connecting to x.x.x.x [x.x.x.x] port 22.

debug1: Connection established.

debug1: identity file /home/XXXXXXXXX/.ssh/id_rsa type 1

debug1: key_load_public: No such file or directory several pages more

hth
Jim

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf
Of Jay Vaughn
Sent: Sunday, April 15, 2018 4:39 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: Re: ssh configuration for sftp execution

Thank you. Still something I'm missing even after using the -P2222.
Says file or directory in path does not exist. Not sure what it's
talking about.
But the local and remote paths do exist.

Sent from my iPhone

On Apr 13, 2018, at 3:56 PM, Krill, Coy <CKrill@xxxxxxxxxxx> wrote:

Add
-P 2222
to your command line for the port

Our network folks have us so locked down, I can't even test sftp
from
our
power systems.

Coy Krill
Core Processing Administrator/Analyst Washington Trust Bank

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf
Of Jay Vaughn
Sent: 2018 April 13 11:43
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: ssh configuration for sftp execution
Importance: Low

So we are attempting to setup invoking sftp on our iSeries.

Ultimately, I know I'll call the sftp pgm similiar to the following...

Call Pgm(QP2SHELL) Parm('/QOpenSys/usr/bin/sftp' '-b'
'/TMP/sftpBatchFile.TXT' 'Omegasonics-scotty@xxxxxxxxxxxxxx')


However, if I call it now, I get a "connection timeout"... I do know
that
I also need to connect to the host using port 2222 also, but not
sure
how
to specify that.


Has anyone recently jumped through these hoops and able to guide me
on what I need to do to configure this. Yes, there is pretty good
info out there that I began studying (especially by Klement), but
was hoping to get a short-cut so to speak to the nitty gritty. :)


Jay
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please
take a
moment to review the archives at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: http://amzn.to/2dEadiD


-------------------------------------------------------------------
-- This electronic mail message and any attachments may contain
confidential or privileged information and is intended for use
solely by the above-referenced recipient. Any review, copying,
printing, disclosure, distribution, or other use by any other
person or entity is strictly prohibited under applicable law. If
you are not the named recipient, or believe you have received this
message in error, please immediately notify the sender by replying
to this message and delete the copy you received

-------------------------------------------------------------------
--

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please
take a moment to review the archives at
https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: http://amzn.to/2dEadiD
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link:
http://amzn.to/2dEadiD

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: http://amzn.to/2dEadiD



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link:
http://amzn.to/2dEadiD


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.