Close this Page

SSH Tunnel Server — User Guide

ts-sap-hana-s4-ssh-tunnel — Secure Jump Host for SAP Landscape
Overview

What is the SSH Tunnel Server?

The SSH Tunnel Server (ts-sap-hana-s4-ssh-tunnel) is a lightweight Debian Linux VM hosted on Google Cloud Platform that serves as a secure jump host (bastion host) for accessing the SAP landscape from external networks.

The SAP servers (S/4HANA, ECC Oracle, SQL Server, HVR Hub) reside on internal GCP networks without external IP addresses. This tunnel server has both an internal IP (for reaching SAP systems) and an external IP (for accepting connections from the internet), bridging the two.

Primary use cases: SSH jump host for remote access, port forwarding for SAP GUI and HANA Studio, secure file transfers, and automated connectivity checks from the web server (sapidesecc8).
System Info

Server Details

PropertyValue
Hostnamets-sap-hana-s4-ssh-tunnel
OSDebian GNU/Linux 12 (bookworm)
Kernel6.1.0-44-cloud-amd64
CPUs2 vCPUs
Memory975 MiB
Disk9.7 GB (39% used)
Internal IP10.142.0.37
External IP35.229.110.30 (static)
GCP Zoneus-east1-b
GCP Instancets-sap-hana-s4-ssh-tunnel
GCP Projectinternal-sales

Network Topology

ServerInternal IPReachable from TunnelDescription
sap-sql-ides10.128.0.51YesSAP ECC 6.0 on SQL Server (Windows)
hvrhub10.128.15.240YesFivetran HVR Hub
sapidess410.128.15.210No (different subnet)SAP S/4HANA 2023
sapidesecc810.128.15.220No (different subnet)SAP ECC 6.0 EHP8 on Oracle
Note: The tunnel server is on the 10.142.x.x subnet while sapidess4 and sapidesecc8 are on 10.128.15.x. Direct ICMP ping is not possible between these subnets, but SSH forwarding through GCP VPC routing works for the reachable hosts.
SSH Service

Service Details

PropertyValue
Servicessh.service (OpenBSD Secure Shell server)
Daemonsshd
Port22 (TCP)
Config file/etc/ssh/sshd_config
Statusenabled (starts on boot)
ProtocolSSH-2

Configuration

SettingValueDescription
PermitRootLoginprohibit-passwordRoot login via SSH key only (no password)
PasswordAuthenticationyesPassword auth enabled globally
ChallengeResponseAuthenticationyesKeyboard-interactive auth enabled
UsePAMyesPAM authentication enabled
X11ForwardingyesX11 display forwarding allowed
AllowTcpForwardingyes (default)TCP port forwarding allowed
GatewayPortsno (default)Remote port forwarding binds to localhost only
ClientAliveInterval120Keep-alive ping every 120 seconds
Match block: The fivetran user has an explicit PasswordAuthentication yes match rule, ensuring password login works for this user even if the global setting changes.

Start / Stop / Restart

The cockpit provides Start, Stop, and Restart buttons for the SSH service.

  • Start — starts the SSH daemon; no password required
  • Stop — stops the SSH daemon; requires master password. All active SSH sessions will be terminated.
  • Restart — restarts the SSH daemon; requires master password. Active sessions will be briefly interrupted.

Command line (from sapidesecc8):

# Check status
ssh root@sapidesecc8 "ssh root@10.142.0.37 'systemctl status ssh'"

# Start SSH service
ssh root@sapidesecc8 "ssh root@10.142.0.37 'systemctl start ssh'"

# Stop SSH service (WARNING: all sessions will be terminated)
ssh root@sapidesecc8 "ssh root@10.142.0.37 'systemctl stop ssh'"

# Restart SSH service
ssh root@sapidesecc8 "ssh root@10.142.0.37 'systemctl restart ssh'"

# Enable SSH on boot
ssh root@sapidesecc8 "ssh root@10.142.0.37 'systemctl enable ssh'"

