GithubHelp home page GithubHelp logo

cy384 / ssheven Goto Github PK

View Code? Open in Web Editor NEW
512.0 27.0 14.0 134 KB

A minimal new SSH client for Mac OS 7/8/9

License: BSD 2-Clause "Simplified" License

CMake 0.88% C 68.94% R 29.04% Shell 1.14%
retro68 classic-mac-os ssh-client

ssheven's Introduction

ssheven box

ssheven

A minimal new SSH client for Mac OS 7/8/9.

Project status: as of 0.8.0 (see github releases), fairly secure and usable, but without a polished UX or all planned features. Versions prior to 1.0.0 should be considered alpha/beta quality.

ssheven screenshot

system requirements

  • CPU: Any PPC processor, or at least a 68030 (68040 strongly recommended).
  • RAM: 2MB.
  • Disk space: fits on a floppy.
  • System 7.1 or later. Versions below 7.5 require the Thread Manager extension.
  • Open Transport networking required, latest version possible highly recommended.

roadmap

0.9.0

  • basic scp file transfer
  • general code cleanup

1.0.0 (first "real" release)

  • configurable terminal string
  • configurable/auto-choosing SSH buffer size (improves feel for faster machines)
  • nicer error presentation for more failure cases
  • add known_hosts reset option
  • read Apple HIG and clean up UI/UX
  • all license info in an about box type thing
  • finish and upload papercraft box, floppy sticker artwork, icon/logo svg

known problems

  • drawing the screen is somewhat slow
  • input latency feels high because redrawing the screen is slow (along with all the encryption, which is also slow)
  • receiving a large amount of data may break the channel or cause lockups (e.g. cat /dev/zero)
  • non-US keyboard input may or may not have issues

possible upcoming features

  • more complete color support (currently uses the default Mac 8 color palette)
  • keyboard-interactive authentication

build

Uses Retro68 and cmake.

