diff options
author | Thierry N <thierryn1 at hispeed dot ch> | 2009-08-07 14:32:20 +0200 |
---|---|---|
committer | Thierry N <thierryn1 at hispeed dot ch> | 2009-08-07 14:32:20 +0200 |
commit | 7e06f22a97d094f7c8f87f0fa5b1e242f9a26477 (patch) | |
tree | 2e5b7091b4eb10b4863971186d3f113550e82533 /base/openssh/sshd | |
parent | e07992417e54600a336ef2eafe09cc329893b815 (diff) | |
download | nutyx-pakxe-7e06f22a97d094f7c8f87f0fa5b1e242f9a26477.tar.gz nutyx-pakxe-7e06f22a97d094f7c8f87f0fa5b1e242f9a26477.tar.bz2 nutyx-pakxe-7e06f22a97d094f7c8f87f0fa5b1e242f9a26477.tar.xz nutyx-pakxe-7e06f22a97d094f7c8f87f0fa5b1e242f9a26477.zip |
Ajout de openssh#5.2p1-1
Diffstat (limited to 'base/openssh/sshd')
-rw-r--r-- | base/openssh/sshd | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/base/openssh/sshd b/base/openssh/sshd new file mode 100644 index 000000000..468b89973 --- /dev/null +++ b/base/openssh/sshd @@ -0,0 +1,63 @@ +#!/bin/sh +# Begin $rc_base/init.d/sshd + +# Based on sysklogd script from LFS-3.1 and earlier. +# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org +# Add create user and Groups - thierryn1@hispeed.ch + +# $Id: sshd,v 1.2 2007/09/26 10:21:45 install Exp install $ + +. /etc/sysconfig/rc +. $rc_functions +newgroup=sshd +newuser=sshd +newid=50 +getent group $newgroup > /dev/null || /usr/sbin/groupadd -g $newid $newgroup +getent passwd $newuser > /dev/null || /usr/sbin/useradd -g $newgroup \ +-u $newid -d /var/lib/sshd -s /bin/false -c "sshd PrivSep" $newuser + +case "$1" in + start) + boot_mesg "Starting SSH Server..." + if [ ! -f /etc/ssh/ssh_host_key ]; then + /usr/bin/ssh-keygen -t rsa1 -N "" -f /etc/ssh/ssh_host_key + fi + if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then + /usr/bin/ssh-keygen -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key + fi + if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then + /usr/bin/ssh-keygen -t dsa -N "" -f /etc/ssh/ssh_host_dsa_key + fi + # Also prevent ssh from being killed by out of memory conditions + loadproc /usr/sbin/sshd + sleep 1 + echo "-16" >/proc/`cat /var/run/sshd.pid`/oom_adj + ;; + + stop) + boot_mesg "Stopping SSH Server..." + killproc /usr/sbin/sshd + ;; + + reload) + boot_mesg "Reloading SSH Server..." + reloadproc /usr/sbin/sshd + ;; + + restart) + $0 stop + sleep 1 + $0 start + ;; + + status) + statusproc /usr/sbin/sshd + ;; + + *) + echo "Usage: $0 {start|stop|reload|restart|status}" + exit 1 + ;; +esac + +# End $rc_base/init.d/sshd |