From 1c05f8fcbaa53996874cb8aab67a43ad4239e8d8 Mon Sep 17 00:00:00 2001 From: BrainwreckedTech <3752022+BrainwreckedTech@users.noreply.github.com> Date: Mon, 14 Nov 2022 01:04:37 -0500 Subject: [PATCH] Add `status` verb --- sshdpw | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sshdpw b/sshdpw index b7b091e..2007b82 100755 --- a/sshdpw +++ b/sshdpw @@ -16,6 +16,9 @@ case "${1}" in FROM=no; TO=yes; fi ;; + status) + true + ;; *) echo 'Must specify one of the following:' echo ' [ on | yes | enable | unlock ] to allow interactive passwords' @@ -27,7 +30,7 @@ case "${1}" in esac for OPTION in PasswordAuthentication KbdInteractiveAuthentication ChallengeResponseAuthentication; do - sed -i "s/#* *${OPTION} *${FROM}/${OPTION} ${TO}/g" /etc/ssh/sshd_config + [ -n "${FROM}" ] && sed -i "s/#* *${OPTION} *${FROM}/${OPTION} ${TO}/g" /etc/ssh/sshd_config grep "^#* *${OPTION} *\(yes\|no\)" /etc/ssh/sshd_config done