Requires mbedtls, libssh2, and libvterm, see my (cy384's) ports of those libraries for details. Note that you need to build/install each for both platforms (m68k and PPC).

To build a fat binary, edit build-ssheven.bash with the path to your Retro68 build, and then run it.

license

Licensed under the BSD 2 clause license, see LICENSE file.

ssheven's People

Contributors

cy384 avatar justinbeatz avatar larb0b avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ssheven's Issues

More complete color support

ssheven supports 16 colors, but actually only 8 colors, because that's what the "traditional" quickdraw environment supports

  • detect current color depth
  • figure out how we can do 256+ colors without needing a whole screen buffer
  • hook into libvterm to do the colors

Potential buffer over-read

I believe the following lines allow for a buffer over-read (however remote the possibility):

const uint8_t ascii_to_control_code[255] = {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255};

uint8_t keycode_to_ascii[255] = {0};

The arrays are length 255 rather than 256; in both cases, I think it's possible for the array to end up being indexed with [255], which over-reads the buffer.

When reading from ascii_to_control_code, you might send garbage across the wire:

ssh_con.send_buffer[0] = ascii_to_control_code[unmodified_key];

For keycode_to_ascii, the index to the above read might also end up being garbage:

uint8_t unmodified_key = keycode_to_ascii[(event->message & keyCodeMask)>>8];

If this looks like a problem, you'll also want to update this loop:

for (uint16_t i = 0; i < 255; i++)

to:

	for (uint16_t i = 0; i < 256; i++)

I don't know that any Mac keyboard would even have a key code on it equal to 0xff, nor do I know if the translation to "ASCII" would ever give 0xff. This latter seems like it could be possible if there is a layout with a ห‡ key.

Key login not working

Thanks for making this cool project!

Note, the keypair work , I've tested on other machines.
I downloaded id-rsa and id-rsa.pub from my linux computer, and placed them on the OS9.2 desktop, then provided the .pub file when asked for "public key". I am then asked for the password, there is no password, so I press enter.

ssheven then tells that login failed, the message is:

Connecting endpoint... done.
Beginning SSH session handshake... done. (15 ticks)
Authenticating... failed!
Username/public key combination invalid!

I captured the attached log from SSHD Did I do something wrong?

Best Regards

21:19:24 sshd[1239115]: debug1: Forked child 1239244.
21:19:24 sshd[1239244]: debug1: Set /proc/self/oom_score_adj to 0
21:19:24 sshd[1239244]: debug1: rexec start in 5 out 5 newsock 5 pipe 7 sock 8
21:19:24 sshd[1239244]: debug1: inetd sockets after dupping: 4, 4
21:19:24 sshd[1239244]: Connection from 192.168.40.149 port 49164 on 192.168.40.118 port 22 rdomain ""
21:19:24 sshd[1239244]: debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.5
21:19:24 sshd[1239244]: debug1: Remote protocol version 2.0, remote software version libssh2_1.9.0_DEV
21:19:24 sshd[1239244]: debug1: no match: libssh2_1.9.0_DEV
21:19:24 sshd[1239244]: debug1: permanently_set_uid: 122/65534 [preauth]
21:19:24 sshd[1239244]: debug1: list_hostkey_types: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
21:19:24 sshd[1239244]: debug1: SSH2_MSG_KEXINIT sent [preauth]
21:19:24 sshd[1239244]: debug1: SSH2_MSG_KEXINIT received [preauth]
21:19:24 sshd[1239244]: debug1: kex: algorithm: ecdh-sha2-nistp256 [preauth]
21:19:24 sshd[1239244]: debug1: kex: host key algorithm: ecdsa-sha2-nistp256 [preauth]
21:19:24 sshd[1239244]: debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: none [preauth]
21:19:24 sshd[1239244]: debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: none [preauth]
21:19:24 sshd[1239244]: debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
21:19:24 sshd[1239244]: debug1: rekey out after 4294967296 blocks [preauth]
21:19:24 sshd[1239244]: debug1: SSH2_MSG_NEWKEYS sent [preauth]
21:19:24 sshd[1239244]: debug1: expecting SSH2_MSG_NEWKEYS [preauth]
21:19:24 sshd[1239244]: debug1: SSH2_MSG_NEWKEYS received [preauth]
21:19:24 sshd[1239244]: debug1: rekey in after 4294967296 blocks [preauth]
21:19:24 sshd[1239244]: debug1: KEX done [preauth]
21:19:24 sshd[1239244]: debug1: userauth-request for user dusted service ssh-connection method publickey [preauth]
21:19:24 sshd[1239244]: debug1: attempt 0 failures 0 [preauth]
21:19:24 sshd[1239244]: debug1: PAM: initializing for "dusted"
21:19:24 sshd[1239244]: debug1: PAM: setting PAM_RHOST to "192.168.40.149"
21:19:24 sshd[1239244]: debug1: PAM: setting PAM_TTY to "ssh"
21:19:24 sshd[1239244]: debug1: userauth_pubkey: test pkalg ssh-rsa pkblob RSA SHA256:#REDACTED #REDACTED# #REDACTED# #REDACTED## [preauth]
21:19:24 sshd[1239244]: debug1: temporarily_use_uid: 1000/1000 (e=0/0)
21:19:24 sshd[1239244]: debug1: trying public key file /home/dusted/.ssh/authorized_keys
21:19:24 sshd[1239244]: debug1: fd 5 clearing O_NONBLOCK
21:19:24 sshd[1239244]: debug1: /home/dusted/.ssh/authorized_keys:2: matching key found: RSA SHA256:#REDACTED #REDACTED# #REDACTED# #REDACTED##
21:19:24 sshd[1239244]: debug1: /home/dusted/.ssh/authorized_keys:2: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
21:19:24 sshd[1239244]: Accepted key RSA SHA256:#REDACTED #REDACTED# #REDACTED# #REDACTED## found at /home/dusted/.ssh/authorized_keys:2
21:19:24 sshd[1239244]: debug1: restore_uid: 0/0
21:19:24 sshd[1239244]: Postponed publickey for dusted from 192.168.40.149 port 49164 ssh2 [preauth]
21:19:24 sshd[1239244]: Connection closed by authenticating user dusted 192.168.40.149 port 49164 [preauth]
21:19:24 sshd[1239244]: debug1: do_cleanup [preauth]
21:19:24 sshd[1239244]: debug1: monitor_read_log: child log fd closed
21:19:24 sshd[1239244]: debug1: do_cleanup
21:19:24 sshd[1239244]: debug1: PAM: cleanup
21:19:24 sshd[1239244]: debug1: Killing privsep child 1239245
21:19:24 sshd[1239244]: debug1: audit_event: unhandled event 12
21:19:24 sshd[1239115]: debug1: main_sigchld_handler: Child exited

Feature request: SSH traffic / port forwarding

It would be killer to have this feature in order to securely use a program like MacX or eXodusII, X Window System clients for System 7 and up.

I imagine that this would be super slow, even on PowerPC.

Disconnect causes system freeze

Hello,
I'm running SSHeven on a Macintosh Color Classic II with System 7.5.3.

Connecting works great to Windows 11 openssh server. However when I click File -> Disconnect, I see this error:

channel read error: LIBSSH2_ERROR_SOCKET_RECV

And the Mac locks up (except for mouse movement). I can see continuing Ethernet activity when this happens.

Feature request: Full screen mode.

Apologies if this is not the best place to submit a feature request, feel free to close if so. It would be cool to have an option eg. Cmd + F to properly full screen the app to make the Mac feel as if it were actually a unix terminal.

I realise this is an aesthetic change only so may not be high on your list of priorities, just a thought. Really cool what you're doing here. Would love to see 68030 support in the future as well per your road map, as it would be awesome to be able to use my first ever computer to do actual work almost 30 years after it was made.

Add font selection?

It would be ideal to have a font selection option in the preferences.

Also what is the Unicode compatibility on Unicode complaint systems?

period symbol shown in password prompt

Hello,

Discovered this by accident, but in SSHeven 0.8.0 prerelease, when I am connecting to a machine and enter a password that has a period (".") symbol in it, the period is shown instead of the typical bullet/circle symbol.

I'm running 9.2.2 on a G3, VM is off. I haven't had a chance to test this on my 7.6.1/601 machine or elsewhere yet.

Here is a screenshot with an example password that has a period in the 5th position:
2020-11-10_ssheven-pw-error

Please let me know if you need anything else on this, and, thank you for your work on this project!

Option+key combinations do not produce anything

On the Finnish keyboard option is required to access many common characters like |, $, [], etc. I am running ssheven under Mac OS 9 set to Finnish locale, and it appears to me that ssheven is ignoring these key combinations. Unsure if this is covered under "non-US keyboard input may or may not have issues" or not.

channel read error: LIBSSL2_ERROR_ENCRYPT

Realize it's still a prototype just wanted to document some behaviors I'm seeing. :)
Noticed that when network access is unavailable or if a machine goes to sleep, the client crashes and the client window is flooded by this error: "channel read error: LIBSSL2_ERROR_ENCRYPT".

