3 # $OpenBSD: allow-deny-users.sh,v 1.5 2018/07/13 02:13:50 djm Exp $
5 tid="AllowUsers/DenyUsers"
8 if [ "x$me" = "x" ]; then
13 cp $OBJ/sshd_proxy $OBJ/sshd_proxy.orig
22 cp $OBJ/sshd_proxy.orig $OBJ/sshd_proxy
23 echo DenyUsers="$deny" >> $OBJ/sshd_proxy
24 echo AllowUsers="$allow" >> $OBJ/sshd_proxy
26 start_sshd -oDenyUsers="$deny" -oAllowUsers="$allow"
28 ${SSH} -F $OBJ/ssh_proxy "$me@somehost" true
31 if (test $status -eq 0 && ! $should_succeed) \
32 || (test $status -ne 0 && $should_succeed); then
37 # DenyUsers AllowUsers should_succeed failure_message
38 test_auth "" "" true "user in neither DenyUsers nor AllowUsers denied"
39 test_auth "$other $me" "" false "user in DenyUsers allowed"
40 test_auth "$me $other" "" false "user in DenyUsers allowed"
41 test_auth "" "$other" false "user not in AllowUsers allowed"
42 test_auth "" "$other $me" true "user in AllowUsers denied"
43 test_auth "" "$me $other" true "user in AllowUsers denied"
44 test_auth "$me $other" "$me $other" false "user in both DenyUsers and AllowUsers allowed"
45 test_auth "$other $me" "$other $me" false "user in both DenyUsers and AllowUsers allowed"