mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-03 23:57:17 -04:00
Ensure ~/.ssh directory exists in sshync configuration
Former-commit-id: 84f8021609d8e62c12e89fc539fcb954ec876118 Former-commit-id: 3bb543b0b155f6ef73dc277042246bf8f918597b
This commit is contained in:
@@ -148,6 +148,8 @@ def editor_config(_env_mode):
|
|||||||
def ssh_config():
|
def ssh_config():
|
||||||
# private key selection/generation
|
# private key selection/generation
|
||||||
_keys = []
|
_keys = []
|
||||||
|
# ensure ~/.ssh directory exists
|
||||||
|
Path(f"{home}/.ssh").mkdir(mode=0o700, exist_ok=True)
|
||||||
for _file in listdir(f"{home}/.ssh"):
|
for _file in listdir(f"{home}/.ssh"):
|
||||||
if not _file.startswith('.') and _file not in ('known_hosts', 'authorized_keys') \
|
if not _file.startswith('.') and _file not in ('known_hosts', 'authorized_keys') \
|
||||||
and not _file.endswith('.pub') and isfile(f"{home}/.ssh/{_file}"):
|
and not _file.endswith('.pub') and isfile(f"{home}/.ssh/{_file}"):
|
||||||
|
|||||||
Reference in New Issue
Block a user