Skip to content

port parameter always using default value #383

Open
@darioRandazzoAccedo

Description

@darioRandazzoAccedo

Describe the bug

I am using a port forward rule on my router, so I mapped the internal port 22 to something else (let's say 1234).
So, I am passing 1234 a port parameter as documented.
Sadly, I got this error, which seems that it is still trying to use the default value 22 (also from the log below).

Will download drone-ssh-1.8.1-linux-amd64 from https://github.com/appleboy/drone-ssh/releases/download/v1.8.1
======= CLI Version =======
Drone SSH version 1.8.1
===========================
2025/04/18 14:45:09 dial tcp ***:22: i/o timeout
Error: Process completed with exit code 1.

If I change the rule on my router to just forward 22 to 22, the action works (despite the value passed to port is 1234).

Yaml Config

Here is my github action code:

name: Contact home

on:
  workflow_dispatch

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: executing remote ssh commands using password
        uses: appleboy/ssh-action@v1
        with:
          host: ${{ secrets.TARGET_IP }}
          username: ${{ secrets.USERNAME_SSH }}
          password: ${{ secrets.PASSWORD_SSH }}
          port: ${{ secrets.TARGET_PORT_SSH }}
          script: |
            whoami
            ls -al

Related environment

Please provide the following information:

  1. Your hosting provider information, such as DigitalOcean, Linode, AWS, or GCP.
    I am using a ubuntu machine running in my local network.
  2. The version information of your host's SSH service.
    OpenSSH_9.6p1 Ubuntu-3ubuntu13.9, OpenSSL 3.0.13 30 Jan 2024
  3. The information from your host's SSH configuration file.
    default value

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions