split username and ip/host
This commit is contained in:
parent
8da5b1fa05
commit
f2a26baf97
1 changed files with 4 additions and 2 deletions
|
@ -12,13 +12,15 @@ use emojis_rs::*;
|
|||
struct Args {
|
||||
#[arg(short, long)]
|
||||
username: String,
|
||||
host: String,
|
||||
|
||||
#[arg(short, long)]
|
||||
ip: String,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let args = Args::parse();
|
||||
|
||||
let tcp = TcpStream::connect(args.host).expect("Failed to connect to SSH server");
|
||||
let tcp = TcpStream::connect(args.ip).expect("Failed to connect to SSH server");
|
||||
let mut sess = Session::new().expect("Failed to create SSH session");
|
||||
sess.set_tcp_stream(tcp);
|
||||
sess.handshake().expect("SSH handshake failed");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue