init: connection made
This commit is contained in:
commit
c0d58cd349
6 changed files with 415 additions and 0 deletions
20
src/main.rs
Normal file
20
src/main.rs
Normal file
|
@ -0,0 +1,20 @@
|
|||
use std::net::TcpStream;
|
||||
use ssh2::Session;
|
||||
|
||||
const EDI_IP: &str = "100.94.173.5";
|
||||
|
||||
fn main() {
|
||||
|
||||
// Connect to the local SSH server
|
||||
let tcp = TcpStream::connect("100.94.173.5:22").unwrap();
|
||||
let mut sess = Session::new().unwrap();
|
||||
sess.set_tcp_stream(tcp);
|
||||
sess.handshake().unwrap();
|
||||
|
||||
// Try to authenticate with the first identity in the agent.
|
||||
sess.userauth_agent("aaronh").unwrap();
|
||||
|
||||
// Make sure we succeeded
|
||||
assert!(sess.authenticated());
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue