I cannot connect to ssh via terminal

sshd is running on my 2222 port. but I cannot make an ssh connection via terminal. I can do it via browser

How are you connecting from terminal? Are you using cloudflared access?
There is a guide here: SSH ยท Cloudflare Zero Trust docs