Documentation
¶
Overview ¶
Package sshd is the SSH server the agent runs itself.
`burrow ssh` does not forward to a system sshd: it starts this, which hands out a shell in the directory the command was run from, as the user who ran it. That means remote access to a machine with no sshd configured, no port opened and no root involved.
It only ever listens on loopback. Reaching it means coming through the tunnel, so the exposure is exactly the tunnel's lifetime and nothing is listening on the machine once the agent stops.
Index ¶
- func CurrentUser() string
- func NewPassword() string
- type Server
- func (s *Server) AuthorizedKeyCount() int
- func (s *Server) Close() error
- func (s *Server) Fingerprint() string
- func (s *Server) HostKeyLine(host string, port int) string
- func (s *Server) Listen() (net.Listener, error)
- func (s *Server) Serve(ln net.Listener) error
- func (s *Server) Sessions() int
- func (s *Server) SetAuthorizedKeys(lines []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentUser ¶
func CurrentUser() string
CurrentUser is the account a session will run as, for the connect command.
func NewPassword ¶
func NewPassword() string
NewPassword generates a session password.
Six words from a small alphabet rather than a long random string: it has to survive being read aloud and retyped, and 4 groups of 5 characters from this alphabet is still ~90 bits.
Types ¶
type Server ¶
type Server struct {
// Dir is what a session starts in.
Dir string
// Password authenticates a session. Empty disables password auth.
Password string
// AuthorizedKeys may connect without a password.
AuthorizedKeys []string
// Log receives diagnostics.
Log *slog.Logger
// contains filtered or unexported fields
}
Server serves shells over SSH.
func (*Server) AuthorizedKeyCount ¶ added in v0.2.2
AuthorizedKeyCount reports how many keys are currently accepted.
func (*Server) Fingerprint ¶
Fingerprint is the SHA256 fingerprint ssh prints on first connection.
func (*Server) HostKeyLine ¶
HostKeyLine returns the known_hosts entry for this server at addr, which is what lets someone connect without being asked to confirm a fingerprint.
func (*Server) SetAuthorizedKeys ¶ added in v0.2.2
SetAuthorizedKeys replaces the accepted keys.
Callable while running, because the agent only learns them once the server answers its handshake — and again on every reconnect, so revoking a key in the panel takes effect without restarting anything.