24 Commits

Author SHA1 Message Date
Timmy Welch
bba58e7a3a Stuff
Some checks failed
Push / CI (push) Has been cancelled
Implement certificate authentication, certificate requires :gokrazy: principal
Read first line of /etc/passwd for home and shell
Shell uses `-l` to make it a login shell which will run .profile
2025-02-16 17:53:26 -08:00
Michael Stapelberg
c9528b4abb try to install busybox into a tmpfs /bin (with fallback)
This code path requires gokrazy/tools at this commit or newer:
37e2f95c5c

And gokrazy/serial-breakglass at this commit or newer:
bf9bc19235

Afterwards, with an ~/.ssh/config entry like this:

    Host scan2drive
        ProxyCommand breakglass -proxy %h

…using Emacs TRAMP should just work:

    emacs /ssh:scan2drive:/perm/keep/index.md
2024-12-31 09:53:25 +01:00
Michael Stapelberg
3d820b07fa ensure $HOME directory exists 2022-09-18 21:18:12 +02:00
Michael Stapelberg
c857ec6218 turn banner (printed before auth) into MOTD (printed after login)
This means the message will be printed only once when using the breakglass
command line tool (which first copies over a tarball, then logs in).

Also switch to fancy ASCII art while we’re at it :)
2022-07-09 18:38:32 +02:00
Michael Stapelberg
48c5124500 unpack tar files copied via sftp subsystem, too (not just older scp)
For compatibility with OpenSSH ≥ 9
2022-04-17 15:32:45 +02:00
Michael Stapelberg
7dbbe9b4b3 fix subsystem invocation: send exit code afterwards
This fixes scp(1) with OpenSSH ≥ 9.
2022-04-17 15:23:09 +02:00
Michael Stapelberg
564a0eceaf explicitly set TMPDIR
programs such as podman will otherwise default to /var/tmp
(see https://github.com/containers/podman/pull/5412/files)

related to https://github.com/gokrazy/gokrazy/issues/124
2022-04-03 23:05:12 +02:00
Michael Stapelberg
5a97592967 include /usr/local/bin in $PATH
related to https://github.com/gokrazy/gokrazy/issues/124
2022-04-03 23:05:02 +02:00
Michael Stapelberg
087335e682 PATH: add /user so that programs installed with gokrazy are found 2022-03-31 19:36:56 +02:00
Michael Stapelberg
0a14bc7f0c set HOME=/perm/home for persistent configs in interactive usage
As a welcome side effect, this enables persistent shell history by default!
2022-03-31 19:36:44 +02:00
Michael Stapelberg
b54c2f919e SSH: wire up SFTP subsystem 2021-06-06 13:54:30 +02:00
andig
1a4768ba69
Add port forwarding (-forward flag) (#7) 2021-01-18 09:46:20 +01:00
Michael Stapelberg
6a8318bdb5 pick up shell from github.com/gokrazy/serial-busybox if present
This allows users to use breakglass without having to upload their own shell (as
a fallback).
2020-05-25 08:58:37 +02:00
Anisse Astier
9d10c020d8 ssh: fix shell payload string length (#2)
Using ssh.Unmarshal since commit c11ed6a015a8da means the "shell" payload should be propely formatted, with a specified string length. Otherwise, when attempting to connect, you'll see this message in the gokrazy stderr:
ssh: parse error in message type 0

that's because in x/crypto/ssh, the parseString() method expects a length before the string. If length is 0, there will be remaining unparsed data, and an error.
2018-12-28 16:20:43 +01:00
Michael Stapelberg
c11ed6a015 use ssh.Unmarshal
Thanks to Merovius for the hint.
2018-10-29 18:42:56 +01:00
Axel Wagner
77088e03a7 Forward correct exit status to client (#1) 2018-10-25 12:49:32 +02:00
Michael Stapelberg
a1fd5f6920 ensure processes are killed when client disconnects 2018-07-22 23:04:18 +02:00
Michael Stapelberg
05c84e7002 ssh: run commands through sh -c if sh is present 2018-06-23 16:14:33 +02:00
Michael Stapelberg
b99b39b334 include the breakglass mountpoint in $PATH
That way, users don’t need to use the ./ prefix all the time.
2018-06-23 15:45:50 +02:00
Michael Stapelberg
a8f85f5027 ssh: default to starting "sh" on shell requests instead of erroring
This may still result in an error if sh is not present, but in case sh *is*
present, it results in the user just getting a shell without having to use
e.g. ssh -t gokrazy ./busybox sh
2018-06-23 15:44:41 +02:00
Michael Stapelberg
0d8462cfe7 ssh: send exit-status request for successful commands
The crypto/ssh client library requires this.
2018-06-23 15:42:41 +02:00
Michael Stapelberg
6184621747 exec: answer request once command is running 2018-06-11 23:18:11 +02:00
Michael Stapelberg
ae93fa3cab exec: write stderr to SSH stderr channel, not stdout 2018-06-11 23:17:46 +02:00
Michael Stapelberg
448a389515 Initial commit 2017-03-04 11:09:10 +01:00