code: private void verifyNoHeaderJunk(TaskListener listener) throws IOException, InterruptedException {
          ByteArrayOutputStream baos = new ByteArrayOutputStream();
          connection.exec("exit 0",baos);
          final String s;
          //TODO: Seems we need to retrieve the encoding from the connection destination
          try {
              s = baos.toString(Charset.defaultCharset().name());
          } catch (UnsupportedEncodingException ex) { // Should not happen
              throw new IOException("Default encoding is unsupported", ex);
          }
          
          if (s.length()!=0) {
              listener.getLogger().println(Messages.SSHLauncher_SSHHeaderJunkDetected());
              listener.getLogger().println(s);
              throw new AbortException();
          }
      }
docs: Makes sure that SSH connection won't produce any unwanted text, which will interfere with sftp execution.