Nikolay Traykov
Nikolay Traykov

Reputation: 1695

Unable to connect from bitbucket pipelines to shared hosting via ssh

What I need to do is to SSH public server (which is shared hosting) and run a script that starts the deployment process.

I followed what's written here:

When I try to run this pipeline:

image: img-name
pipelines:
   branches:
      staging:
        - step:
            deployment: Staging
            script:
              - ssh remote_username@remote_ip:port ls -l

I have the following error:

Could not resolve hostname remote_ip:port: Name or service not known

Please help!

Upvotes: 0

Views: 497

Answers (1)

Jim Redmond
Jim Redmond

Reputation: 5631

The SSH command doesn't take the ip:port syntax. You'll need to use a different format:

ssh -p port user@remote_ip "command"

(This assumes that your remote_ip is publicly-accessible, of course.)

Upvotes: 1

Related Questions