Running following script for checking root ssh login status.
Code:
Flag=`cat /etc/ssh/sshd_config | grep "^PermitRootLogin"`
if [ -z "$Flag" ]
then
echo "PermitRootLogin is not yet set"
else
echo "$Flag"
YESNOFlag=`echo $Flag|awk '{print $2}'`
if [ "$YESNOFlag" == "yes" ]
then
echo "Root Login Is Enabled"
elif [ "$YESNOFlag" == "no" ]
then
echo "Root Login Is Disabled"
else
echo "Unable to Determine the value"
fi
However i m getting below error.
Code:
# test.sh
/usr/local/sbin/test.sh: line 18: syntax error: unexpected end of file
---------- Post added 06-16-11 at 05:53 AM ----------
Figured out myself sorry for inconvenience.