The copied paths have their symlinks resolved, so files under a HOME that is
itself reached via a symlink, such as /home -> /usr/home, were not
recognized as being in HOME and were copied to an absolute path on the
remote machine. Also add the PR reference to the changelog entry for #10737.
The archive reused the metadata of the top level directory for all nested
directories and both bootstrap implementations recreated directories with
the remote umask.
Stat every directory when building the archive, passing the stat result
explicitly to the header callback and skipping directories that vanish or
are replaced by something else while being copied.
When deploying, move directories not present at the destination intact,
replacing any dangling symlink or file in the way, and merge into existing
directories keeping their permissions. The shell implementation falls back
to creating the directory and merging if the move fails. Make the
temporary directory deletable before removing it as copied directories can
lack write or search permission.
Closes#10727
New color_scheme_dark, color_scheme_light and color_scheme_no_preference
options. When any of them is set, the ssh kitten sends the color schemes
for all three system color schemes to kitty, which applies the one
matching the current system color scheme and switches between them when
the system color scheme changes. color_scheme is used for modes without
a specific color scheme.
The colors are applied in a new session color layer, above the colors of
the window and below colors set by programs. They are associated with the
color stack entry pushed by the ssh kitten and are removed when it is
popped, so nested sessions work and the colors are restored on exit.
Configs that only use color_scheme continue to use escape codes exactly
as before, as does the kitten when running inside tmux.
Fixes#10724
When the connection of an existing ControlMaster to the server dies
without the master noticing, for example after a network change or
suspend, new sessions using it hang. ssh -O check does not detect this
as it only talks to the master over its local socket.
Check the master in parallel with starting the session, using a request
that requires a round trip to the server, so that there is no added
latency when the master is healthy. If the master does not respond in
time, kill the stuck session, stop the master and start the session
again over a new connection. Similarly time out the port forward request
used by forward_remote_control and retry it with a new master.
Fixes#10691
slices.Insert(cmd, 1, "-O", "check") writes into cmd's backing array
when there is spare capacity (cap(cmd) >= len(cmd)+2). check_cmd points
at the shifted array, but cmd's slice header is unchanged: reading
cmd[:insertion_point] later returns "-O", "check", ... where the
original prefix used to be. run_control_master, forward_remote_control,
and the final ssh exec all build their argvs from this corrupted prefix.
Repro: share_connections=yes, forward_remote_control=yes, and enough
ssh_args to push cmd past Go's slice-growth threshold (kitten ssh -v
host does it). With the ControlMaster already up you'll see
"Multiplexing command already specified"; otherwise it fails with
"Failed to start SSH ControlMaster" and a stray -O check left in the
cmdline.
This prevents sending attacker controlled data over the tty where it
might end up getting evaled by the shell if the user is doing something
like cat of unsanitized data into the terminal (something that should
never be done).
The overrides were not being passed to the askpass kitten.
And we dont need to support backward compatibility for secrets with no
backend, since this feature has never been released.
Motivation: Some environments disallow or do not reliably accept one-way
pubkey-only auth, or require keyboard-interactive password + TOTP. This adds an
optional, host-scoped automation via kitty's native askpass to reduce repetitive
manual entry while preserving the ssh kitten UX.
- Add auth_config.go to parse password/totp_* from ssh.conf by host block
- Ignore these keys in main ssh.conf parser to avoid bad-line warnings
- Pass host/user to askpass for host-aware lookup
- Auto-answer password and OTP prompts in askpass; fallback to UI otherwise
Security: Secrets in ssh.conf are plain text; users should enforce strict
permissions or avoid storing passwords if unacceptable. Only login password/OTP
prompts are auto-answered; passphrases and host key confirmations are not.
feat(ssh): add secret backend support for auth passwords and TOTP secrets
Introduce support for specifying secret backends in SSH auth config, currently supporting only the "text" backend for storing secrets directly. This allows for future extensibility while maintaining backward compatibility by treating values without a backend as "text:<value>".
The changes include new fields in AuthEntry for backends, updated parsing logic in lineHandler, error handling for invalid backends, and normalization for existing configs. A new parseBackendSecret function handles the parsing with validation.