pub struct SshCredentials {
pub ssh_priv_key_path: PathBuf,
pub ssh_pub_key_path: PathBuf,
pub ssh_username: Username,
}Expand description
SSH credentials for remote instance authentication.
Contains the static SSH authentication information that is known at program startup, before any instances are provisioned.
Fields§
§ssh_priv_key_path: PathBufPath to the SSH private key file for remote connections.
This key will be used by the SSH client to authenticate with remote instances created during deployment. The corresponding public key should be authorized on the target instances.
ssh_pub_key_path: PathBufPath to the SSH public key file for remote connections.
This public key will be used for authorization on target instances
during the deployment process, typically injected into cloud-init
configurations or authorized_keys files.
ssh_username: UsernameUsername for SSH connections to remote instances.
This username will be used when establishing SSH connections to deployed instances. Common values include “ubuntu”, “root”, or “torrust”.
Implementations§
Source§impl SshCredentials
impl SshCredentials
Sourcepub fn new(
ssh_priv_key_path: PathBuf,
ssh_pub_key_path: PathBuf,
ssh_username: Username,
) -> Self
pub fn new( ssh_priv_key_path: PathBuf, ssh_pub_key_path: PathBuf, ssh_username: Username, ) -> Self
Creates new SSH credentials with the provided parameters.
use torrust_tracker_deployer_lib::adapters::ssh::SshCredentials;
let credentials = SshCredentials::new(
PathBuf::from("/home/user/.ssh/deploy_key"),
PathBuf::from("/home/user/.ssh/deploy_key.pub"),
Username::new("ubuntu").unwrap(),
);Trait Implementations§
Source§impl Clone for SshCredentials
impl Clone for SshCredentials
Source§impl Debug for SshCredentials
impl Debug for SshCredentials
Source§impl<'de> Deserialize<'de> for SshCredentials
impl<'de> Deserialize<'de> for SshCredentials
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for SshCredentials
impl Serialize for SshCredentials
Source§impl TryFrom<SshCredentialsConfig> for SshCredentials
impl TryFrom<SshCredentialsConfig> for SshCredentials
Source§type Error = CreateConfigError
type Error = CreateConfigError
Auto Trait Implementations§
impl Freeze for SshCredentials
impl RefUnwindSafe for SshCredentials
impl Send for SshCredentials
impl Sync for SshCredentials
impl Unpin for SshCredentials
impl UnsafeUnpin for SshCredentials
impl UnwindSafe for SshCredentials
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request