When executing any command throught SSH I see this in the log:

      SSH: EXEC: STDOUT/STDERR from command [##
      # Some commands here
      if [ ! -f $bkpSh ]
      then
        echo "[ERROR] backup.sh does not exist!" 
        exit 1
      fi
      # ...
      ] ...
      

      I would like to be able to hide SSH command code. An option to hide code might be set per SSH command or even per Jenkins installation (in the main configuration).

      The problem is that I cannot easily use TextFinder (it will find "[ERROR]" no matter what the result is). This also clutters the log in most cases (or at least in my case).

          [JENKINS-19973] Option to hide command in log

          Saul Goodman added a comment - - edited

          This is really needed!

          Its also needed if you want to print enviroment-variables that contains passwords and so on...

          I think the best way would be like the "Execute Shell" is doing.
          Default it runs with # !/bin/sh -ex Which makes it print all commands its running, if you want to overwrite you simply put # !/bin/sh at the top line.

          So your "Exec Command" would like like this:
          #!/bin/sh
          if [ ! -f $bkpSh ]
          then
          echo "[ERROR] backup.sh does not exist!"
          exit 1
          fi

          Saul Goodman added a comment - - edited This is really needed! Its also needed if you want to print enviroment-variables that contains passwords and so on... I think the best way would be like the "Execute Shell" is doing. Default it runs with # !/bin/sh -ex Which makes it print all commands its running, if you want to overwrite you simply put # !/bin/sh at the top line. So your "Exec Command" would like like this: #!/bin/sh if [ ! -f $bkpSh ] then echo " [ERROR] backup.sh does not exist!" exit 1 fi

          +1 vote.

          Folks are suggesting workarounds online like this one - Do not use the plugin, use  "Execute shell" and establish SSH connection this way - https://stackoverflow.com/questions/32887620/how-can-i-stop-displaying-the-ssh-exec-command-in-the-output-console-in-jenkins

          Another person with the same question but no answer - https://groups.google.com/forum/#!topic/jenkinsci-users/phhDyqLHFDw

          I'm using "ssh plugin" not "publish over ssh plugin" but the issue seems to be the same.

           

          Marcin Rozanski added a comment - +1 vote. Folks are suggesting workarounds online like this one - Do not use the plugin, use  "Execute shell" and establish SSH connection this way -  https://stackoverflow.com/questions/32887620/how-can-i-stop-displaying-the-ssh-exec-command-in-the-output-console-in-jenkins Another person with the same question but no answer - https://groups.google.com/forum/#!topic/jenkinsci-users/phhDyqLHFDw I'm using "ssh plugin" not "publish over ssh plugin" but the issue seems to be the same.  

          Code changed in jenkins
          User: Lukasz Jader
          Path:
          src/main/java/org/jvnet/hudson/plugins/SSHBuildWrapper.java
          src/main/java/org/jvnet/hudson/plugins/SSHBuilder.java
          src/main/resources/org/jvnet/hudson/plugins/SSHBuildWrapper/config.jelly
          src/main/resources/org/jvnet/hudson/plugins/SSHBuilder/config.jelly
          http://jenkins-ci.org/commit/ssh-plugin/af0093c16fac47d82767c8b6b7cd1e4d814d6bc6
          Log:
          JENKINS-19973 Add option to hide ssh command from console output

          The commands are visible by default on both new configuration
          and the "migrated" ones to retain backward compatibility.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Lukasz Jader Path: src/main/java/org/jvnet/hudson/plugins/SSHBuildWrapper.java src/main/java/org/jvnet/hudson/plugins/SSHBuilder.java src/main/resources/org/jvnet/hudson/plugins/SSHBuildWrapper/config.jelly src/main/resources/org/jvnet/hudson/plugins/SSHBuilder/config.jelly http://jenkins-ci.org/commit/ssh-plugin/af0093c16fac47d82767c8b6b7cd1e4d814d6bc6 Log: JENKINS-19973 Add option to hide ssh command from console output The commands are visible by default on both new configuration and the "migrated" ones to retain backward compatibility.

          This has been implemented in 2.6.1 version of ssh-plugin, which was released today April 13th 2018.

          Łukasz Jąder added a comment - This has been implemented in 2.6.1 version of ssh-plugin, which was released today April 13th 2018.

          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/182
          And here is the link to a search for related issues: https://github.com/jenkinsci/publish-over-ssh-plugin/issues?q=%22JENKINS-19973%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/182 And here is the link to a search for related issues: https://github.com/jenkinsci/publish-over-ssh-plugin/issues?q=%22JENKINS-19973%22 (Note: this is an automated bulk comment)

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

              Created:
              Updated:
              Resolved: