Skip to main content

save

Function save 

Source
pub async fn save(ast: &ConfigAst, running_as_root: bool) -> Result<()>
Expand description

Serialize the AST and install it as /etc/ssh/sshd_config via a privileged operation (validation + backup + atomic install).

running_as_root selects direct writes vs. the sudo -n path.

§Errors

Returns Error::SshdConfigInvalid if sshd -t rejects the config, or Error::SudoFailed if the privileged install can’t run.