For some reason, I can no longer connect to my Amazon Lightsail instance via SSH (it was ok yesterday on the same machine).
When connecting to my instance I get an error
~ ssh [email protected] -vvv
OpenSSH_9.0p1, LibreSSL 3.3.6
debug1: Reading configuration data /Users/gavin/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug2: resolve_canonicalize: hostname 172.26.14.190 is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/gavin/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/gavin/.ssh/known_hosts2'
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug3: ssh_connect_direct: entering
debug1: Connecting to 172.26.14.190 [172.26.14.190] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x48
debug1: connect to address 172.26.14.190 port 22: Operation timed out
ssh: connect to host 172.26.14.190 port 22: Operation timed out
What is Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
and what is causing this to happen?
NB. I can connect fine using the AWS browser-based SSH connection tool
2
Answers
Since you mentioned you can connect using AWS browser-based SSH, this means SSH is enabled just fine. Are you sure you’re using the correct private key? Maybe try:
And see if this fixes the problem? (Although this might be a firewall issue)
I see there is a timeout
ssh: connect to host 172.26.14.190 port 22: Operation timed out
, so might worth checking if Firewall or Security group rules are working as expected with your IP.You are trying to connect to the private IP address.
172.26.14.190
is in a private IP range that would only be accessible from within the same network as the LightSail instance. Unless you are trying to run thatssh
command from another LightSail instance in the same network, then that command is not going to work.If you are trying to connect to that instance from your local computer, then you need to use the LightSail instance’s public IP address.