diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-21 08:32:32 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-21 08:32:32 +0200 |
commit | 6483529fd6d60f8ae3f996f9089faf289ef86b1d (patch) | |
tree | 602ade86d860a85fe1b0fbbae435629eaa4a113b | |
parent | 7695fa275dafebf70af448bda0b01c5951f3a3e1 (diff) | |
download | alpine-conf-6483529fd6d60f8ae3f996f9089faf289ef86b1d.zip |
setup-sshd: fix prompts
Use 'ssh' in lowercase consistently
Fix duplicate [prohibit-password]
-rw-r--r-- | setup-sshd.in | 4 | ||||
-rwxr-xr-x | tests/setup_sshd_test | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/setup-sshd.in b/setup-sshd.in index fabea69..b6c2877 100644 --- a/setup-sshd.in +++ b/setup-sshd.in @@ -35,7 +35,7 @@ case "$1" in esac while ! isin "$sshdchoice" openssh dropbear none; do - ask "Which SSH server? ('openssh', 'dropbear' or 'none')" openssh + ask "Which ssh server? ('openssh', 'dropbear' or 'none')" openssh sshdchoice="$resp" done @@ -52,7 +52,7 @@ $MOCK apk add --quiet $pkgs if [ "$sshdchoice" = "openssh" ] && [ -z "$authorized_key" ]; then while true; do - ask "Allow root ssh login? ('yes', 'no', 'prohibit-password' or KEYURL) [prohibit-password]" prohibit-password + ask "Allow root ssh login? ('yes', 'no', 'prohibit-password' or KEYURL)" prohibit-password case "$resp" in yes|no|prohibit-password) sed -i -E -e "s/^#?\s*PermitRootLogin.*/PermitRootLogin $resp/" "$ROOT"/etc/ssh/sshd_config diff --git a/tests/setup_sshd_test b/tests/setup_sshd_test index 6df679c..23a6f07 100755 --- a/tests/setup_sshd_test +++ b/tests/setup_sshd_test @@ -46,7 +46,10 @@ setup_sshd_interactive_body() { init_env mkdir -p etc/ssh echo "PermitRootLogin foobar" > etc/ssh/sshd_config - printf "%s\n%s\n" openssh no | atf_check -s exit:0 \ + ( + echo "openssh" + echo "no" + ) | atf_check -s exit:0 \ -e empty \ -o match:"Which SSH server" \ -o match:"^apk add .* openssh" \ |