3 # $OpenBSD: allow-deny-users.sh,v 1.4 2017/10/20 02:13:41 djm Exp $
5 tid="AllowUsers/DenyUsers"
8 if [ "x$me" = "x" ]; then
20 start_sshd -oDenyUsers="$deny" -oAllowUsers="$allow"
22 ${SSH} -F $OBJ/ssh_config "$me@somehost" true
25 if (test $status -eq 0 && ! $should_succeed) \
26 || (test $status -ne 0 && $should_succeed); then
33 # DenyUsers AllowUsers should_succeed failure_message
34 test_auth "" "" true "user in neither DenyUsers nor AllowUsers denied"
35 test_auth "$other $me" "" false "user in DenyUsers allowed"
36 test_auth "$me $other" "" false "user in DenyUsers allowed"
37 test_auth "" "$other" false "user not in AllowUsers allowed"
38 test_auth "" "$other $me" true "user in AllowUsers denied"
39 test_auth "" "$me $other" true "user in AllowUsers denied"
40 test_auth "$me $other" "$me $other" false "user in both DenyUsers and AllowUsers allowed"
41 test_auth "$other $me" "$other $me" false "user in both DenyUsers and AllowUsers allowed"