ringtailsoftware/misshod
MiSSHod is a minimal, experimental SSH client implemented as a library
misshod. (ˌmɪsˈʃɒd). adj. badly shod
MiSSHod is a minimal, experimental SSH client implemented as a library.
It has been tested with both OpenSSH and Dropbear.
MiSSHod is not secure, it should not be used in real world systems
It aims to be:
Features
MiSSHod requires Zig 0.14.0.
To build mssh
, a command line SSH client for Mac/Linux
zig build test
cd mssh
zig build
./zig-out/bin/mssh
./zig-out/bin/mssh <username@host> <port> [idfile]
To run a test SSH server (dropbear) in docker
cd testserver
./sshserver
Login with password auth, ("password")
./zig-out/bin/mssh [email protected] 2022
# Same as: ssh -p 2022 [email protected]
Login with pubkey auth using a passwordless private key
./zig-out/bin/mssh [email protected] 2022 ../testserver/id_ed25519_passwordless
# Same as: ssh -p 2022 [email protected] -i ../testserver/id_ed25519_passwordless
Login with pubkey auth using a password protected private key ("secretpassword")
./zig-out/bin/mssh [email protected] 2022 ../testserver/id_ed25519_passworded
# Same as: ssh -p 2022 [email protected] -i ../testserver/id_ed25519_passworded
As a proof of concept, the tiny
example logs into the test server but contains no socket code. Instead, it uses stdout and stdin. To run it via socat
:
zig build && socat TCP4:127.0.0.1:2022 EXEC:./zig-out/bin/tiny
Tiny uses a weaker PRNG, a fixed buffer allocator and does no file I/O.
MiSSHod is not secure, it should not be used in real world systems
MiSSHod was developed rapidly. The main aim was to get it working and learn something along the way. I don't know what's next, but hopefully you can learn something too by looking at a small SSH implementation.
It's entirely undocumented and there aren't enough tests.