Establishing a connection

Top  Previous  Next

To establish a connection create a com.jscape.inet.ssh.util.SshParameters instance providing hostname, username and password arguments. Using this constructor you will authenticate with the server using username/password authentication. In addition to username/password authentication the Scp class also supports public key authentication. Using the newly created SshParameters instance as an argument to the constructor, construct a new com.jscape.inet.scp.Scp instance and invoke the Scp#connect method.

 

Example

 

import com.jscape.inet.ssh.util.*;

import com.jscape.inet.scp.*;

 

// create a new SshParameters instance with authentication info

SshParameters sshParams(hostanme,username,password);

 

// create a new Scp instance    

Scp scp = new Scp(sshParams);

 

// establish a connection

scp.connect();

 

 

See also Public key authentication

 





Home | Company | Products | Solutions | Purchase | Support | Services | Blog

© 2021 JSCAPE LLC