Clean package structure ahead of tests
This commit is contained in:
parent
43114d8c1f
commit
4843413883
10 changed files with 16 additions and 10 deletions
|
@ -1,25 +0,0 @@
|
|||
from pathlib import Path
|
||||
import logging
|
||||
from util import run_op
|
||||
|
||||
class SshConfig:
|
||||
|
||||
def __init__(self):
|
||||
self.config_path = Path("/etc/ssh/ssh_config")
|
||||
self.target_values = {"PermitRootLogin": "No",
|
||||
"PasswordAuthentication": "No",
|
||||
"ChallengeResponseAuthentication": "No",
|
||||
"UsePAM": "No"}
|
||||
|
||||
def sync_target_values(self):
|
||||
logging.info(f"Updating ssh config in: {self.config_path}")
|
||||
pass
|
||||
|
||||
def restart_service(self):
|
||||
op = "systemctl restart ssh"
|
||||
logging.info(f"Restarting ssh service: {op}")
|
||||
run_op(op)
|
||||
|
||||
def copy_ssh_dir_to_user(self, username:str):
|
||||
op = f"rsync --archive --chown={username}:{username} ~/.ssh /home/{username}"
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue