× 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.



Thanks to all who responded.
After reading Scotts' reply, I think I may have stated my problem using the
wrong terms.

I have a customer that needs to transmit files using SFTP to their vendor
on a periodic basis. Each transmission will have the same file name but
different member names.
In the past, they used normal FTP and I just built a script file using the
file name on the PUT command specifying the
/QSYS.LIB/file_name.FILE/member_name.MBR format.

I now need to do this same thing using SFTP.
Given that I know next to nothing about setting up or using SFTP, what to I
need to do to configure the IBM i to communicate with the server and can I
use this same name format in the SFTP command to send the data?
If I create a flat file on the i and then use either the CPYTOIMPF or
CPYTOSTMF commands to place the file on the IFS, are there any special
parms that I need?
I know that I can use the Unix API's to create the file directly, but I
need to code this so that someone who is not familiar with using API's can
maintain it.
The data is plain text with a | character separating fields.

Thanks,

On Thu, Jan 19, 2012 at 12:41 AM, Scott Klement <midrange-l@xxxxxxxxxxxxxxxx
wrote:

Hello,

On 1/18/2012 3:23 PM, Jeff Young wrote:
1. When I get the public key from the server, what do I do to install it?

This sounds backward to me. Typically, the client generates the
public/private key, and the public key gets installed on the server.

If you want the server to generate the key, that's fine (if
unconventional), but then you'll need to install the *private* key on
the client system, not the public one.


2. I will be sending multiple files to the server and would like to
automate the process. What is the best way to do this?

Secure Copy (scp) is the easiest way, as long as all you're doing is
sending (and not needing to do things like delete, rename, etc). If you
need the additional functionality, use sftp with the -b (batch) switch.
There are examples of both in the presentation and articles that I've
written.


3. The member name of the files being sent will vary with each
transmission. How can I do this in an automated envrionment?

You can use wildcards, or you can generate the sftp/scp commands
on-the-fly by writing the script from a program.


4. Does it matter what user profile runs the job?

Errr.. tricky question. By default, keys are located in the user's
home directory. So, if another user runs the same automated transfer,
the keys wouldn't be found.

However, you can specify an alternate key location on the scp/sftp
command line. Or, you can simply install the keys in multiple user's
home directories.

So technically, it doesn't matter which user runs the job. But, you
might run into problems if you didn't design your automated job with
"cross-user-ness" in mind.


5. What OS Level security restrictions are there on using the required
commands?

The only restrictions I'm aware of are in the authorities to the key
files (which is something you control.) SSH will complain if you try to
use a key that can be read or modified by *PUBLIC, considering that to
be a security hole.

6. If the client has a firewall that restricts outbound transmissions to
known ports, what ports need to be opened for SFTP?

All SSH applications (including 'ssh', 'sshd', 'scp' and 'sftp') use
port 22, unless you specifically override it to something else.
--
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: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.





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.