Create a local SSH alias for a website coding assistant Print

  • ssh config, alias, codex, claude
  • 0

Quick answer

To check an SSH config without connecting, run ssh -G website-staging with your actual alias and compare the resolved host, user, port and private-key path with your service details. Keep the file in the same local terminal environment you will use to connect. Test the connection and verify the server fingerprint separately.

Find the config file

Windows OpenSSH normally reads %USERPROFILE%/.ssh/config. macOS OpenSSH normally reads ~/.ssh/config. The file is named config, without a .txt extension. Preserve any existing entries. A WSL environment can read a different home folder from native Windows.

Add one concrete account entry

Replace every placeholder below with details for your own service. Use a concrete alias such as website-staging. If the account is production, name it accordingly; the alias name does not create a staging copy or limit server permissions.

For Windows, a full IdentityFile path with forward slashes can avoid home-directory ambiguity. An example is C:/Users/YOUR_WINDOWS_USER/.ssh/website_ai.

Host website-staging
  HostName YOUR_ASSIGNED_SERVER
  User YOUR_CPANEL_USERNAME
  Port YOUR_ASSIGNED_SSH_PORT
  IdentityFile ~/.ssh/website_ai
  IdentitiesOnly yes

Check the SSH config without connecting

Run ssh -G website-staging after saving the entry. Check the resolved hostname, user, port and identityfile against your service details. This command does not log in or prove that the server is reachable. If the values are missing or wrong, confirm that the file is named config, without .txt, and belongs to the same terminal environment.

Test it from your computer

Run the alias in your normal terminal. Compare a first-connection host fingerprint with trusted support/account information before accepting it. Stop if a previously trusted server unexpectedly presents a different key.

ssh website-staging

# After login, these commands run on the hosting account
whoami
pwd
exit

Use the alias with SFTP

OpenSSH SFTP uses the same alias and selected key. This command starts a file-transfer session; the prompt becomes sftp>. Use pwd to see the remote folder, lpwd to see the local folder, and bye to leave.

sftp website-staging

Check the website folder

Confirm the domain’s document root in cPanel > Domains. The shell starts in the account home; that is not necessarily the website directory. Give the coding tool the alias, domain, and exact remote path after checking them.

Troubleshooting

If a coding tool fails while this terminal works, compare environments and permissions. Keep passphrases in the terminal/key agent.

Related help

Official references

Last content review: October 31, 2026. Check the version and features available in your own account.


Was this answer helpful?

« Back