summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--python/vyos/remote.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/python/vyos/remote.py b/python/vyos/remote.py
index 372780c91..49936ec08 100644
--- a/python/vyos/remote.py
+++ b/python/vyos/remote.py
@@ -26,6 +26,9 @@ def check_and_add_host_key(host_name):
needed.
"""
known_hosts = '{}/.ssh/known_hosts'.format(os.getenv('HOME'))
+ if not os.path.exists(known_hosts):
+ mode = 0o600
+ os.mknod(known_hosts, 0o600)
keyscan_cmd = 'ssh-keyscan -t rsa {} 2>/dev/null'.format(host_name)