signstar_common/
ssh.rs

1//! Defaults for SSH.
2//!
3//! # Examples
4//!
5//! ```
6//! use signstar_common::ssh::{get_ssh_authorized_key_base_dir, get_sshd_config_dropin_dir};
7//!
8//! // Get directory path for SSH authorized_keys files for Signstar users.
9//! println!("{:?}", get_ssh_authorized_key_base_dir());
10//!
11//! // Get directory path for sshd_config drop-in files.
12//! println!("{:?}", get_sshd_config_dropin_dir());
13//! ```
14
15use std::path::PathBuf;
16
17/// The base directory below which SSH authorized_keys files for users are located.
18const SSH_AUTHORIZED_KEY_BASE_DIR: &str = "/etc/ssh/";
19
20/// The directory below which sshd_config drop-in files are located.
21const SSHD_CONFIG_DROPIN_DIR: &str = "/etc/ssh/sshd_config.d/";
22
23/// Returns the directory path below which SSH authorized_keys files for Signstar users are located.
24pub fn get_ssh_authorized_key_base_dir() -> PathBuf {
25    PathBuf::from(SSH_AUTHORIZED_KEY_BASE_DIR)
26}
27
28/// Returns the directory path below which SSH authorized_keys files for Signstar users are located.
29pub fn get_sshd_config_dropin_dir() -> PathBuf {
30    PathBuf::from(SSHD_CONFIG_DROPIN_DIR)
31}