Ensure ~/.ssh directory exists in sshync configuration

Former-commit-id: 84f8021609d8e62c12e89fc539fcb954ec876118
Former-commit-id: 3bb543b0b155f6ef73dc277042246bf8f918597b
This commit is contained in:
2023-07-10 14:41:44 -04:00
parent b1567d768b
commit 2e51a1ff15
+2
View File
@@ -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}"):