Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-17809

Problem executing commands on Windows over SSH

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • Jenkins is on CentOS on Tomcat,
      SSH server is on Windows 7 x32 (FreeSSHd as a service).

      When trying to execute a command over SSH I get:
      SSH: EXEC: STDOUT/STDERR from command [.../some.exe
      ] ...
      AllowDesktopAccess failed.
      Unable to execute command or shell on remote system: Failed to Execute process.

      This seems like a bug because SSH seem to work otherwise:
      1. Transferring files with Jenkins over SSH works fine.
      2. Executing commands from PuTTy, from my other Windows machine works (it is a bit slow, but works).
      3. Executing commands from the computer Jenkins is on (over command line ssh client) also works.

      Currently FreeSSHd is running as a service and I've set up logging in with Windows auth, but auth itself seem to be working fine even with Jenkins (test of setup passed, transferring files works fine).

          [JENKINS-17809] Problem executing commands on Windows over SSH

          Gianfranco Palma-Caffo added a comment - - edited

          Hello Maciej,

          The solution is to add "cmd /c" before of the command.

          Por example, you could to write in the section "Exec command" of the Publish Over SSH Plugin:

          cmd /c mkdir "D:\MyFolder\"

          Also, if you want to run multiples commands, you could write something like the following statement:

          cmd /c "echo Hello & echo My Friend"

          On the other hand, is better execute a file batch with the lines to execute:

          cmd /c "C:\data\scripts\myScript.bat"

          regards,
          Gianfranco

          Gianfranco Palma-Caffo added a comment - - edited Hello Maciej, The solution is to add " cmd /c " before of the command. Por example, you could to write in the section "Exec command" of the Publish Over SSH Plugin: cmd /c mkdir "D:\MyFolder\" Also, if you want to run multiples commands, you could write something like the following statement: cmd /c "echo Hello & echo My Friend" On the other hand, is better execute a file batch with the lines to execute: cmd /c "C:\data\scripts\myScript.bat" regards, Gianfranco

          Alex Earl added a comment -

          nux does gianfra2426's solution work for you?

          Alex Earl added a comment - nux does gianfra2426 's solution work for you?

          Maciej Jaros added a comment - - edited

          slide_o_mix, no that did not work IIRC... But that might have been FreeSSHd fault. I've ended up using PHP to run commands. If I would do it again I would problably just setup a Jenkins slave on that machine...

          Anyway that Windows machine is long gone so I won't be able to re-check.

          Maciej Jaros added a comment - - edited slide_o_mix , no that did not work IIRC... But that might have been FreeSSHd fault. I've ended up using PHP to run commands. If I would do it again I would problably just setup a Jenkins slave on that machine... Anyway that Windows machine is long gone so I won't be able to re-check.

          Alex Earl added a comment -

          Thanks for following up after 5 years!

          Alex Earl added a comment - Thanks for following up after 5 years!

          For your information, all publish-over-ssh component type JENKINS issues related to the Publish Over SSH plugin have been transferred to Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues

          Here is the direct link to this issue in Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues/200
          And here is the link to a search for related issues: https://github.com/jenkinsci/publish-over-ssh-plugin/issues?q=%22JENKINS-17809%22

          (Note: this is an automated bulk comment)

          Gavin McDonald added a comment - For your information, all publish-over-ssh component type JENKINS issues related to the Publish Over SSH plugin have been transferred to Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues Here is the direct link to this issue in Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues/200 And here is the link to a search for related issues: https://github.com/jenkinsci/publish-over-ssh-plugin/issues?q=%22JENKINS-17809%22 (Note: this is an automated bulk comment)

            slide_o_mix Alex Earl
            nux Maciej Jaros
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: