title: How to run SSH command in android programmatically
body: <p>I would like to run a simple SSH command like <code>ssh -R 80:localhost:1337 serveo.net</code> , I know there is library <a href="http://www.jcraft.com/jsch/" rel="nofollow noreferrer">jsch</a> to do this , but it will not work without username and password . In my case there is no authentication is required . How can I do this ?</p>
  <p><strong>Update</strong>
  When I run the command <code>ssh -R 80:localhost:1337 serveo.net -v</code>, I get the following output</p>
  <pre><code>debug1: Server host key: ssh-rsa SHA256:07jcXlJ4SkBnyTmaVnmTpXuBiRx2+Q2adxbttO9gt0M
  The authenticity of host 'serveo.net (159.89.214.31)' can't be established.
  RSA key fingerprint is SHA256:07jcXlJ4SkBnyTmaVnmTpXuBiRx2+Q2adxbttO9gt0M.
  Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
  Warning: Permanently added 'serveo.net,159.89.214.31' (RSA) to the list of known hosts.
  debug1: rekey out after 134217728 blocks
  debug1: SSH2_MSG_NEWKEYS sent
  debug1: expecting SSH2_MSG_NEWKEYS
  debug1: SSH2_MSG_NEWKEYS received
  debug1: rekey in after 134217728 blocks
  debug1: Will attempt key: /home/paranoid/.ssh/id_rsa 
  debug1: Will attempt key: /home/paranoid/.ssh/id_dsa 
  debug1: Will attempt key: /home/paranoid/.ssh/id_ecdsa 
  debug1: Will attempt key: /home/paranoid/.ssh/id_ecdsa_sk 
  debug1: Will attempt key: /home/paranoid/.ssh/id_ed25519 
  debug1: Will attempt key: /home/paranoid/.ssh/id_ed25519_sk 
  debug1: Will attempt key: /home/paranoid/.ssh/id_xmss 
  debug1: SSH2_MSG_SERVICE_ACCEPT received
  debug1: Authentications that can continue: publickey,keyboard-interactive
  debug1: Next authentication method: publickey
  debug1: Trying private key: /home/paranoid/.ssh/id_rsa
  debug1: Trying private key: /home/paranoid/.ssh/id_dsa
  debug1: Trying private key: /home/paranoid/.ssh/id_ecdsa
  debug1: Trying private key: /home/paranoid/.ssh/id_ecdsa_sk
  debug1: Trying private key: /home/paranoid/.ssh/id_ed25519
  debug1: Trying private key: /home/paranoid/.ssh/id_ed25519_sk
  debug1: Trying private key: /home/paranoid/.ssh/id_xmss
  debug1: Next authentication method: keyboard-interactive
  debug1: Authentication succeeded (keyboard-interactive).
  Authenticated to serveo.net ([159.89.214.31]:22).
  debug1: Remote connections from LOCALHOST:80 forwarded to local address localhost:1337
  debug1: channel 0: new [client-session]
  debug1: Entering interactive session.
  debug1: pledge: network
  debug1: Sending environment.
  debug1: Sending env LC_ADDRESS = en_US.UTF-8
  debug1: Sending env LC_NAME = en_US.UTF-8
  debug1: Sending env LC_MONETARY = en_US.UTF-8
  debug1: Sending env LC_PAPER = en_US.UTF-8
  debug1: Sending env LANG = en_US.UTF-8
  debug1: Sending env LC_IDENTIFICATION = en_US.UTF-8
  debug1: Sending env LC_TELEPHONE = en_US.UTF-8
  debug1: Sending env LC_MEASUREMENT = en_US.UTF-8
  debug1: Sending env LC_TIME = en_US.UTF-8
  debug1: Sending env LC_NUMERIC = en_US.UTF-8
  debug1: remote forward success for: listen 80, connect localhost:1337
  debug1: All remote forwarding requests processed
  Forwarding HTTP traffic from https://vacuus.serveousercontent.com
  
  </code></pre>
  <p>It also creates <code>known_hosts</code> file inside <code>.ssh</code> folder. The content of <code>known_hosts</code> id following</p>
  <pre><code>|1|2K3SBFWPCPqI3poBW2X99LiuP8c=|cqCa7m1e23x1P9UpcUuPac+KKI8= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDxYGqSKVwJpQD1F0YIhz+bd5lpl7YesKjtrn1QD1RjQcSj724lJdCwlv4J8PcLuFFtlAA8AbGQju7qWdMN9ihdHvRcWf0tSjZ+bzwYkxaCydq4JnCrbvLJPwLFaqV1NdcOzY2NVLuX5CfY8VTHrps49LnO0QpGaavqrbk+wTWDD9MHklNfJ1zSFpQAkSQnSNSYi/M2J3hX7P0G2R7dsUvNov+UgNKpc4n9+Lq5Vmcqjqo2KhFyHP0NseDLpgjaqGJq2Kvit3QowhqZkK4K77AA65CxZjdDfpjwZSuX075F9vNi0IFpFkGJW9KlrXzI4lIzSAjPZBURhUb8nZSiPuzj
  |1|F1SIE4/IIEjZPJfHBIx90xnSjSU=|NKCdGqv3SFcGcAqPLvVfuRXI4Ok= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDxYGqSKVwJpQD1F0YIhz+bd5lpl7YesKjtrn1QD1RjQcSj724lJdCwlv4J8PcLuFFtlAA8AbGQju7qWdMN9ihdHvRcWf0tSjZ+bzwYkxaCydq4JnCrbvLJPwLFaqV1NdcOzY2NVLuX5CfY8VTHrps49LnO0QpGaavqrbk+wTWDD9MHklNfJ1zSFpQAkSQnSNSYi/M2J3hX7P0G2R7dsUvNov+UgNKpc4n9+Lq5Vmcqjqo2KhFyHP0NseDLpgjaqGJq2Kvit3QowhqZkK4K77AA65CxZjdDfpjwZSuX075F9vNi0IFpFkGJW9KlrXzI4lIzSAjPZBURhUb8nZSiPuzj
  </code></pre>