ensure known_hosts exist

Locally running ONOS was failing on fresh machine
 where known_hosts doesn't exist yet.

Change-Id: I83beb0118f6f41e8b24eff1ab7cb53d2ca95f853
diff --git a/tools/package/bin/onos-user-key b/tools/package/bin/onos-user-key
index 9a6aff3..8715a58 100755
--- a/tools/package/bin/onos-user-key
+++ b/tools/package/bin/onos-user-key
@@ -23,6 +23,8 @@
     echo "$user=$key,_g_:admingroup" >> $KEYS
 fi
 
+# ensure known_hosts file exist
+(umask 077; touch "$HOME/.ssh/known_hosts")
+
 # Also, remove any previous known keys for the localhost.
 ssh-keygen -f "$HOME/.ssh/known_hosts" -R [localhost]:8101
-
diff --git a/tools/test/bin/onos-secure-ssh b/tools/test/bin/onos-secure-ssh
index 24a5a48..cd9f12c 100755
--- a/tools/test/bin/onos-secure-ssh
+++ b/tools/test/bin/onos-secure-ssh
@@ -19,9 +19,12 @@
 
 nodes=${1:-$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)}
 
+# ensure known_hosts file exist
+(umask 077; touch "$HOME/.ssh/known_hosts")
+
 for node in $nodes; do
     # Prune the node entry from the known hosts file since server key changes
-    ssh-keygen -f "$HOME/.ssh/known_hosts" -R [$node]:8101 || 
+    ssh-keygen -f "$HOME/.ssh/known_hosts" -R [$node]:8101 ||
         ( echo "Failed to remove key from known_hosts" >&2 && exit 1 )
 
     # Setup passwordless login for the local user on the remote node
@@ -42,4 +45,3 @@
     # TODO: fix username collision between workbench and the remote hosts
     onos-user-key $node
 done
-