SSH commands not executing on SFTPGo servers

If your SSH commands appear to complete instantly with no output but aren't actually executing on your server, your server may be running SFTPGo.

The Problem

During deployment, you may notice the following symptoms:

  • SSH commands complete in less than a second (e.g., 0.13 seconds)
  • No output appears in the deployment logs
  • Commands appear successful (green checkmark) but have no effect
  • File transfers work perfectly, but post-deployment commands fail silently

The Cause

Your server is running SFTPGo, which is an SFTP server designed primarily for secure file transfers. Unlike standard SSH servers (such as OpenSSH), SFTPGo has very limited support for executing shell commands.

When DeployHQ sends commands to an SFTPGo server:

  1. The SSH connection succeeds (so connectivity tests pass)
  2. File transfers work perfectly (SFTP functionality is fully supported)
  3. Command execution requests are acknowledged with exit code 0
  4. However, commands don't actually execute in a shell environment
  5. No output is produced because nothing actually runs

Identifying SFTPGo Servers

You can identify an SFTPGo server by checking the SSH server banner during connection. SFTPGo identifies itself with a version string like SSH-2.0-SFTPGo_2.7.0 or similar.

Solutions

The most reliable solution is to replace SFTPGo with OpenSSH on your server. This enables full shell command support and allows DeployHQ to run all SSH commands as expected.

Advantages: * Full SSH command execution support * Industry-standard SSH server * All DeployHQ features work as expected

Steps: 1. Install OpenSSH on your server 2. Configure OpenSSH with your desired security settings 3. Update your DeployHQ server configuration if connection details changed 4. Test your deployment with SSH commands

Option 2: File-Transfer-Only Deployments

If you must continue using SFTPGo, you can configure DeployHQ to handle file transfers only and use alternative mechanisms for post-deployment tasks.

Steps: 1. Remove all SSH commands from your DeployHQ project 2. Use DeployHQ exclusively for file transfers (which work perfectly with SFTPGo) 3. Set up alternative mechanisms for post-deployment tasks: * Webhooks: Configure webhooks that trigger on deployment completion * Cron jobs: Set up scheduled tasks that detect file changes * External automation: Use CI/CD tools or other automation systems * Manual execution: SSH directly to the server and run commands manually after deployment

Advantages: * Continue using SFTPGo for file transfers * Maintains existing server configuration * File transfer performance remains optimal

Disadvantages: * Additional complexity in deployment workflow * Commands must be managed separately from file transfers

Option 3: Check SFTPGo Configuration

Some versions and configurations of SFTPGo may support limited command execution through external command hooks or custom integrations.

Steps: 1. Review your SFTPGo version and configuration 2. Check the SFTPGo documentation for your specific version 3. Look for features such as: * External command handlers * Post-upload hooks * Custom script integration * Shell access settings

Note: Even with these features enabled, SFTPGo's command execution may be limited compared to a full SSH server like OpenSSH.

Prevention

If you need to run SSH commands as part of your deployment process, ensure your server is running a full SSH server implementation (like OpenSSH) rather than an SFTP-only server like SFTPGo when setting up your DeployHQ server configuration.

You can test command execution manually by connecting via SSH and attempting to run a simple command like echo "test" to verify your server supports shell access before configuring SSH commands in DeployHQ.