Features
- Support
ProxyCommandin the ssh config forsake run,sake execand the rest, and forsake ssh, likeProxyCommand sh -c "aws ssm start-session --target %h --parameters portNumber=%p"for AWS SSM. The tokens ofssh_configlike%h,%n,%p,%r,%u,%Cand%%are expanded, and the command ends with the connection. It competes with aProxyJumpof the ssh config as in ssh, where whichever is set first wins, and is ignored for a server with a bastion in sake - Use the ssh-agent that
IdentityAgentsets in the ssh config, like 1Password's, instead of onlySSH_AUTH_SOCK. It's read as ssh reads it: the first value of the matchingHostsections in the file's order, also fromHost *andIncluded files, from aMatchblock whose criteria areall,host,originalhost,userorlocaluser(others, likeexec, are skipped), with?and!patterns, a quoted path,~,${VAR},$VAR, the%d,%u,%i,%L,%l,%h,%r,%p,%Ctokens,SSH_AUTH_SOCKandnone. An unset$VARmeans no agent, and an invalid variable name, an unset${VAR}or an unknown token is an error for that server - A bastion uses the ssh-agent and
IdentityFileof its own host in the ssh config, as ssh does for aProxyJump, with the server'sidentity_fileandpasswordafter them. A bastion whose agent can't be reached still connects with its ownIdentityFile. A bastion with no section of its own, like a bare IP inProxyJump, gets the settings of the wildcard sections that match it, like theUserandIdentityFileofHost *
Breaking
- A
ProxyCommandin your ssh config now takes effect for the servers that have aHostsection of their own, where sake ignored it, and its command has no terminal, so it can't ask for input - An
Includewith a glob in the ssh config, likeInclude config.d/*, is now read instead of skipped, so the hosts it defines get theirHostName,User,Port,IdentityFileandProxyJump - The settings of a
Matchblock in the ssh config no longer join theHostsection before it.Match allapplies to every host, and otherMatchblocks are skipped, as sake doesn't evaluate their criteria for these settings Hostpatterns in the ssh config are matched as ssh matches them, so more hosts can get a section's settings:?is one character (Host web?givesweb1its settings, whereweb?was a host of its own), a negated pattern excludes a host (Host *.lab !bad.labno longer applies tobad.lab), and case is ignored, also for a server's own section. Patterns like[ab]and{a,b}, which ssh doesn't have, no longer match- A bastion no longer uses the server's ssh-agent, but its own:
SSH_AUTH_SOCK, or its host'sIdentityAgent - A bastion's own
IdentityFilein the ssh config is now read, so sake can ask for its passphrase - A
ProxyJumphop that sets no user or port, and whose ssh config section sets none, is on port 22 and the local user's, as in ssh, instead of the server's port and user,--userincluded - A user or port written for a bastion in
sake.yaml, likebob@jump:2200, now wins over its ssh config section's, which won before - An ssh-agent has
default_timeoutto connect and list its keys, where sake waited before. An agent that waits for the user first, like a locked agent app, can now time out: that server then connects without it
Fixes
- Fix host names that only the system's resolver knows, like libvirt VMs, systemd-machined containers and mDNS (
.local) hosts, being unreachable withlookup host1vm on 127.0.0.53:53: server misbehaving, wheresshandpingfind them. sake is built without cgo, so it resolves names itself, with the DNS servers of/etc/resolv.confand not the sources of/etc/nsswitch.conf. When it can't find a name, it now asksgetent ahosts, where that exists (Linux and BSD), and connects to what it finds - Fix an alias in a
ProxyJumplist, likeProxyJump jump1,jump2, being dialed as a host name: each hop gets its section'sHostName,UserandPort, where a user or port the hop sets wins, as in ssh. A bastion set in sake gets theUserandPortit sets when its section has none, instead of the server's - Fix
sake sshgivingsshthe resolved address of a jump host, which lost the host's own ssh config section, like itsIdentityFile: it gets the host as written, and sake's ssh config with-F, which may not be the onesshreads - Fix a host's own
IdentityFilecoming after the one ofHost *, so sake used the wildcard's for a host with its own - Fix
ProxyJump none, which turns off aProxyJumpfromHost *, being dialed as a bastion namednone - Fix
--userand--identity-filebeing replaced by theUserandIdentityFileof the server's ssh config section: the flags win, asssh -land-ido.--identity-filealso replaces the server's.pubfile, which matched the server's own key in the agent instead - Fix
Key=valueandKey = valuelines in the ssh config, which gave the value= value, like the user= root - Fix quoted values in the ssh config keeping their quotes, like
IdentityFile "~/.ssh/my key", and a trailing comment joining a value, likeUser root # admin - Fix a relative
Includein the ssh config, likeInclude config.d/work, failing the parse, as it was opened from the current directory: it's read from~/.ssh, or/etc/sshfor a config there, as ssh does. AnIncludethat can't be read or parsed is skipped, and anIncludeloop ends - Fix a host name with a port without a dot, like
jump:2222inProxyJumporbastion, which was read as the hostjump:2222, and anssh://host, which was an error - Fix an ssh-agent that never answers hanging the run: connecting to it and listing its keys take at most
default_timeout, all the agents together, not each - Fix "too many authentication failures" when the ssh-agent holds many keys: a server's
identity_filekey is offered first, as ssh does - An ssh-agent that can't be reached no longer fails the whole run: a server still connects with its
identity_fileorpassword, as with ssh, and one with neither is unreachable with the agent's error. The agent is only opened when a remote server uses it