Code access troubleshooting

Published

Updated

🔧

Fixing connection problems.

When SSH or SFTP to fortrabbit fails, the cause is usually on the local machine, such as a missing key or an old entry in the SSH config. Test with the ssh command first, it shows the most detail.

SSH key setup

  • The public key is uploaded to the fortrabbit account, under SSH keys.
  • The same key works elsewhere, for example on GitHub.
  • Code access worked before with this key.

See SSH key setup.

Verbose mode

Add -v to the login command. The output shows which config files and keys are used:

$ ssh {{app-env-id}}@ssh.{{region}}.frbit.app -v

# OpenSSH_8.4p1, OpenSSL 1.1.1i  8 Dec 2022
# debug1: Reading configuration data /home/user/.ssh/config
# debug1: /home/user/.ssh/config line 6: Applying options for *
# debug1: Reading configuration data /etc/ssh/ssh_config
# debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
# … more lines here
shell

Local SSH configuration

Look through ~/.ssh/config and ~/.ssh/known_hosts. Delete the entries for fortrabbit hosts to reset the local configuration, see SSH access.

New environment

A new environment takes a minute or two before SSH works. If it still fails after ten minutes, with the key accepted, .

New SSH key

A key added in the dashboard works after a minute or two.

Password prompt

fortrabbit accepts SSH keys only. A password prompt means one of these:

  • The local key has a passphrase, which the prompt asks for.
  • The server rejected all keys in ~/.ssh/. Check the verbose output and the config.

No connection at all

When the connection hangs or never opens:

  • The IP address is blocked after too many connections or failed logins, see SSH rate limits.
  • A firewall or VPN on the local network blocks port 22. Test another SSH host, or turn the VPN off.

Connecting from a container

A container, such as in Docker or DDEV, needs the SSH key too. In DDEV, ddev auth ssh makes the local keys available.

Worked before, fails now

  1. Compare the local key with the one in the dashboard.
  2. Check that the account still has access to the app, a collaboration change may have removed it.
  3. Check the SSH rate limits.

Host authenticity warning

The first SSH connection to a fortrabbit host asks to confirm its fingerprint:

The authenticity of host '…' can't be established
ED25519 key fingerprint is SHA256:UB3p/YgtQSuK3WESB/0ra5dTDWkggrCOz0WkWe4Tvvg
Are you sure you want to continue connecting (yes/no)?
shell

The SSH hosts of all regions share this ED25519 fingerprint:

SHA256:UB3p/YgtQSuK3WESB/0ra5dTDWkggrCOz0WkWe4Tvvg
text

Compare it with the one in the warning, then type yes to store it in ~/.ssh/known_hosts. SFTP clients such as WinSCP or FileZilla show the same fingerprint in their first-connect dialog.

When the fingerprint changes later, SSH refuses to connect. before removing the old entry.

Frequently asked

Why does SSH ask for a password on fortrabbit?

fortrabbit accepts SSH keys only, never passwords. A prompt asks for the passphrase of the local key, or it shows that the server rejected all keys offered. Run ssh with -v to see which keys were tried.

#

Written by humans and AI in collaboration.

AI use & editorial processEdit on GitHub ↗