Why when i want to ssh from jenkins to another server always Connection timed out?

After that question about the firewall, I just researched and got this way to fix my problem.

I got this article: https://www.skynats.com/blog/telnet-connection-refused-by-remote-host/ this tells me how to telnet to my target server then just type this ufw allow 22/tcp in the command line at your target server to allow port 22 ssh. Before that use need to go to this article:

https://learn.microsoft.com/en-us/answers/questions/1324429/how-to-fix-ssh-connection-timed-out-to-ip-with-por

to check are your ssh to target server has trouble. Then go to this article to fix your sshd https://repost.aws/knowledge-center/ec2-linux-resolve-ssh-connection-errors