summaryrefslogtreecommitdiff
path: root/op-mode-definitions/generate-ssh-server-key.xml.in
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-05-18 19:13:34 +0200
committerChristian Poessinger <christian@poessinger.com>2021-05-18 21:30:44 +0200
commit432e5048db19ddf5a7505866421f77bb01635d08 (patch)
tree93c29638f3cbe8a808a1895950191c307719df73 /op-mode-definitions/generate-ssh-server-key.xml.in
parent6816d37501aa495d71a441a8e391a1249c4d13f6 (diff)
downloadvyos-1x-432e5048db19ddf5a7505866421f77bb01635d08.tar.gz
vyos-1x-432e5048db19ddf5a7505866421f77bb01635d08.zip
revert: "util: T2467: add autosudo as an option to command"
Implementing a wrapper which will - based on the command - add a sudo prefix to the execution string seemed to be a nice idea but unfortunately it did not only not get momentum but also the codebase somethis added an implicit "sudo" call a second time. This resulted in a call: "sudo sudo systemctl" The entire functionality was removed again and if an op-mode script requires root priviledges it must be explicitly called with them - no black magic. (cherry picked from commit b76931e6d3a4bd0cdb74ca447a746ab6855fcf55)
Diffstat (limited to 'op-mode-definitions/generate-ssh-server-key.xml.in')
-rw-r--r--op-mode-definitions/generate-ssh-server-key.xml.in24
1 files changed, 20 insertions, 4 deletions
diff --git a/op-mode-definitions/generate-ssh-server-key.xml.in b/op-mode-definitions/generate-ssh-server-key.xml.in
index a6ebf1b78..ecea3e5d1 100644
--- a/op-mode-definitions/generate-ssh-server-key.xml.in
+++ b/op-mode-definitions/generate-ssh-server-key.xml.in
@@ -2,14 +2,30 @@
<interfaceDefinition>
<node name="generate">
<properties>
- <help>Generate an object</help>
+ <help>Generate an object/key</help>
</properties>
<children>
- <node name="ssh-server-key">
+ <node name="ssh">
<properties>
- <help>Regenerate the host SSH keys and restart the SSH server</help>
+ <help>Generate SSH related keypairs</help>
</properties>
- <command>${vyos_op_scripts_dir}/generate_ssh_server_key.py</command>
+ <children>
+ <node name="server-key">
+ <properties>
+ <help>Re-generate SSH host keys and restart SSH server</help>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/generate_ssh_server_key.py</command>
+ </node>
+ <tagNode name="client-key">
+ <properties>
+ <help>Re-generate SSH client keypair</help>
+ <completionHelp>
+ <list>&lt;filename&gt;</list>
+ </completionHelp>
+ </properties>
+ <command>ssh-keygen -t rsa -f "$4" -N ""</command>
+ </tagNode>
+ </children>
</node>
</children>
</node>