Documentation
¶
Overview ¶
Package hostkey keeps the SSH host key of the SFTP server. The core, which is root, makes it before anyone has connected, so the panel can show its fingerprint. The server only reads it.
Index ¶
Constants ¶
const File = "host_key"
File is the name of the key inside its folder, and of the old one inside the SFTP server's state folder.
Variables ¶
This section is empty.
Functions ¶
func Ensure ¶ added in v0.7.4
Ensure makes sure dir holds the host key and returns it. dir must be writable by root alone: the key belongs to root and the group gid, which may read it. If there is no key yet and legacyDir holds an ed25519 one, it is copied over so the fingerprint stays what clients have trusted; otherwise a new key is made. The old file is left alone, since an update may roll back to a binary that reads it.
legacyDir is the SFTP user's own folder, so nothing in it is trusted: the file is opened without following links and must be a small regular file. Nothing is ever written there.
Types ¶
This section is empty.