Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are libraries are available to invoke ssh. The <a href="http://www.jcraft.com/jsch/examples/" rel="nofollow"><strong><em>Java Secure Channel (JSCH)</em></strong></a> is a very popular library, used by maven, ant and eclipse. It is open source with a BSD style license.</p> <p>If you need authentication for ssh, you can use through java. </p> <p>If your still need to by pass password passing, there are two ways to do what you want. One involves a stored password, and one does not. </p> <p>Both are non-interactive, meaning that they can work when you're not there to enter a password.</p> <ol> <li><p>The way that does not require a password. You can use public/private key authentication instead of passwords with SSH. I'm going to assume that you're using OpenSSH, which comes with practically every Linux distribution.</p> <p><strong>Steps :</strong></p> <ul> <li><p>Configure your SSH server to accept private key logins. In /etc/ssh/sshd_config make sure that there's a line that says PubkeyAuthentication yes (and that there is no # infront of it). If you change this file, you need to restart the sshd service.</p></li> <li><p>On your local machine (not the server), create yourself a pair of keys with <strong>ssh-keygen -t rsa</strong> (you can use other options than rsa, but I'm keeping it simple). Do not specify a password. Save the keys in the locations prompted.</p></li> <li><p>Open the contents of the id_rsa.pub file that you just created (it's one very long line of text), and copy the contents into the end of the file $HOME/.ssh/authorized_keys on the server machine. Create the file if it doesn't exist.</p></li> </ul> <p><a href="http://www.ibm.com/developerworks/library/l-keyc/index.html" rel="nofollow">Further Detail refer here</a>.</p></li> <li><p>The basic idea is to use expect, which is an administration automation tool, to type your password in to ssh when prompted. It might not always work, and when it doesn't, it's hard to figure out why not. I recommend the first method.</p> <p>Anyway, here's a command that you can poke at until it does what you want.</p></li> </ol> <p>The script Code is:</p> <pre><code> expect -c 'spawn ssh user@remote.host ; expect assword ; send "passphrase\n" ; interact' </code></pre> <p>Expect might not be installed on your system. Make sure install that</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload