Instruction Manual
example:
#!/bin/sh
PORT=”$1”
USER=”$2”
echo “Welcome to port $PORT $USER”
The return value from the script controls whether the user is accepted or not, if 0 is returned (or nothing is done on exit as in the above script) the user is permitted, otherwise the user is denied access.
Here is a more complex script which reads from configuration to display the port label if available and denies access to the root user:
#!/bin/sh
PORT=”$1”
USER=”$2”
LABEL=$(config
if [ “$USER” == “root” ]; then
echo “Permission denied for Super User” exit 1
f i
if [
echo “Welcome $USER, you are connected to Port $PORT”
else
echo “Welcome $USER, you are connected to Port $PORT ($LABEL)”
fi