If already logged in on the tunnel server:

sudo systemctl status ssh
sudo systemctl start ssh
sudo systemctl stop ssh
sudo systemctl restart ssh
Warning: Stopping the SSH service will prevent all remote access to the server. The only way to recover is through the GCP Console serial console or by restarting the VM from GCP.
Access

User Accounts

UserAuth MethodShellDescription
rootSSH key only/bin/bashSystem administrator (from sapidesecc8 only)
fivetranSSH key + password/bin/shFivetran service account — used for tunneling
antonio_carboneSSH key (GCP OS Login)/bin/bashPersonal account via Google Cloud IAP

Credentials

UserPasswordVault Key
rootKey auth only (sapidesecc8’s key is authorized)ssh_tunnel_server
fivetranStored in vaultssh_tunnel_server
SSH button: The cockpit’s SSH button copies the fivetran password to clipboard and opens an ssh:// connection to fivetran@35.229.110.30.

Connection Methods

From your Mac (key-based, no password):

ssh fivetran@35.229.110.30

Via GCP Identity-Aware Proxy (IAP):

gcloud compute ssh ts-sap-hana-s4-ssh-tunnel --zone=us-east1-b --project=internal-sales

From sapidesecc8 (key-based, no password):

ssh root@10.142.0.37      # as root
ssh fivetran@10.142.0.37  # as fivetran
Tunneling

SSH Jump Host

Use the -J flag to jump through the tunnel server to reach internal SAP hosts:

# Jump to S/4HANA server via tunnel
ssh -J fivetran@35.229.110.30 root@sapidess4

# Jump to ECC Oracle server
ssh -J fivetran@35.229.110.30 root@sapidesecc8
ProxyJump: The -J flag (ProxyJump) establishes a transparent connection through the tunnel server. You authenticate to both the tunnel and the target host in sequence.

Port Forwarding

Forward local ports to internal SAP services through the tunnel:

ServiceCommandLocal Access
SAP GUI (S/4HANA)ssh -L 3200:sapidess4:3200 fivetran@35.229.110.30localhost:3200
HANA Studiossh -L 30015:sapidess4:30015 fivetran@35.229.110.30localhost:30015
SAP GUI (ECC Oracle)ssh -L 3201:sapidesecc8:3200 fivetran@35.229.110.30localhost:3201
SQL Serverssh -L 1433:10.128.0.51:1433 fivetran@35.229.110.30localhost:1433

Multiple tunnels in one command:

ssh -L 3200:sapidess4:3200 \
    -L 3201:sapidesecc8:3200 \
    -L 30015:sapidess4:30015 \
    fivetran@35.229.110.30
Key Management

Adding SSH Keys

The cockpit provides an Add SSH Public Key form that appends a public key to /home/fivetran/.ssh/authorized_keys on the tunnel server.

  • Paste any standard SSH public key (ssh-rsa, ssh-ed25519, or ecdsa)
  • The key is checked for duplicates — if the key body already exists, it won’t be added again
  • An added-by-claude comment is appended to keys added through the portal
  • Keys are added to the fivetran user only (not root)
API: POST /sap_skills/api/sshtunnel_add_key with body {"key": "ssh-rsa AAAA... user@host"}. The server SSHs as root to the tunnel server and modifies the authorized_keys file.

Authorized Keys Files

FileUserDescription
/home/fivetran/.ssh/authorized_keysfivetranFivetran service keys + keys added via portal
/root/.ssh/authorized_keysrootsapidesecc8’s root key (for management)
Security

Firewall

RuleDirectionPortSource
ssh-port22IngressTCP 220.0.0.0/0 (all)
GCP Firewall: Port 22 is open from all sources. Security relies on SSH authentication (key + password). Consider restricting source IPs to known Fivetran office ranges for additional security.

