Skip to content

haruyama/ssh_client_sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

* SSH Client Sample

This is a SSH Client but not a practical SSH Client.
I suppose that this helps us understand SSH Protocol.

I confirm that this works for Debian sid's sshd "SSH-2.0-OpenSSH_5.8p1 Debian-4".

* License

This software is a public domain.

* Build

use sbt 0.10.*(Simple Build Tool, https://github.com/harrah/xsbt/wiki).

% sbt compile

* Usage

Ex: login sshd(localhost:22) using 'test' user (with password 'password')  and execute 'ls'.

% ls ~test
a hotate


You can run on sbt.

% sbt
....

> run
...
java.lang.IllegalArgumentException: please run 'scala SSHClientSample [host] [port] [user] [pass] [command]'
...

> run localhost 22 test password ls
...

a
hotate

...

Or you can generate a jar and run java command.

% sbt assembly:package
...
% java -jar target/SSH-client-sample.jar localhost 22 test password ls
a
hotate