Issue
When attempting to SSH into your server, you might encounter an error like the following:
Permission denied (publickey). Couldn't read packet: Connection reset by peer
Resolution
If you see the error above, answer the following questions to determine the issue:
- Do you have the correct permissions to SSH into a server? Check your Team/Role and Permissions.
- Are you able to SSH into other servers? For example, you may encounter an issue with a Production server yet have access to Stage. This can be a helpful diagnostic check. Check the Servers tab in your Cloud environments interface to see the username and host you should use to access your environment via SSH.
- Is your public key still valid? To ensure you are accessing the server with the correct key pair. You can check your known keys. If the keys are not valid, you can remove and re-upload your public key.
If using the tips above doesn't resolve the issue, please create a Support ticket for further assistance. It's recommended you include both the SSH command and verbose output using the example below (the -v
adds verbosity to the output):
ssh [application].[env]@[servername].prod.hosting.acquia.com -v
Also include the output of showing the currently loaded keys in your ssh-agent:
ssh-add -l -E md5
If the key isn't present, then running this command will prompt OpenSSH to load any keys found in common locations:
ssh-add
Add keys stored in Mac OS Keychain:
ssh-add -A