Security Considerations

  • Root access: SSH key only (prohibit-password) — password login as root is impossible
  • OS updates: Debian 12 (bookworm) is current stable (upgraded 2026-04-14 from Debian 11 bullseye)
  • Unattended upgrades: The unattended-upgrades service is running for automatic security patches
  • ClientAliveInterval: Set to 120 seconds — idle sessions are kept alive to prevent disconnection
  • Monitoring: The web server (sapidesecc8) checks tunnel server reachability via the Management Cockpit
Troubleshooting

Common Issues

IssueFix
SSH service not respondingUse cockpit Start button, or GCP Console serial console: systemctl start ssh
Connection refused on port 22Check GCP firewall rule ssh-port22 exists; check systemctl status ssh
Permission denied (publickey)Key not in authorized_keys — add via cockpit or manually
Password rejectedVerify PasswordAuthentication yes in sshd_config; verify user password with passwd fivetran
Cockpit shows “Connection error”Tunnel server is down — check GCP Console for VM status, restart if needed
Tunnel hangs after idleClientAliveInterval should prevent this; add ServerAliveInterval 60 to your local ~/.ssh/config
Port forward not workingVerify target host is reachable from tunnel server: ssh root@10.142.0.37 "ping -c1 TARGET_IP"

Diagnostic Commands

# Check SSH service status
ssh root@sapidesecc8 "ssh root@10.142.0.37 'systemctl status ssh'"

# Check active sessions
ssh root@sapidesecc8 "ssh root@10.142.0.37 'who'"

# Check sshd config syntax
ssh root@sapidesecc8 "ssh root@10.142.0.37 'sshd -t && echo OK || echo FAILED'"

# Check auth log
ssh root@sapidesecc8 "ssh root@10.142.0.37 'tail -20 /var/log/auth.log'"

# Check disk space
ssh root@sapidesecc8 "ssh root@10.142.0.37 'df -h /'"

# Restart SSH after config change
ssh root@sapidesecc8 "ssh root@10.142.0.37 'systemctl restart ssh'"
Email Relay

SMTP Configuration

This server is configured to send email via smtp2go relay using Exim4.

PropertyValue
MTAExim4 (Debian smarthost mode)
Relaymail.smtp2go.com::2525
From Addresssshtunnel@fivetran-internal-sales.com
AuthSASL via /etc/exim4/passwd.client (credentials in vault key smtp2go)
Config/etc/exim4/update-exim4.conf.conf, /etc/exim4/passwd.client

Send a test email:

echo "Test" | mail -s "Test from sshtunnel" -a "From: sshtunnel@fivetran-internal-sales.com" recipient@email.com
Architecture

Cockpit API Endpoints

EndpointMethodAuthDescription
/sap_skills/api/sshtunnel_hardwareGETNoneOS, CPUs, memory, uptime
/sap_skills/api/sshtunnel_diskGETNoneDisk space usage
/sap_skills/api/sshtunnel_statusGETNoneSSH reachability check
/sap_skills/api/sshtunnel_sessionsGETNoneActive SSH sessions (who)
/sap_skills/api/sshtunnel_ssh_credentialGETNoneReturns fivetran user/password from vault
/sap_skills/api/sshtunnel_controlPOSTMaster pwd (stop/restart)Start/stop/restart SSH service
/sap_skills/api/sshtunnel_add_keyPOSTNoneAdd public key to fivetran authorized_keys

How It Works

All cockpit operations are executed remotely from sapidesecc8. The web server (sapidesecc8) SSHs to the tunnel server (root@10.142.0.37) using key-based authentication and runs commands. The results are returned as JSON to the browser.

ComponentLocationDescription
Web serversapidesecc8gcs_explorer_server.py handles API requests
SSH tunnel server10.142.0.37Target of all remote commands
Cockpit page/usr/sap/sap_skills/docs/SAP_SSHTunnel.htmlBrowser UI with JavaScript fetch calls
Guide page/usr/sap/sap_skills/docs/SAP_SSHTunnel_Guide.htmlThis documentation page
Vault credentials/usr/sap/sap_skills/.vault.encEncrypted vault key: ssh_tunnel_server