get_ssh_connection#

atomate2.utils.file_client.get_ssh_connection(username: str | None, hostname: str, key_filename: str | Path, config_filename: Optional[Union[str, Path]] = None) paramiko.client.SSHClient[source]#

Connect to a remote host via paramiko.

If the host key is not present it will be added automatically.

Parameters
usernamestr or None

The username. If None, the current logged in username will be used.

hostnamestr

The host name. Supports host aliases defined in the ssh config file.

key_filenamestr or Path

Path to private key file.

config_filenamestr or Path or None

Path to OpenSSH config file.

Returns
SSHClient

An ssh connection to the host.