From 2e51a1ff15f2b661adc76fabb2d72e0301058fa5 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Mon, 10 Jul 2023 14:41:44 -0400 Subject: [PATCH] Ensure ~/.ssh directory exists in sshync configuration Former-commit-id: 84f8021609d8e62c12e89fc539fcb954ec876118 Former-commit-id: 3bb543b0b155f6ef73dc277042246bf8f918597b --- lib/stweak.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/stweak.py b/lib/stweak.py index 5d400fa..5d84dcb 100644 --- a/lib/stweak.py +++ b/lib/stweak.py @@ -148,6 +148,8 @@ def editor_config(_env_mode): def ssh_config(): # private key selection/generation _keys = [] + # ensure ~/.ssh directory exists + Path(f"{home}/.ssh").mkdir(mode=0o700, exist_ok=True) for _file in listdir(f"{home}/.ssh"): if not _file.startswith('.') and _file not in ('known_hosts', 'authorized_keys') \ and not _file.endswith('.pub') and isfile(f"{home}/.ssh/{_file}"):