0.89 Crash with Open Transport 1.1.2

Crashes under 7.5.5 with OT 1.1.2 when clicking Connect. A subsequent restart leaves a corrupted prefs file, with host, port and username full of gibberish.

OT 1.3.1 works without issue

(7.5.5 on BasiliskII, or on a native Quadra 700)

Type 7 Error on Power Macintosh 6100/60 (System 7.6.1)

I have a Power Macintosh 6100/60 running System 7.6.1. I can launch the PPC version of the application, and enter a password or key, but after that it rapidly displays a line of text which says "connecting endpoint ...done" and then crashes with the error "the application "unknown" has unexpectedly quit, because an error of type 7 occurred."'

Putting in a bogus connection URL or port yields "connecting endpoint..." and the whole system locks up.

I tried the 68k version instead (just to see if it worked as PPC supports most 68k apps) and it quit with an error of type 2 after entering the password.

Any thoughts on how I can debug?

Name pronunciation

I know that this ticket might sound a bit frivolous, but how should ssheven be pronounced? SSH-even? Sheven? Sseven? S-sh-even? SSH-7?

ssheven 0.8.5 locks up on unsuccessful connection

If I attempt to ssh to a host that cannot be resolved (eg. is offline or incorrect hostname) the error "Connecting endpoint... OTConnect(ssh_con.endpoint, &sndCall, nil) failed" appears in the console. The program then immediately locks up and needs to be Force Quit using Cmd + Opt + Esc.

Using on an iMac G3 running Mac OS 9.2.2. Can't screenshot the above error as the system is unresponsive until ssheven is force quit anyway.

I am having no issues as long as the remote host being connected to responds.

can not be opened because an unexpected error occured

System details

Power Macintosh 7300
96MB of RAM
System 7.5.5
Open Transport 1.1.1

Issue

Launching SSHEVEN-FAT produces the following error and immediately quits.

The application "SSHEVEN-FAT" can not be opened because an unexpected error occured.

Terminal string preference

presently, ssheven uses xterm-mono and xterm-16colors depending on the color setting. Not all systems support these. Add a custom text field setting and save into preferences so the user can provide their own.

Key exchange is slow/gets timeouts

Key exchange is slow. This is arguably more of a bug in mbedtls but I want to track it here for my purposes. Notes:

  • diffie-hellman-group1-sha1 key exchange method is too slow to run on (some? all?) 68k machines
  • implementations in bignum.c in mbedtls, revisit mbedtls_mpi_exp_mod specifically
  • figure how to detect when the remote host drops us due to timeout and tell the user
  • figure out and document the minimum specs for the various methods
  • is there some keepalive flag or message, either OT/TCP or in ssh/libssh2 that we can be using to prevent timeouts?

Rendering errors in emacs

Having unexpected malignment of characters in emacs.

Using xterm-color on a MacOs Ventura host, client is iMac G3 running 9.2.2.
I know a bunch of the misrendered symbols are unicode characters (would love a fix, i wonder if on OS9 it'd be as simple as building with a more complete unicode font), but we're also seeing characters it can render be severely misaligned.

The divider bar in treemacs is totally misaligned on several lines, and the menu-bar on line 1 only intermittently appears.
Including a comparison with xterm running on linux with xterm-color 16-color mode to the same server (although proper unicode support minus the nerd-fonts characters).

Picture 2
screenshot

Error 3 on LCIII+ 33MHz 68030 System 7.5.5, SSHeven 0.8.9

Everything starts up fine, but when I try to connect it exits with an error 3. The same error occurs regardless of what is entered in the input boxes. (I tried a real IP address, a valid DNS address, an invalid DNS address, etc. I tried my real credentials, no credentials, and incorrect credentials.)

SSHeven v 0.8.9, running on an LCIII+, 33 MHz 68030 w/FPU 36MB of ram, NuBus ethernet card, using OpenTransport.

B/W icon hard to see when selected

the black and white icon is hard to see when selected on a white background; the 7 becomes white and only the key is visible.

fix: add a white border around the 7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.