Struct thrussh::client::Session
[−]
[src]
pub struct Session(pub CommonSession<Arc<Config>>);
The type of a client session.
Methods
impl Session
[src]
pub fn flush(&mut self) -> Result<(), Error>
[src]
Flush the temporary cleartext buffer into the encryption buffer. This does not flush to the socket.
pub fn config(&self) -> &Config
[src]
Retrieves the configuration of this session.
pub fn auth_user(&self) -> &str
[src]
Retrieves the current user.
pub fn disconnect(
&mut self,
reason: Disconnect,
description: &str,
language_tag: &str
)
[src]
&mut self,
reason: Disconnect,
description: &str,
language_tag: &str
)
Sends a disconnect message.
pub fn is_authenticated(&self) -> bool
[src]
Whether the client is authenticated.
pub fn is_disconnected(&self) -> bool
[src]
Whether the client is disconnected.
pub fn channel_is_open(&self, channel: ChannelId) -> bool
[src]
Check whether a channel has been confirmed.
pub fn has_auth_method(&self) -> bool
[src]
Tests whether we need an authentication method (for instance if the last attempt failed).
pub fn valid_auth_methods(&self) -> Option<MethodSet>
[src]
Returns the set of authentication methods that can continue, or None if this is not valid.
pub fn channel_open_session(&mut self) -> Result<ChannelId, Error>
[src]
Request a session channel (the most basic type of
channel). This function returns Some(..)
immediately if the
connection is authenticated, but the channel only becomes
usable when it's confirmed by the server, as indicated by the
confirmed
field of the corresponding Channel
.
pub fn channel_open_x11(
&mut self,
originator_address: &str,
originator_port: u32
) -> Result<ChannelId, Error>
[src]
&mut self,
originator_address: &str,
originator_port: u32
) -> Result<ChannelId, Error>
Request an X11 channel, on which the X11 protocol may be tunneled.
pub fn channel_open_direct_tcpip(
&mut self,
host_to_connect: &str,
port_to_connect: u32,
originator_address: &str,
originator_port: u32
) -> Result<ChannelId, Error>
[src]
&mut self,
host_to_connect: &str,
port_to_connect: u32,
originator_address: &str,
originator_port: u32
) -> Result<ChannelId, Error>
Open a TCP/IP forwarding channel. This is usually done when a
connection comes to a locally forwarded TCP/IP port. See
RFC4254. The
TCP/IP packets can then be tunneled through the channel using
.data()
.
pub fn channel_eof(&mut self, channel: ChannelId)
[src]
Send EOF to a channel
pub fn request_pty(
&mut self,
channel: ChannelId,
want_reply: bool,
term: &str,
col_width: u32,
row_height: u32,
pix_width: u32,
pix_height: u32,
terminal_modes: &[(Pty, u32)]
)
[src]
&mut self,
channel: ChannelId,
want_reply: bool,
term: &str,
col_width: u32,
row_height: u32,
pix_width: u32,
pix_height: u32,
terminal_modes: &[(Pty, u32)]
)
Request a pseudo-terminal with the given characteristics.
pub fn request_x11(
&mut self,
channel: ChannelId,
want_reply: bool,
single_connection: bool,
x11_authentication_protocol: &str,
x11_authentication_cookie: &str,
x11_screen_number: u32
)
[src]
&mut self,
channel: ChannelId,
want_reply: bool,
single_connection: bool,
x11_authentication_protocol: &str,
x11_authentication_cookie: &str,
x11_screen_number: u32
)
Request X11 forwarding through an already opened X11 channel. See RFC4254 for security issues related to cookies.
pub fn set_env(
&mut self,
channel: ChannelId,
want_reply: bool,
variable_name: &str,
variable_value: &str
)
[src]
&mut self,
channel: ChannelId,
want_reply: bool,
variable_name: &str,
variable_value: &str
)
Set a remote environment variable.
pub fn request_shell(&mut self, want_reply: bool, channel: ChannelId)
[src]
Request a remote shell.
pub fn exec(&mut self, channel: ChannelId, want_reply: bool, command: &str)
[src]
Execute a remote program (will be passed to a shell). This can be used to implement scp (by calling a remote scp and tunneling to its standard input).
pub fn signal(&mut self, channel: ChannelId, signal: Sig)
[src]
Signal a remote process.
pub fn request_subsystem(
&mut self,
want_reply: bool,
channel: ChannelId,
name: &str
)
[src]
&mut self,
want_reply: bool,
channel: ChannelId,
name: &str
)
Request the start of a subsystem with the given name.
pub fn window_change(
&mut self,
channel: ChannelId,
col_width: u32,
row_height: u32,
pix_width: u32,
pix_height: u32
)
[src]
&mut self,
channel: ChannelId,
col_width: u32,
row_height: u32,
pix_width: u32,
pix_height: u32
)
Inform the server that our window size has changed.
pub fn tcpip_forward(&mut self, want_reply: bool, address: &str, port: u32)
[src]
Request the forwarding of a remote port to the client. The
server will then open forwarding channels (which cause the
client to call .channel_open_forwarded_tcpip()
).
pub fn cancel_tcpip_forward(
&mut self,
want_reply: bool,
address: &str,
port: u32
)
[src]
&mut self,
want_reply: bool,
address: &str,
port: u32
)
Cancel a previous forwarding request.
pub fn data(
&mut self,
channel: ChannelId,
extended: Option<u32>,
data: &[u8]
) -> usize
[src]
&mut self,
channel: ChannelId,
extended: Option<u32>,
data: &[u8]
) -> usize
Send data to a channel. The number of bytes added to the "sending pipeline" (to be processed by the event loop) is returned.