[pve-devel] [PATCH RFC 04/21] use run_command for ssh-keygen

Dietmar Maurer dietmar at proxmox.com
Mon Nov 28 08:08:56 CET 2016


Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 data/PVE/Cluster.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/data/PVE/Cluster.pm b/data/PVE/Cluster.pm
index 76e0e9f..f84461b 100644
--- a/data/PVE/Cluster.pm
+++ b/data/PVE/Cluster.pm
@@ -1154,7 +1154,9 @@ sub setup_rootsshconfig {
     # create ssh key if it does not exist
     if (! -f $ssh_rsa_id) {
 	mkdir '/root/.ssh/';
-	system ("echo|ssh-keygen -t rsa -N '' -b $ssh_key_size -f ${ssh_rsa_id_priv}");
+	PVE::Tools::run_command(['ssh-keygen', '-q', '-t', 'rsa',
+				 '-b', $ssh_key_size, '-N', '',
+				 '-f', $ssh_rsa_id_priv]);
     }
 
     # create ssh config if it does not exist
-- 
2.1.4




More information about the pve-devel mailing list