Pro / connectivity

Reach the system with SSH, SFTP and FTPS.

Use an SSH client for Qshell and SFTP, or protect an FTP session with TLS. Hosted Pro plans assign the ports; the repository tools can also run a standalone listener.

Connect to a hosted Pro system

Open a system card and choose Connect. It lists the host and a copyable command for the browser terminal, a TN5250 client, SSH/SFTP and FTP, each with an Encrypted or Not encrypted badge. SSH and SFTP are always encrypted; FTP shows whether explicit FTPS is available or required.

Use the IBM i profile and its password, not your Learn400 account password. To add a public key, open Passwords and access on the system card, choose the profile and paste one OpenSSH public key per line into SSH keys, then select Replace SSH keys. An empty box removes the extra keys.

Each SSH connection can open one active shell, command or SFTP channel. SSH, TN5250, FTP and browser sessions share the account's connection allowance. Hosted SSH ports are assigned per system, normally from the 26000-26999 range configured by the hosting launcher.

Start a standalone SSH server

On a fresh store, set WEBI_SSH_PASSWORD in the launcher's environment to give QSECOFR an unexpired password. On an existing store, omit it to keep the saved profile password.

read -s 'WEBI_SSH_PASSWORD?Profile password: '
export WEBI_SSH_PASSWORD
node tools/ssh-server.mjs --store ./var/ssh --port 2222

Then sign on and run a Qshell command or open an interactive shell:

ssh -p 2222 QSECOFR@127.0.0.1
ssh -p 2222 QSECOFR@127.0.0.1 'pwd; liblist'

The second command prints the profile's current directory and library list and exits with the shell's status. Interactive sessions use the same Qshell as STRQSH: history, cursor editing, tab completion, background jobs and System Request interrupts. A PTY request carries the terminal type and dimensions, and window changes update COLUMNS and LINES.

To use a key instead of a password, generate one and point the launcher at its public half:

ssh-keygen -t ed25519 -f ~/.ssh/learn400
node tools/ssh-server.mjs --store ./var/ssh --port 2222 --authorized-keys ~/.ssh/learn400.pub
ssh -i ~/.ssh/learn400 -p 2222 QSECOFR@127.0.0.1

The server also reads .ssh/authorized_keys from the profile's home directory in the emulated IFS. The profile must own the file and the directories above it, with mode 0700 on .ssh and 0600 on the key file. Ed25519, RSA with SHA-256 or SHA-512, and ECDSA P-256 keys are accepted. Password sign-on uses the IBM i profile status, expiry and QMAXSIGN rules, and an expired password can be changed during the SSH password exchange.

Move files with SFTP

sftp -P 2222 QSECOFR@127.0.0.1
pwd
ls /tmp
put hello.txt /tmp/hello.txt
get /tmp/hello.txt hello-copy.txt
ls -l /tmp/hello.txt
rename /tmp/hello.txt /tmp/hello2.txt
rm /tmp/hello2.txt

SFTP v3 transfers ordinary IFS stream files under the signed-on profile's authority. It supports positional read and write, stat and lstat, directory lists, mkdir, rmdir, remove, rename, realpath, permission and timestamp changes, symbolic links, and overwrite-by-rename. Open stream files keep their identity through rename and unlink. Source members can be downloaded through the QSYS.LIB read path. A batch file passed with sftp -b file runs the same commands unattended.

Protect FTP with TLS

Explicit FTPS uses AUTH TLS on the normal FTP control port, following RFC 4217. Start the standalone server with a certificate and key; TLS 1.2 is the minimum version.

read -s 'WEBI_FTP_PASSWORD?FTP profile password: '
export WEBI_FTP_PASSWORD
node tools/ftp-server.mjs --store ./var/ftps --port 2121 \
  --tls-cert /path/to/cert.pem --tls-key /path/to/key.pem

The Connect panel's lftp command forces TLS for the data connection as well. curl needs --ssl-reqd for an explicit AUTH TLS session:

curl --ssl-reqd --cacert /path/to/cert.pem -u QSECOFR \
  --list-only ftp://localhost:2121/%2F/
curl --ssl-reqd --cacert /path/to/cert.pem -u QSECOFR \
  -T hello.txt ftp://localhost:2121/%2Ftmp%2Fhello.txt

Add --implicit-port 2990 for implicit FTPS, where TLS starts with the first byte. curl reaches it through the ftps:// scheme:

curl --cacert /path/to/cert.pem -u QSECOFR --list-only ftps://localhost:2990/%2F/

CHGFTPA ALWSSL controls the server policy and applies to each new connection. *YES allows both clear and TLS sessions, *NO refuses AUTH TLS and *ONLY refuses USER and PASS before AUTH so a password never crosses the network in clear. An operator can also start the server with --require-tls, which acts as *ONLY and forces PROT P on data connections.

CHGFTPA ALWSSL(*YES)
CHGFTPA ALWSSL(*ONLY)
CFGTCP

On a hosted system, FTP has explicit FTPS available when the service has a certificate. The operator can require TLS with --require-tls yes or HOSTING_REQUIRE_TLS=yes, which needs both the FTP or TN5250 certificate and key. Plain FTP remains available by default, so use SFTP or a trusted network when TLS is not required. For FTP commands, NAMEFMT, save files and IFS paths, see the FTP guide.

What is not supported yet

See the SSH and FTP adapter notes in the paid package, and the command page for CHGFTPA.