#!/bin/sh

#################################################################################
#
#   Lynis
# ------------------
#
# Copyright 2007-2009, Michael Boelen (michael@rootkit.nl), The Netherlands
# Web site: http://www.rootkit.nl
#
# Lynis comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
# welcome to redistribute it under the terms of the GNU General Public License.
# See LICENSE file for usage of this software.
#
#################################################################################
#
# SSH
#
#################################################################################
#
    SSH_DAEMON_RUNNING=0
#
#################################################################################
#
    InsertSection "SSH Support"

    # Test        : SSH-7402
    # Description : Check for a running SSH daemon
    Register --test-no SSH-7402 --weight L --network NO --description "Check for running SSH daemon"
    if [ ${SKIPTEST} -eq 0 ]; then
	logtext "Test: Searching for a SSH daemon..."
	FOUND=0
	
	# Check running processes
	FIND=`${PSBINARY} ax | grep "sshd" | grep -v "grep"`
	    if [ ! "${FIND}" = "" ]; then
	        SSH_DAEMON_RUNNING=1	    
		logtext "Result: SSH daemon is running"
		Display --indent 2 --text "- Checking running SSH daemon..." --result FOUND --color GREEN
	      else
		logtext "Result: No running SSH daemon found"
	        Display --indent 2 --text "- Checking running SSH daemon..." --result "NOT FOUND" --color WHITE
	    fi
    fi
#
#################################################################################
#
    # Test        : SSH-7404
    # Description : PermitRootLogin
    #Register --test-no SSH-7404 --weight L --network NO --description "Check SSH option: PermitRootLogin"
    #if [ ${SKIPTEST} -eq 0 ]; then
    #fi
#
#################################################################################
#
    # Test        : SSH-7406
    # Description : HashKnownHosts
    #Register --test-no SSH-7406 --weight L --network NO --description "Check SSH option: HashKnownHosts"
    #if [ ${SKIPTEST} -eq 0 ]; then
    #fi
#
#################################################################################
#

wait_for_keypress

#
#================================================================================
# Lynis - Copyright 2007-2009, Michael Boelen - www.rootkit.nl - The Netherlands
