Cannot connect to postgres db ssh error

Hi thanks. I did go through @kurt 's recommendations and still could not get it to work. I will try again today. When you say your organization is there a file that I have to check or is my organization setup in fly.io?

I followed these steps and could connect to bitbucked. Followed the same steps and could not connect fly.

Steps.
PS C:\Windows\system32> Start-Service ssh-agent
PS C:\Windows\system32> Get-Service ssh-agent

Status Name DisplayName


Running ssh-agent OpenSSH Authentication Agent

PS C:\users\carl.ssh> ssh-add ./id_rsa
Enter passphrase for ./id_rsa:
Identity added: ./id_rsa (carl@Carls-2-Surface)

Add the id_rsa.pub key to bitbucket

PS C:\users\carl.ssh> ssh -T git@bitbucket.org
You can use git to connect to Bitbucket. Shell access is disabled.

For fly

cd c:\users\carl.ssh
fly ssh issue

? Path to store private key: .ssh
Wrote 24-hour SSH credential to .ssh, .ssh-cert.pub
PS C:\users\carl.ssh> ssh-add ./.ssh
Identity added: ./.ssh (fly.io)
Certificate added: ./.ssh-cert.pub (fly:org:xxxxxx:user:xxxxxx)

fly pg connect -a helloflydb
Connecting to fdaa:5:c452:a7b:232:a26e:aa50:2… complete
Error: error connecting to SSH server: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain

2024-02-05T07:07:49Z app[90806145c17e28] syd [info]2024/02/05 07:07:49 unexpected error fetching cert: transient SSH server error: can’t resolve _orgcert.internal
2024-02-05T07:07:49Z app[90806145c17e28] syd [info]2024/02/05 07:07:49 unexpected error: [ssh: no auth passed yet, transient SSH server error: can’t resolve _orgcert.internal]
2024-02-05T07:08:48Z app[90806145c17e28] syd [info]repmgrd | [2024-02-05 07:08:48] [INFO] monitoring primary node “fdaa:5:c452:a7b:232:a26e:aa50:2” (ID: 658137670) in normal state

I do not know if this is a fly server-side issue or an issue on my w11 laptop.

I do not know what to do next…Need to find another hosting provider as I need to connect my machines in order to do well “anything”.

Tried again this time in git bash. The steps shown below show that the ssh-agent is running. Yet fly cannot see the agent.2761 which was just started.

$ eval “$(ssh-agent -s)”
Agent pid 2762

$ printenv | grep SSH
SSH_AUTH_SOCK=/tmp/ssh-X3yseKCylLi5/agent.2761
SSH_AGENT_PID=2762

$ fly ssh issue --agent -d --overwrite -o personal
Error: can’t connect to SSH agent: dial unix C:/Users/carl/AppData/Local/Temp/ssh-X3yseKCylLi5/agent.2761: connect: No connection could be made because the target machine actively refused it.

I even tried
$ fly status -a helloflydb
ID STATE ROLE REGION CHECKS IMAGE CREATED UPDATED
90806145c17e28 started primary syd 3 total, 3 passing flyio/postgres-flex:15.3 (v0.0.46) 2024-02-03T11:14:42Z 2024-02-03T11:14:58Z

carl@Carls-2-Surface MINGW64 ~/dev/play/hello-fly (main)
$ fly ssh console -a helloflydb -s 90806145c17e28
? Select VM: syd: 90806145c17e28 fdaa:5:c452:a7b:232:a26e:aa50:2 falling-night-117 (primary)
Error: host unavailable at 90806145c17e28: host was not found in DNS

now 10:15 PM deleted all apps and machines from dashboard and deployed with fly deploy -ha=false so I get only one machine.
This is what I get when I try to get to the console. I am lost …

Visit your newly deployed app at https://helloflycarl.fly.dev/
PS C:\Users\carl\dev\play\hello-fly> fly ssh issue
? Select Organization: Carl B Hill (personal)

!!! WARNING: We’re now prompting you to save an SSH private key and certificate !!!
!!! (the private key in “id_whatever” and the certificate in “id_whatever-cert.pub”). !!!
!!! These SSH credentials are time-limited and handling them in files is clunky; !!!
!!! consider running an SSH agent and running this command with --agent. Things !!!
!!! should just sort of work like magic if you do. !!!
? Path to store private key: c:\users\carl.ssh.ssh
Wrote 24-hour SSH credential to c:\users\carl.ssh.ssh, c:\users\carl.ssh.ssh-cert.pub
PS C:\Users\carl\dev\play\hello-fly> ssh-add $env:USERPROFILE.ssh.ssh
Identity added: C:\Users\carl.ssh.ssh (fly.io)
Certificate added: C:\Users\carl.ssh.ssh-cert.pub (fly:org:xxxx:user:xxxxxxx)
PS C:\Users\carl\dev\play\hello-fly> fly console -a helloflycarl
Error: failed to launch VM: To create more than 1 machine per app please add a payment method. Sign In · Fly (Request ID: 01HNWFK8PZK6XHAJY1HVHM9WQ2-sin)

It is now 10:51 PM
I joined the $5/m hobby plan and progressed a bit more, but then get to the same error.
$ fly console -a helloflycarl
Created an ephemeral machine 148e432f9d9689 to run the console.
Connecting to fdaa:5:c452:a7b:a755:4e94:557b:2… complete
Waiting for ephemeral machine 148e432f9d9689 to be destroyed … done.
Error: error connecting to SSH server: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain

It is now 11:49 PM
$ fly m start
? Select machines: 5683047a66048e damp-river-5753 (started, region syd, process group ‘app’)
5683047a66048e has been started

carl@Carls-2-Surface MINGW64 ~/dev/play/hello-fly (main)
$ flyctl ssh console 5683047a66048e
Error: host unavailable at 5683047a66048e: host was not found in DNS

It is now 12:53 am
I tried @sudir.j [flyctl ssh console: Waiting for host... and nothing happens - #31 by nickolay.loshkarev] tip for using wireguard to VPN directly into the machine. It works. However, I get disconnected by the server immediately.

ssh -i /c/users/carl/.ssh/.ssh root@fdaa:5:c452:a7b:2985:c3bd:e760:2
The authenticity of host ‘xxxxxxxxx’ can’t be established.
ED25519 key fingerprint is SHA256:xxxxxxxxxx.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added ‘fxxxxxxxxxxxxxxxxxxxxxxxxx’ (ED25519) to the list of known hosts.
Received disconnect from xxxxxx port 22:2: too many authentication failures
Disconnected from fdaa:5:c452:a7b:2985:c3bd:e760:2 port 22

When I run the command I get
$ ssh -i /c/users/carl/.ssh/.ssh root@xxxxxxxxxxxxxxxxxxxxxxxxxxx
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ED25519 key sent by the remote host is
SHA256:xxxxxxxxxxxxxxxxxxxxxx.
Please contact your system administrator.
Add correct host key in /c/Users/carl/.ssh/known_hosts to get rid of this message.
Offending ED25519 key in /c/Users/carl/.ssh/known_hosts:5
Host key for fdaaxxxxxxxxxxxxxxxxxxxxx has changed and you have requested strict checking.
Host key verification failed.