Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot connect to remote machine via SSH from pipeline

Deleted user March 5, 2019

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.

1 answer

0 votes
Graham Gatus
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 5, 2019

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.

Deleted user March 6, 2019

The problem was that an external firewall was whitelisting outdated IP addresses. Sorry for any inconveniences.

Thanks, Alex.

Like Graham Gatus likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events