Struct ssh::Session
[−]
[src]
pub struct Session { /* fields omitted */ }
Methods
impl Session
[src]
fn new() -> Result<Session, ()>
fn set_host(&mut self, v: &str) -> Result<(), Error>
fn set_port(&mut self, v: usize) -> Result<(), Error>
fn set_username(&mut self, v: &str) -> Result<(), Error>
fn set_ssh_dir<P: AsRef<Path>>(&mut self, v: P) -> Result<(), Error>
Set the location of the ".ssh" directory, where the config file and keys can be found (it may include "%s", which will be replaced by the user home directory).
fn set_knownhosts<P: AsRef<Path>>(&mut self, v: P) -> Result<(), Error>
Set the location of the "knownhosts" file (it may include "%s", which will be replaced by the user home directory).
fn set_identity<P: AsRef<Path>>(&mut self, v: P) -> Result<(), Error>
Set the location of the key to be used for authentication (it may include "%s", which will be replaced by the user home directory).
fn set_ssh1(&mut self, v: bool) -> Result<(), Error>
Allow version 1 of the protocol (default unspecified).
fn set_ssh2(&mut self, v: bool) -> Result<(), Error>
Allow version 1 of the protocol (default unspecified).
fn parse_config(&mut self, path: Option<&Path>) -> Result<(), Error>
Parse configuration file. If the path is None
, then ~/.ssh/config
is read.
fn is_server_known(&mut self) -> Result<ServerKnown, Error>
Check whether the remote server's key is known.
fn write_knownhost(&mut self) -> Result<(), Error>
Accept the remote server's key.
fn get_pubkey_hash(&mut self) -> Result<Vec<u8>, Error>
Get a hash of the server's public key
fn connect(&mut self) -> Result<(), Error>
fn disconnect(&mut self) -> Result<(), Error>
Disconnect the session. The session can be reused later to open a new session.
fn userauth_password(&mut self, p: &str) -> Result<(), Error>
Authenticate with a password.
fn userauth_kbdint(&mut self, user: Option<&str>) -> Result<(), Error>
Print a prompt on the standard output, and then ask the user a password on the standard input. The typed password is not echoed.
fn userauth_publickey_auto(&mut self, p: Option<&str>) -> Result<(), Error>
Print a prompt on the standard output, and then ask the user a password on the standard input. The typed password is not echoed.
fn scp_new<'b, P: AsRef<Path>>(
&'b mut self,
mode: Mode,
v: P
) -> Result<Scp<'b>, Error>
&'b mut self,
mode: Mode,
v: P
) -> Result<Scp<'b>, Error>
Start an SCP connection.
fn channel_new<'b>(&'b mut self) -> Result<Channel<'b>, Error>
Start a channel to issue remote commands.