public class Session
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Class and Description |
---|---|
private class |
Session.Forwarding |
private class |
Session.GlobalRequestReply |
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
agent_forwarding |
(package private) int |
auth_failures |
(package private) Buffer |
buf |
(package private) static int |
buffer_margin |
private Cipher |
c2scipher |
private int |
c2scipher_size |
private MAC |
c2smac |
(package private) int[] |
compress_len |
private java.util.Hashtable |
config |
private java.lang.Thread |
connectThread |
protected boolean |
daemon_thread |
private Compression |
deflater |
private byte[] |
Ec2s |
private byte[] |
Es2c |
private Session.GlobalRequestReply |
grr |
(package private) java.lang.String[] |
guess |
(package private) java.lang.String |
host |
private HostKey |
hostkey |
private java.lang.String |
hostKeyAlias |
private HostKeyRepository |
hostkeyRepository |
private byte[] |
I_C |
private byte[] |
I_S |
private IdentityRepository |
identityRepository |
(package private) java.io.InputStream |
in |
private boolean |
in_kex |
private boolean |
in_prompt |
private Compression |
inflater |
private IO |
io |
private boolean |
isAuthed |
private boolean |
isConnected |
private byte[] |
IVc2s |
private byte[] |
IVs2c |
(package private) JSch |
jsch |
private byte[] |
K_S |
private static byte[] |
keepalivemsg |
private long |
kex_start_time |
private java.lang.Object |
lock |
private byte[] |
MACc2s |
private byte[] |
MACs2c |
(package private) int |
max_auth_tries |
private static byte[] |
nomoresessions |
(package private) java.lang.String |
org_host |
(package private) java.io.OutputStream |
out |
(package private) Packet |
packet |
private static int |
PACKET_MAX_SIZE |
(package private) byte[] |
password |
(package private) int |
port |
private Proxy |
proxy |
(package private) static Random |
random |
private Cipher |
s2ccipher |
private int |
s2ccipher_size |
private MAC |
s2cmac |
private byte[] |
s2cmac_result1 |
private byte[] |
s2cmac_result2 |
private int |
seqi |
private int |
seqo |
private int |
serverAliveCountMax |
private int |
serverAliveInterval |
private byte[] |
session_id |
private java.net.Socket |
socket |
(package private) SocketFactory |
socket_factory |
(package private) static int |
SSH_MSG_CHANNEL_CLOSE |
(package private) static int |
SSH_MSG_CHANNEL_DATA |
(package private) static int |
SSH_MSG_CHANNEL_EOF |
(package private) static int |
SSH_MSG_CHANNEL_EXTENDED_DATA |
(package private) static int |
SSH_MSG_CHANNEL_FAILURE |
(package private) static int |
SSH_MSG_CHANNEL_OPEN |
(package private) static int |
SSH_MSG_CHANNEL_OPEN_CONFIRMATION |
(package private) static int |
SSH_MSG_CHANNEL_OPEN_FAILURE |
(package private) static int |
SSH_MSG_CHANNEL_REQUEST |
(package private) static int |
SSH_MSG_CHANNEL_SUCCESS |
(package private) static int |
SSH_MSG_CHANNEL_WINDOW_ADJUST |
(package private) static int |
SSH_MSG_DEBUG |
(package private) static int |
SSH_MSG_DISCONNECT |
(package private) static int |
SSH_MSG_GLOBAL_REQUEST |
(package private) static int |
SSH_MSG_IGNORE |
(package private) static int |
SSH_MSG_KEX_DH_GEX_GROUP |
(package private) static int |
SSH_MSG_KEX_DH_GEX_INIT |
(package private) static int |
SSH_MSG_KEX_DH_GEX_REPLY |
(package private) static int |
SSH_MSG_KEX_DH_GEX_REQUEST |
(package private) static int |
SSH_MSG_KEXDH_INIT |
(package private) static int |
SSH_MSG_KEXDH_REPLY |
(package private) static int |
SSH_MSG_KEXINIT |
(package private) static int |
SSH_MSG_NEWKEYS |
(package private) static int |
SSH_MSG_REQUEST_FAILURE |
(package private) static int |
SSH_MSG_REQUEST_SUCCESS |
(package private) static int |
SSH_MSG_SERVICE_ACCEPT |
(package private) static int |
SSH_MSG_SERVICE_REQUEST |
(package private) static int |
SSH_MSG_UNIMPLEMENTED |
(package private) java.lang.Runnable |
thread |
private int |
timeout |
(package private) int[] |
uncompress_len |
private UserInfo |
userinfo |
(package private) java.lang.String |
username |
private byte[] |
V_C |
private byte[] |
V_S |
(package private) boolean |
x11_forwarding |
Constructor and Description |
---|
Session(JSch jsch,
java.lang.String username,
java.lang.String host,
int port) |
Modifier and Type | Method and Description |
---|---|
private int |
_setPortForwardingR(java.lang.String bind_address,
int rport) |
private void |
_write(Packet packet) |
(package private) void |
addChannel(Channel channel) |
private void |
applyConfig() |
private void |
applyConfigChannel(ChannelSession channel) |
(package private) static boolean |
checkCipher(java.lang.String cipher) |
private java.lang.String[] |
checkCiphers(java.lang.String ciphers) |
private void |
checkConfig(ConfigRepository.Config config,
java.lang.String key) |
private void |
checkHost(java.lang.String chost,
int port,
KeyExchange kex) |
(package private) static boolean |
checkKex(Session s,
java.lang.String kex) |
private java.lang.String[] |
checkKexes(java.lang.String kexes) |
private java.lang.String[] |
checkSignatures(java.lang.String sigs) |
void |
connect() |
void |
connect(int connectTimeout) |
void |
delPortForwardingL(int lport)
Cancels the local port forwarding assigned
at local TCP port
lport on loopback interface. |
void |
delPortForwardingL(java.lang.String bind_address,
int lport)
Cancels the local port forwarding assigned
at local TCP port
lport on bind_address interface. |
void |
delPortForwardingR(int rport)
Cancels the remote port forwarding assigned at remote TCP port
rport . |
void |
delPortForwardingR(java.lang.String bind_address,
int rport)
Cancels the remote port forwarding assigned at
remote TCP port
rport bound on the interface at
bind_address . |
void |
disconnect() |
void |
encode(Packet packet) |
private byte[] |
expandKey(Buffer buf,
byte[] K,
byte[] H,
byte[] key,
HASH hash,
int required_length) |
java.lang.String |
getClientVersion() |
java.lang.String |
getConfig(java.lang.String key) |
java.lang.String |
getHost() |
HostKey |
getHostKey() |
java.lang.String |
getHostKeyAlias() |
HostKeyRepository |
getHostKeyRepository()
Gets the hostkeyRepository.
|
(package private) IdentityRepository |
getIdentityRepository()
Gets the identityRepository.
|
int |
getPort() |
java.lang.String[] |
getPortForwardingL()
Lists the registered local port forwarding.
|
java.lang.String[] |
getPortForwardingR()
Lists the registered remote port forwarding.
|
int |
getServerAliveCountMax()
Returns setting for the threshold to send keep-alive messages.
|
int |
getServerAliveInterval()
Returns setting for the interval to send a keep-alive message.
|
java.lang.String |
getServerVersion() |
(package private) byte[] |
getSessionId() |
Channel |
getStreamForwarder(java.lang.String host,
int port)
Instantiates an instance of stream-forwarder to
host :port . |
int |
getTimeout() |
UserInfo |
getUserInfo() |
java.lang.String |
getUserName() |
private void |
initDeflater(java.lang.String method) |
private void |
initInflater(java.lang.String method) |
boolean |
isConnected() |
void |
noMoreSessionChannels() |
Channel |
openChannel(java.lang.String type) |
private Session.Forwarding |
parseForwarding(java.lang.String conf)
The given argument may be "[bind_address:]port:host:hostport" or
"[bind_address:]port host:hostport", which is from LocalForward command of
~/.ssh/config .
|
Buffer |
read(Buffer buf) |
private KeyExchange |
receive_kexinit(Buffer buf) |
private void |
receive_newkeys(Buffer buf,
KeyExchange kex) |
void |
rekey() |
private void |
requestPortForwarding() |
void |
run() |
private void |
send_kexinit() |
private void |
send_newkeys() |
void |
sendIgnore() |
void |
sendKeepAliveMsg() |
void |
setClientVersion(java.lang.String cv) |
void |
setConfig(java.util.Hashtable newconf) |
void |
setConfig(java.util.Properties newconf) |
void |
setConfig(java.lang.String key,
java.lang.String value) |
void |
setDaemonThread(boolean enable) |
void |
setHost(java.lang.String host) |
void |
setHostKeyAlias(java.lang.String hostKeyAlias) |
void |
setHostKeyRepository(HostKeyRepository hostkeyRepository)
Sets the hostkeyRepository, which will be referred in checking host keys.
|
void |
setIdentityRepository(IdentityRepository identityRepository)
Sets the identityRepository, which will be referred
in the public key authentication.
|
void |
setInputStream(java.io.InputStream in) |
void |
setOutputStream(java.io.OutputStream out) |
void |
setPassword(byte[] password) |
void |
setPassword(java.lang.String password) |
void |
setPort(int port) |
int |
setPortForwardingL(int lport,
java.lang.String host,
int rport)
Registers the local port forwarding for loop-back interface.
|
int |
setPortForwardingL(java.lang.String conf)
Registers the local port forwarding.
|
int |
setPortForwardingL(java.lang.String bind_address,
int lport,
java.lang.String host,
int rport)
Registers the local port forwarding.
|
int |
setPortForwardingL(java.lang.String bind_address,
int lport,
java.lang.String host,
int rport,
ServerSocketFactory ssf)
Registers the local port forwarding.
|
int |
setPortForwardingL(java.lang.String bind_address,
int lport,
java.lang.String host,
int rport,
ServerSocketFactory ssf,
int connectTimeout)
Registers the local port forwarding.
|
void |
setPortForwardingR(int rport,
java.lang.String daemon)
Registers the remote port forwarding for the loopback interface
of the remote.
|
void |
setPortForwardingR(int rport,
java.lang.String host,
int lport)
Registers the remote port forwarding for the loopback interface
of the remote.
|
void |
setPortForwardingR(int rport,
java.lang.String host,
int lport,
SocketFactory sf)
Registers the remote port forwarding for the loopback interface
of the remote.
|
void |
setPortForwardingR(int rport,
java.lang.String daemon,
java.lang.Object[] arg)
Registers the remote port forwarding for the loopback interface
of the remote.
|
int |
setPortForwardingR(java.lang.String conf)
Registers the remote port forwarding.
|
void |
setPortForwardingR(java.lang.String bind_address,
int rport,
java.lang.String host,
int lport)
Registers the remote port forwarding.
|
void |
setPortForwardingR(java.lang.String bind_address,
int rport,
java.lang.String host,
int lport,
SocketFactory sf)
Registers the remote port forwarding.
|
void |
setPortForwardingR(java.lang.String bind_address,
int rport,
java.lang.String daemon,
java.lang.Object[] arg)
Registers the remote port forwarding.
|
void |
setProxy(Proxy proxy) |
void |
setServerAliveCountMax(int count)
Sets the number of keep-alive messages which may be sent without
receiving any messages back from the server.
|
void |
setServerAliveInterval(int interval)
Sets the interval to send a keep-alive message.
|
void |
setSocketFactory(SocketFactory sfactory) |
void |
setTimeout(int timeout) |
void |
setUserInfo(UserInfo userinfo) |
(package private) void |
setUserName(java.lang.String username) |
void |
setX11Cookie(java.lang.String cookie) |
void |
setX11Host(java.lang.String host) |
void |
setX11Port(int port) |
private void |
start_discard(Buffer buf,
Cipher cipher,
MAC mac,
int packet_length,
int discard) |
private void |
updateKeys(KeyExchange kex) |
void |
write(Packet packet) |
(package private) void |
write(Packet packet,
Channel c,
int length) |
static final int SSH_MSG_DISCONNECT
static final int SSH_MSG_IGNORE
static final int SSH_MSG_UNIMPLEMENTED
static final int SSH_MSG_DEBUG
static final int SSH_MSG_SERVICE_REQUEST
static final int SSH_MSG_SERVICE_ACCEPT
static final int SSH_MSG_KEXINIT
static final int SSH_MSG_NEWKEYS
static final int SSH_MSG_KEXDH_INIT
static final int SSH_MSG_KEXDH_REPLY
static final int SSH_MSG_KEX_DH_GEX_GROUP
static final int SSH_MSG_KEX_DH_GEX_INIT
static final int SSH_MSG_KEX_DH_GEX_REPLY
static final int SSH_MSG_KEX_DH_GEX_REQUEST
static final int SSH_MSG_GLOBAL_REQUEST
static final int SSH_MSG_REQUEST_SUCCESS
static final int SSH_MSG_REQUEST_FAILURE
static final int SSH_MSG_CHANNEL_OPEN
static final int SSH_MSG_CHANNEL_OPEN_CONFIRMATION
static final int SSH_MSG_CHANNEL_OPEN_FAILURE
static final int SSH_MSG_CHANNEL_WINDOW_ADJUST
static final int SSH_MSG_CHANNEL_DATA
static final int SSH_MSG_CHANNEL_EXTENDED_DATA
static final int SSH_MSG_CHANNEL_EOF
static final int SSH_MSG_CHANNEL_CLOSE
static final int SSH_MSG_CHANNEL_REQUEST
static final int SSH_MSG_CHANNEL_SUCCESS
static final int SSH_MSG_CHANNEL_FAILURE
private static final int PACKET_MAX_SIZE
private byte[] V_S
private byte[] V_C
private byte[] I_C
private byte[] I_S
private byte[] K_S
private byte[] session_id
private byte[] IVc2s
private byte[] IVs2c
private byte[] Ec2s
private byte[] Es2c
private byte[] MACc2s
private byte[] MACs2c
private int seqi
private int seqo
java.lang.String[] guess
private Cipher s2ccipher
private Cipher c2scipher
private MAC s2cmac
private MAC c2smac
private byte[] s2cmac_result1
private byte[] s2cmac_result2
private Compression deflater
private Compression inflater
private IO io
private java.net.Socket socket
private int timeout
private volatile boolean isConnected
private boolean isAuthed
private java.lang.Thread connectThread
private java.lang.Object lock
boolean x11_forwarding
boolean agent_forwarding
java.io.InputStream in
java.io.OutputStream out
static Random random
Buffer buf
Packet packet
SocketFactory socket_factory
static final int buffer_margin
private java.util.Hashtable config
private Proxy proxy
private UserInfo userinfo
private java.lang.String hostKeyAlias
private int serverAliveInterval
private int serverAliveCountMax
private IdentityRepository identityRepository
private HostKeyRepository hostkeyRepository
protected boolean daemon_thread
private long kex_start_time
int max_auth_tries
int auth_failures
java.lang.String host
java.lang.String org_host
int port
java.lang.String username
byte[] password
JSch jsch
private volatile boolean in_kex
private volatile boolean in_prompt
int[] uncompress_len
int[] compress_len
private int s2ccipher_size
private int c2scipher_size
java.lang.Runnable thread
private Session.GlobalRequestReply grr
private static final byte[] keepalivemsg
private static final byte[] nomoresessions
private HostKey hostkey
Session(JSch jsch, java.lang.String username, java.lang.String host, int port) throws JSchException
JSchException
public void connect() throws JSchException
JSchException
public void connect(int connectTimeout) throws JSchException
JSchException
private KeyExchange receive_kexinit(Buffer buf) throws java.lang.Exception
java.lang.Exception
public void rekey() throws java.lang.Exception
java.lang.Exception
private void send_kexinit() throws java.lang.Exception
java.lang.Exception
private void send_newkeys() throws java.lang.Exception
java.lang.Exception
private void checkHost(java.lang.String chost, int port, KeyExchange kex) throws JSchException
JSchException
public Channel openChannel(java.lang.String type) throws JSchException
JSchException
public void encode(Packet packet) throws java.lang.Exception
java.lang.Exception
private void start_discard(Buffer buf, Cipher cipher, MAC mac, int packet_length, int discard) throws JSchException, java.io.IOException
JSchException
java.io.IOException
byte[] getSessionId()
private void receive_newkeys(Buffer buf, KeyExchange kex) throws java.lang.Exception
java.lang.Exception
private void updateKeys(KeyExchange kex) throws java.lang.Exception
java.lang.Exception
private byte[] expandKey(Buffer buf, byte[] K, byte[] H, byte[] key, HASH hash, int required_length) throws java.lang.Exception
java.lang.Exception
void write(Packet packet, Channel c, int length) throws java.lang.Exception
java.lang.Exception
public void write(Packet packet) throws java.lang.Exception
java.lang.Exception
private void _write(Packet packet) throws java.lang.Exception
java.lang.Exception
public void run()
run
in interface java.lang.Runnable
public void disconnect()
public int setPortForwardingL(int lport, java.lang.String host, int rport) throws JSchException
lport
is 0
, the tcp port will be allocated.lport
- local port for local port forwardinghost
- host address for local port forwardingrport
- remote port number for local port forwardingJSchException
setPortForwardingL(String bind_address, int lport, String host, int rport, ServerSocketFactory ssf, int connectTimeout)
public int setPortForwardingL(java.lang.String bind_address, int lport, java.lang.String host, int rport) throws JSchException
bind_address
is an empty string
or '*', the port should be available from all interfaces.
If bind_address
is "localhost"
or
null
, the listening port will be bound for local use only.
If lport
is 0
, the tcp port will be allocated.bind_address
- bind address for local port forwardinglport
- local port for local port forwardinghost
- host address for local port forwardingrport
- remote port number for local port forwardingJSchException
setPortForwardingL(String bind_address, int lport, String host, int rport, ServerSocketFactory ssf, int connectTimeout)
public int setPortForwardingL(java.lang.String bind_address, int lport, java.lang.String host, int rport, ServerSocketFactory ssf) throws JSchException
bind_address
is an empty string or "*"
,
the port should be available from all interfaces.
If bind_address
is "localhost"
or
null
, the listening port will be bound for local use only.
If lport
is 0
, the tcp port will be allocated.bind_address
- bind address for local port forwardinglport
- local port for local port forwardinghost
- host address for local port forwardingrport
- remote port number for local port forwardingssf
- socket factoryJSchException
setPortForwardingL(String bind_address, int lport, String host, int rport, ServerSocketFactory ssf, int connectTimeout)
public int setPortForwardingL(java.lang.String bind_address, int lport, java.lang.String host, int rport, ServerSocketFactory ssf, int connectTimeout) throws JSchException
bind_address
is an empty string
or "*"
, the port should be available from all interfaces.
If bind_address
is "localhost"
or
null
, the listening port will be bound for local use only.
If lport
is 0
, the tcp port will be allocated.bind_address
- bind address for local port forwardinglport
- local port for local port forwardinghost
- host address for local port forwardingrport
- remote port number for local port forwardingssf
- socket factoryconnectTimeout
- timeout for establishing port connectionJSchException
public void delPortForwardingL(int lport) throws JSchException
lport
on loopback interface.lport
- local TCP portJSchException
public void delPortForwardingL(java.lang.String bind_address, int lport) throws JSchException
lport
on bind_address
interface.bind_address
- bind_address of network interfaceslport
- local TCP portJSchException
public java.lang.String[] getPortForwardingL() throws JSchException
JSchException
public void setPortForwardingR(int rport, java.lang.String host, int lport) throws JSchException
rport
- remote porthost
- host addresslport
- local portJSchException
setPortForwardingR(String bind_address, int rport, String host, int lport, SocketFactory sf)
public void setPortForwardingR(java.lang.String bind_address, int rport, java.lang.String host, int lport) throws JSchException
bind_address
is an empty string or "*"
,
the port should be available from all interfaces.
If bind_address
is "localhost"
or is not given,
the listening port will be bound for local use only.
Note that if GatewayPorts
is "no"
on the
remote, "localhost"
is always used as a bind_address.bind_address
- bind addressrport
- remote porthost
- host addresslport
- local portJSchException
setPortForwardingR(String bind_address, int rport, String host, int lport, SocketFactory sf)
public void setPortForwardingR(int rport, java.lang.String host, int lport, SocketFactory sf) throws JSchException
rport
- remote porthost
- host addresslport
- local portsf
- socket factoryJSchException
setPortForwardingR(String bind_address, int rport, String host, int lport, SocketFactory sf)
public void setPortForwardingR(java.lang.String bind_address, int rport, java.lang.String host, int lport, SocketFactory sf) throws JSchException
bind_address
is an empty string or "*"
,
the port should be available from all interfaces.
If bind_address
is "localhost"
or is not given,
the listening port will be bound for local use only.
Note that if GatewayPorts
is "no"
on the
remote, "localhost"
is always used as a bind_address.
If rport
is 0
, the TCP port will be allocated on the remote.bind_address
- bind addressrport
- remote porthost
- host addresslport
- local portsf
- socket factoryJSchException
public void setPortForwardingR(int rport, java.lang.String daemon) throws JSchException
rport
on the remote will be
forwarded to an instance of the class daemon
.
The class specified by daemon
must implement
ForwardedTCPIPDaemon
.rport
- remote portdaemon
- class name, which implements "ForwardedTCPIPDaemon"JSchException
setPortForwardingR(String bind_address, int rport, String daemon, Object[] arg)
public void setPortForwardingR(int rport, java.lang.String daemon, java.lang.Object[] arg) throws JSchException
rport
on the remote will be
forwarded to an instance of the class daemon
with
the argument arg
.
The class specified by daemon
must implement ForwardedTCPIPDaemon
.rport
- remote portdaemon
- class name, which implements "ForwardedTCPIPDaemon"arg
- arguments for "daemon"JSchException
setPortForwardingR(String bind_address, int rport, String daemon, Object[] arg)
public void setPortForwardingR(java.lang.String bind_address, int rport, java.lang.String daemon, java.lang.Object[] arg) throws JSchException
bind_address
is an empty string
or "*"
, the port should be available from all interfaces.
If bind_address
is "localhost"
or is not given,
the listening port will be bound for local use only.
Note that if GatewayPorts
is "no"
on the
remote, "localhost"
is always used as a bind_address.
The TCP connection to rport
on the remote will be
forwarded to an instance of the class daemon
with the
argument arg
.
The class specified by daemon
must implement ForwardedTCPIPDaemon
.bind_address
- bind addressrport
- remote portdaemon
- class name, which implements "ForwardedTCPIPDaemon"arg
- arguments for "daemon"JSchException
setPortForwardingR(String bind_address, int rport, String daemon, Object[] arg)
public java.lang.String[] getPortForwardingR() throws JSchException
JSchException
private Session.Forwarding parseForwarding(java.lang.String conf) throws JSchException
JSchException
public int setPortForwardingL(java.lang.String conf) throws JSchException
bind_address
is an empty string or "*"
,
the port should be available from all interfaces.
If bind_address
is "localhost"
or is not given,
the listening port will be bound for local use only.conf
- configuration of local port forwardingJSchException
setPortForwardingL(String bind_address, int lport, String host, int rport)
public int setPortForwardingR(java.lang.String conf) throws JSchException
"*"
or an empty string,
then the forwarding is requested to listen on all interfaces.
Note that if GatewayPorts
is "no"
on the remote,
"localhost"
is always used for bind_address.
If the specified remote is "0"
,
the TCP port will be allocated on the remote.conf
- configuration of remote port forwardingJSchException
setPortForwardingR(String bind_address, int rport, String host, int rport)
public Channel getStreamForwarder(java.lang.String host, int port) throws JSchException
host
:port
.
Set I/O stream to the given channel, and then invoke Channel#connect() method.host
- remote host, which the given stream will be plugged to.port
- remote port, which the given stream will be plugged to.JSchException
private int _setPortForwardingR(java.lang.String bind_address, int rport) throws JSchException
JSchException
public void delPortForwardingR(int rport) throws JSchException
rport
.rport
- remote TCP portJSchException
public void delPortForwardingR(java.lang.String bind_address, int rport) throws JSchException
rport
bound on the interface at
bind_address
.bind_address
- bind address of the interface on the remoterport
- remote TCP portJSchException
private void initDeflater(java.lang.String method) throws JSchException
JSchException
private void initInflater(java.lang.String method) throws JSchException
JSchException
void addChannel(Channel channel)
public void setProxy(Proxy proxy)
public void setHost(java.lang.String host)
public void setPort(int port)
void setUserName(java.lang.String username)
public void setUserInfo(UserInfo userinfo)
public UserInfo getUserInfo()
public void setInputStream(java.io.InputStream in)
public void setOutputStream(java.io.OutputStream out)
public void setX11Host(java.lang.String host)
public void setX11Port(int port)
public void setX11Cookie(java.lang.String cookie)
public void setPassword(java.lang.String password)
public void setPassword(byte[] password)
public void setConfig(java.util.Properties newconf)
public void setConfig(java.util.Hashtable newconf)
public void setConfig(java.lang.String key, java.lang.String value)
public java.lang.String getConfig(java.lang.String key)
public void setSocketFactory(SocketFactory sfactory)
public boolean isConnected()
public int getTimeout()
public void setTimeout(int timeout) throws JSchException
JSchException
public java.lang.String getServerVersion()
public java.lang.String getClientVersion()
public void setClientVersion(java.lang.String cv)
public void sendIgnore() throws java.lang.Exception
java.lang.Exception
public void sendKeepAliveMsg() throws java.lang.Exception
java.lang.Exception
public void noMoreSessionChannels() throws java.lang.Exception
java.lang.Exception
public HostKey getHostKey()
public java.lang.String getHost()
public java.lang.String getUserName()
public int getPort()
public void setHostKeyAlias(java.lang.String hostKeyAlias)
public java.lang.String getHostKeyAlias()
public void setServerAliveInterval(int interval) throws JSchException
interval
- the specified interval, in milliseconds.JSchException
getServerAliveInterval()
public int getServerAliveInterval()
setServerAliveInterval(int)
public void setServerAliveCountMax(int count)
count
- the specified countgetServerAliveCountMax()
public int getServerAliveCountMax()
setServerAliveCountMax(int)
public void setDaemonThread(boolean enable)
private java.lang.String[] checkCiphers(java.lang.String ciphers)
static boolean checkCipher(java.lang.String cipher)
private java.lang.String[] checkKexes(java.lang.String kexes)
static boolean checkKex(Session s, java.lang.String kex)
private java.lang.String[] checkSignatures(java.lang.String sigs)
public void setIdentityRepository(IdentityRepository identityRepository)
null
.identityRepository
- getIdentityRepository()
IdentityRepository getIdentityRepository()
null
,
JSch#getIdentityRepository() will be invoked.JSch.getIdentityRepository()
public void setHostKeyRepository(HostKeyRepository hostkeyRepository)
hostkeyRepository
- getHostKeyRepository()
public HostKeyRepository getHostKeyRepository()
null
,
JSch#getHostKeyRepository() will be invoked.JSch.getHostKeyRepository()
private void applyConfig() throws JSchException
JSchException
private void applyConfigChannel(ChannelSession channel) throws JSchException
JSchException
private void requestPortForwarding() throws JSchException
JSchException
private void checkConfig(ConfigRepository.Config config, java.lang.String key)