From: gobo72 Date: Sun, 8 May 2011 03:44:08 +0000 (+0000) Subject: Desactive serveur SSH par defaut X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=f09e4ad6942319f2d272034fc6e15dc6159dee37;p=hvlinux.git Desactive serveur SSH par defaut --- diff --git a/stage2/install-bootscripts b/stage2/install-bootscripts index d6acdd0..8785e7e 100755 --- a/stage2/install-bootscripts +++ b/stage2/install-bootscripts @@ -62,6 +62,9 @@ cat >> /etc/sysconfig/network/network-parameters << EOF # Set to "yes" to enable the NFS server: NFS_SERVER_ENA="no" +# Set to "yes" to enable the SSH server: +SSH_SERVER_ENA="no" + # Set FIREWALL_ENA to "yes" to enable the firewall: FIREWALL_ENA="no" # Set FIREWALL_WWW to the ethernet interface connected to the outside world (internet): diff --git a/stage3/bootscripts/sshd b/stage3/bootscripts/sshd index 58060d1..026f04d 100755 --- a/stage3/bootscripts/sshd +++ b/stage3/bootscripts/sshd @@ -5,10 +5,17 @@ # Source functions library source /etc/rc.d/init.d/functions +source /etc/sysconfig/network/network-parameters + log_script_name "$0 $*" SSHD="/usr/sbin/sshd -4" +# Check if SSH server is desired +if [ "x${SSH_SERVER_ENA}" != "xyes" -a "x${SSH_SERVER_ENA}" != "xYes" -a "x${SSH_SERVER_ENA}" != "xYES" ]; then + exit ${EXIT_CODE_SUCCESS} +fi + gen_keys() { if [ ! -e /etc/ssh/ssh_host_key ] ; then echo "Generating Hostkey..." @@ -33,7 +40,7 @@ sshd_start() { fi gen_keys - + if [ $? -ne 0 ]; then exit ${EXIT_CODE_FAILURE} else @@ -46,15 +53,15 @@ case "$1" in start) cmd_run_log_box_warn "Starting sshd" sshd_start ;; - + stop) cmd_run_log_box_warn "Stopping sshd" killproc sshd ;; - + reload) reloadproc sshd ;; - + restart) $0 stop sleep 1 @@ -64,7 +71,7 @@ case "$1" in status) statusproc sshd ;; - + *) echo "Usage: $0 {reload|restart|start|status|stop}" exit ${EXIT_CODE_FAILURE}