Showing posts with label ssh. Show all posts
Showing posts with label ssh. Show all posts

Thursday, August 06, 2026

Running Remote SSH Commands from IBM I CL and RPG over SSH

If you've ever wanted to run a process on another system from an IBM i CL or RPG program and wait until it completes, then I have the perfect CL command for you. QSHSSH is a lightweight wrapper over the open source PASE based ssh command. When running remote SSH commands you can call remote QShell and PASE scripts and commands, CL commands and program calls. And even SQL utilities like sql and db2util.

QSHSSH lets you log into a remote IBM i or any system (Windows, Linux, AIX, etc) running SSH using a private SSH key or user ID and password credentials if desired. Once connected to the remote system your selected command line sequence will execute and return once the entire sequence has completed. Information is returned to the calling RPG or CL program by utilizing the STDOUTQSH outfile or writing STDOUT messages to the job log, a spool file or IFS based log file to log the call and see what just ran. 

And if your commands happen to fail on the remote system, QSHSSH will let you know via an escape message that you can monitor for in your CL and RPG programs.

QSHSSH is part of the popular QShell on i open source utilities for IBM i.

Bring secure, scriptable, and dependable SSH remote command automation to IBM i with QSHSSH.

https://www.github.com/richardschoen/qshoni






Tuesday, August 04, 2026

Bring the power of lftp and SFTP to your IBM i with QSHLFTP

 

Secure file transfers are a routine part of modern business—but they should not always require complicated scripts or external servers.

QSHLFTP brings the power and flexibility of SFTP directly to IBM i. Built around the proven lftp utility and QShell on i , it makes it easy to securely upload and download files from CL programs, job schedulers, and automated workflows.

With QSHLFTP, you can:

  • Transfer files securely using SFTP

  • Authenticate with a username/password or SSH key

  • Prevent accidental replacement of existing files

  • Automate transfers from CL programs and batch jobs

  • Integrate IBM i applications with customers, vendors, and cloud services

QSHLFTP provides a straightforward way to add secure file transfer capabilities without moving the workload off your IBM i. And it's part of the popular QShell on i open source utilities for IBM i.

Bring secure, scriptable, and dependable SFTP automation to IBM i with QSHLFTP.

https://www.github.com/richardschoen/qshoni



Tuesday, December 30, 2025

Moving IFS Files Between IBM i and Linux Systems Just Got Easier with QSHSCP

If you’re anything like me, you’re always looking for efficient ways to move files and objects between systems. Over the holidays, I needed a fast, reliable way to transfer files between two IBM i systems and a Linux system using SSH. Since scp is already part of the IBM i open-source SSH tooling, it felt like the perfect foundation for a simple utility command. That’s what led me to create the QSHSCP command and share it with others who utilize my QShell on i app. 

The QSHSCP command is essentially a thin CL wrapper around the PASE scp command. It allows you to securely send and receive files over SSH connections without having to drop into a shell session. While my usual go-to tool is SFTP, I found SCP to be surprisingly efficient once I started working with it.

With QSHSCP, I can easily send IFS files between IBM i systems, as well as to and from Windows, Linux, or AIX systems—such as a cloud-based backup server or an IBM Power Cloud environment.

One intentional design choice—whether you see it as a limitation or a strength—is that QSHSCP only supports SSH key-based authentication. By relying exclusively on public/private key pairs, there’s no need to exchange or store passwords between systems, which improves both security and automation.

Below is an example of using the QSHSCP command to send a file from a local IBM i system to a remote IBM i or Linux system for backup purposes or to deploy new objects:

QSHONI/QSHSCP CMDPFXPARM('-v')                                    
      KEYFILE('/home/user1/.ssh/id_rsa.ppk')     
      USER(user1)                                     
      HOST(myhost.com)                       
      PORT(22)                                       
      ACTION(*SEND)                                  
      REPLLOCAL(*NO)                                    
      LOCALFILE('/home/user1/mylib.savf')          
      REMOTEFILE('/home/user1/mylib.savf')         
      DEBUGCMD(*NO)                                    
      DSPSTDOUT(*NO)                                   
      PRTSTDOUT(*NO)        

QSHSCP also serves as a solid starting point for building additional SCP-based utility commands on IBM i. As part of my upcoming MobiConnect product, I’ll be adding extended object management capabilities—allowing you to directly save and restore IBM i libraries, objects, and IFS files over scp. In additional to object management utilities MobiConnect will make it easier to integrate IBM i with open-source applications and web services from traditional CL and RPG programs.

For more details on the FREE QSHSCP command, visit: the QSHSCP command URL

To learn more about MobiConnect and connecting all your systems and applications, visit: https://www.mobigogo.net
Email: info@mobigogo.net or richard@mobigogo.net