mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-10-27 12:40:02 -04:00
Exclude "known_hosts.old" in ssh key listing
Former-commit-id: fc088270e9865b35ae4b10f020fec916e5093a8a Former-commit-id: 8988481a7d3f37636dfa534312890760cd24ca81
This commit is contained in:
1 parent
bdff85f024
commit
98f76ac1ab
1 file changed
+1
-1
+1
-1
@@ -151,7 +151,7 @@ def ssh_config():
|
|||||||
# ensure ~/.ssh directory exists
|
# ensure ~/.ssh directory exists
|
||||||
Path(f"{home}/.ssh").mkdir(mode=0o700, exist_ok=True)
|
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', 'known_hosts.old', 'authorized_keys') \
|
||||||
and not _file.endswith('.pub') and isfile(f"{home}/.ssh/{_file}"):
|
and not _file.endswith('.pub') and isfile(f"{home}/.ssh/{_file}"):
|
||||||
_keys.append(f"{home}/.ssh/{_file}")
|
_keys.append(f"{home}/.ssh/{_file}")
|
||||||
_keys.extend(['auto-generate', 'other (type the location)'])
|
_keys.extend(['auto-generate', 'other (type the location)'])
|
||||||
|
|||||||
Reference in new issue
Block a user