When running bitbucket pipeline ssh connection is throwing "ssh: connect to host ... port 22: Connection timed out" error message.
Port 22 is open in the firewall on the remote machine.
The remote machine is also added to the known hosts in Pipeline settings.
The same command successfully executes from local Windows machine via PuTTy or Linux virtual machine.
Hi @[deleted] , please ensure you allow incoming port 22 connections from the range of IP addresses used by both Pipelines services and Pipelines build environments - https://confluence.atlassian.com/bitbucket/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall-343343385.html.
I would suggest trying to use 'nmap' ( e.g nmap -p 22 <host> ) to scan for open ports on your host from pipelines, which will reveal if port 22 is reachable, and also 'traceroute' to determine if there is a networking issue between pipelines and the host.
In the past, we've had had users run into issues on Ubuntu running in Google Cloud, where a process called 'sshguard' was adding iptables rules to block SSH requests after running a keyscan against it. It you are running a Linux variant, it may be worth checking if this process is running, and if it is causing iptables rules to be added, blocking requests.
The problem was that an external firewall was whitelisting outdated IP addresses. Sorry for any inconveniences.
Thanks, Alex.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.