Skip to content

SSH Agent Forwarding on iPhone with NeoServer: Setup and Risks

Use NeoServer SSH agent forwarding for Git and jump-host authentication without copying a private key to the server. Check server support and security limits.

1 min read

SSH agent forwarding lets a remote SSH session ask your local agent to sign an authentication challenge. With NeoServer, this can help when a server needs to connect to another SSH host or a private Git repository, without placing your private key file on that server.

Set it up in NeoServer

  1. Add a usable private key to NeoServer.
  2. Edit the target server and enable SSH Agent Forwarding.
  3. Connect using an SSH terminal session. Forwarding is requested when NeoServer opens that shell channel; it is not a Mosh feature.
  4. On the remote server, run echo "$SSH_AUTH_SOCK". If the variable is set, test with ssh -T git@github.com or an SSH host you control. Ensure the corresponding public key is authorized at the destination.

NeoServer forwards usable keys from its saved key list. The SSH server must allow agent forwarding, and it can reject the request. A missing SSH_AUTH_SOCK or failed authentication can mean the request was rejected, no usable key exists, or the destination does not trust that key.

Understand the security boundary

The remote host receives access to an agent socket while the SSH session is active. It does not receive the private key file, but a malicious process with access to that socket could ask the agent to authenticate to other destinations during the session. Enable forwarding only for servers you trust, and turn it off when it is not needed. Agent forwarding does not replace host-key verification, access control, or destination-specific permissions.

For work that must survive a mobile network interruption, run long-lived commands inside tmux on the server. Reconnect before expecting the forwarded agent to be available again; a detached tmux process cannot use your iPhone’s agent while the SSH connection is gone.

Related: NeoServer user guide and tmux on iOS.

Ready to try it?

NeoServer · SSH, Mosh, Docker & SFTP client for iPhone, iPad and Mac

Free on the App Store