Hello
Is it possible to deploy a ssh server and ssh into it? I deploy the server but cant ssh into it,I can check the port is tcp/ssh by using nc,but when i ssh it failed on key exchange
kex_exchange_identification: Connection closed by remote host
Connection closed by 66.xxx.xx.xxx port 22
then i tried to flyctl ssh console and run a ssh reverse tunnel to my server,but still i can’t log into the app from my server using reverse tunnel,it’s said the same error
Just curious about the situation,did fly proxy filter ssh flux for some secure issue,thanks for your time~
Best regard
Port 22 is used by the Fly.io-provided SSH daemon (the one used when you fly ssh console for example). If you want to install sshd proper, you need to configure it to use a different port. If you intend this to be accessible from the outside, you also need a [service] section mapping the port you use to an external port, using raw tcp (no http/tls handlers). There’s more info on service configuration here: Fly Launch configuration (fly.toml) · Fly Docs
Hey guys,thanks for your help,it helped a lot,but can’t get it working,now i configure the sshd properly run,i run sshd use customed configfile,as you can see below
######################i got this $IPv4 in fly.io/apps/$app dashboard,a shared ipv4
[root@cn2-64 ~]# ssh root@$IPv4-p 10022
kex_exchange_identification: Connection closed by remote host
Connection closed by 66.241.124.121 port 10022
then i managed to ssh into the vm use flyctl,i tried to ssh root@127.0.0.1 -p 10022,and it is ok,so i think the sshd is configured ok
908x6xxxx58:/# ssh root@127.0.0.1 -p 10022
The authenticity of host '[127.0.0.1]:10022 ([127.0.0.1]:10022)' can't be established.
ED25519 key fingerprint is SHA256:CJ1xWThvyC4AnCa6jxe32S5PPhfhCnMDux4qVbRjcaU.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[127.0.0.1]:10022' (ED25519) to the list of known hosts.
root@127.0.0.1's password:
Welcome to Alpine!
The Alpine Wiki contains a large amount of how-to guides and general
information about administrating Alpine systems.
See <https://wiki.alpinelinux.org/>.
You can setup the system with the command: setup-alpine
You may change this message by editing /etc/motd.
908x6xxxx58:~#