Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion paramiko_tutorial/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Client to handle connections and actions executed against a remote host."""
from os import system
import subprocess as sp
from typing import List

from paramiko import AutoAddPolicy, RSAKey, SSHClient
Expand Down Expand Up @@ -65,7 +66,7 @@ def _get_ssh_key(self):

def _upload_ssh_key(self):
try:
system(
sp.getoutput(
f"ssh-copy-id -i {self.ssh_key_filepath}.pub {self.user}@{self.host}>/dev/null 2>&1"
)
LOGGER.info(f"{self.ssh_key_filepath} uploaded to {self.host}")
Expand Down