j2ssh-advanced.htm
来自「j2ssh document for java dev」· HTM 代码 · 共 47 行
HTM
47 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<h2><font face="Verdana, Arial, Helvetica, sans-serif"><a name="top"></a>J2SSH - Advanced Connectivity</font></h2>
<p><a href="#connectionproperties">Connection Properties</a><br>
<a href="#profiles">Connection Profiles</a><br>
<a href="#monitor">Monitoring the Connection State</a><br>
<a href="#serverhostkey">Verifying the Server's Host Key</a></font>
</p>
</p>
<p><a name="connectionproperties"></a><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong><em>Connection
Properties</em></strong></font></p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Each SSH connection
has a number of components, they include encryption ciphers, message authentication
algorithms and compression settings. The SSH protocol states that these components
must run independently of each other in both directions on the connection. The
following class makes it possible to configure these settings:</font>
<blockquote><pre>import com.sshtools.j2ssh.configuration.SshConnectionProperties</pre></blockquote>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">When using the
SshClient connect method, it is possible to pass an SshConnectionProperties
instance instead of<br>
a hostname.</font></p>
<blockquote>
<pre>SshConnectionProperties properties = new SshConnectionProperties();<br>
properties.setHost("firestar");
properties.setPort(22);<br>
ssh.connect(properties);</pre>
</blockquote>
<p><font face="Verdana, Arial, Helvetica, sans-serif"><font size="2">There are
additional methods to set the preferred ciphers:</font></font></p>
<blockquote>
<pre>// Sets the preferred client->server encryption cipher
properties.setPrefCSEncryption("blowfish-cbc");<br>
// Sets the preferred server->client encryption cipher
properties.setPrefSCEncryption("3des-cbc");</pre>
</blockquote>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">The parameter passed
should be the name of the SSH cipher that you require, this can be any installed
cipher, the following are currently supported.</font></p> </p>
<blockquote>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?