drone-ssh icon indicating copy to clipboard operation
drone-ssh copied to clipboard

CANNOT execute commands in Windows host

Open maotou316 opened this issue 2 years ago • 2 comments

Hi everyone,

I'm having an issue with a Drone CI pipeline step. I'm trying to run some commands on a remote Windows server using the appleboy/drone-ssh image, but I'm encountering an issue where some commands are not executing.

Here's an example step that's failing:


- name: '部署到Web'
  image: appleboy/drone-ssh
  settings:
    host: 192.168.50.249
    port: 22
    username: administrator
    password:
      from_secret: pws_web
    script:
      - echo "Web Master"
      - ls

When I run this step, the echo command works correctly and outputs "Web Master" to the console, but the ls command does not seem to have any effect.

I've tried different commands, such as dir, but they all exhibit the same behavior. I know that the SSH connection is working because I'm able to run echo without any issues.

Can someone please point me in the right direction on how to troubleshoot this issue? I'm not sure if this is an issue with the SSH connection or with the command that I'm running.

Thank you in advance for any help you can provide.

Best regards,

maotou316 avatar Feb 13 '23 06:02 maotou316

Multiple commands don't seem to be working for windows, I use the following as a workaround:

script:
  - command1 && command2 && ...

Inzilbeth avatar Feb 16 '24 14:02 Inzilbeth