-
Notifications
You must be signed in to change notification settings - Fork 17
Resolve SSH relay review annotations and document the connect-token round trip #322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,18 +49,30 @@ type Paths struct { | |
| Port int | ||
| } | ||
|
|
||
| // DefaultPaths returns the production paths owned by amikad. | ||
| // EnvManagedUser overrides the account whose UID/GID own the managed sshd's | ||
| // authorized_keys file, and whose home directory it lives under. Empty (the | ||
| // default) uses "amika". This is a single-user override, not multi-user | ||
| // support: everything under DefaultPaths still assumes exactly one managed | ||
| // account. | ||
| const EnvManagedUser = "AMIKA_SSHD_USER" | ||
|
|
||
| // DefaultPaths returns the production paths owned by amikad, for the managed | ||
| // user named by EnvManagedUser (default "amika"). | ||
| func DefaultPaths() Paths { | ||
| username := os.Getenv(EnvManagedUser) | ||
| if username == "" { | ||
| username = "amika" | ||
| } | ||
| uid, gid := -1, -1 | ||
| if account, err := user.Lookup("amika"); err == nil { | ||
| if account, err := user.Lookup(username); err == nil { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Useful? React with 👍 / 👎. |
||
| uid, _ = strconv.Atoi(account.Uid) | ||
| gid, _ = strconv.Atoi(account.Gid) | ||
| } | ||
| return Paths{ | ||
| Config: "/var/lib/amikad/sshd_config", | ||
| HostPrivateKey: "/var/lib/amikad/ssh_host_ed25519_key", | ||
| HostPublicKey: "/var/lib/amikad/ssh_host_ed25519_key.pub", | ||
| AuthorizedKeys: "/home/amika/.ssh/authorized_keys", | ||
| AuthorizedKeys: "/home/" + username + "/.ssh/authorized_keys", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For a managed account whose home is not Useful? React with 👍 / 👎. |
||
| PID: "/var/lib/amikad/sshd.pid", | ||
| RuntimeDirectory: "/run/sshd", | ||
| AuthorizedKeysUID: uid, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
serveis invoked with both--bgand a non-default--max-connections,Servebranches toserveBackgroundbefore constructing the handler, and that function launches the child with only--portand--beta-no-relay. The child therefore silently uses the default limit of 64, so this newly advertised flag has no effect in background mode; include the selected limit in the child arguments.Useful? React with 👍 / 👎.