Neue Version V963
git-svn-id: svn://svn.compuextreme.de/Viitor/V963/Viitor_openssh@5933 504e572c-2e33-0410-9681-be2bf7408885
This commit is contained in:
commit
c8d6aa7801
96
etc/init.d/sshd
Normal file
96
etc/init.d/sshd
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Startscript for SSH 2.x
|
||||||
|
# (c) RainMaker Multimedia OHG
|
||||||
|
# Autor: Harald Küller
|
||||||
|
# (c) Rainmaker MultiMedia OHG
|
||||||
|
#
|
||||||
|
# $Author$
|
||||||
|
# $Date$
|
||||||
|
# $Revision$
|
||||||
|
#
|
||||||
|
# $Log$
|
||||||
|
# Revision 1.6 2003/04/19 08:07:15 kueller
|
||||||
|
# Restart Option hinzugefügt
|
||||||
|
#
|
||||||
|
# Revision 1.5 2002/08/07 20:49:00 hkueller
|
||||||
|
# Anpassungen an neue Version - ssh-keygen braucht unbedingt Angabe
|
||||||
|
# des Schlüsseltypes - vorher war default rsa1
|
||||||
|
#
|
||||||
|
# Revision 1.4 2002/01/23 00:55:59 kueller
|
||||||
|
# ssh wird nun nach abgesruerztem System korrekt gestartet
|
||||||
|
#
|
||||||
|
# Revision 1.3 2002/01/11 16:02:57 kueller
|
||||||
|
# Generierung der Keys an aktuelle Version angepasst
|
||||||
|
#
|
||||||
|
# Revision 1.2 2002/01/11 15:50:14 kueller
|
||||||
|
# Berechtigungen der Keys werden nach Erzeugung sicher gesetzt (0600)
|
||||||
|
#
|
||||||
|
# Revision 1.1.1.1 2001/09/23 00:31:42 kueller
|
||||||
|
# Neustart wg. Datenverlust
|
||||||
|
#
|
||||||
|
# Revision 1.3 2001/08/31 22:26:27 kueller
|
||||||
|
#
|
||||||
|
# Script erzeugt beim shutdown des Systems fehler. Start und Stop Prozess neu
|
||||||
|
# geschrieben. PID von sshd wird nun in /var/run/ssh.pid gespeichtert.
|
||||||
|
# Gleichzeitig dient diese Datei zur Überprüfung, ob das Programm bereits
|
||||||
|
# läuft.
|
||||||
|
#
|
||||||
|
# Revision 1.2 2001/08/24 15:17:16 kueller
|
||||||
|
#
|
||||||
|
# ssh_host_key Tabels werden nun automatisch generiert,
|
||||||
|
# wenn noch nicht vorhanden.
|
||||||
|
#
|
||||||
|
# Revision 1.1.1.1 2001/08/24 14:58:35 kueller
|
||||||
|
# openssh addons
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
source /etc/init.d/functions
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
if [ ! -f /etc/sysconfig/ssh/ssh_host_key ]; then
|
||||||
|
ssh-keygen -N "" -t rsa1 -f /etc/sysconfig/ssh/ssh_host_key
|
||||||
|
ssh-keygen -N "" -t rsa -f /etc/sysconfig/ssh/ssh_host_rsa_key
|
||||||
|
ssh-keygen -N "" -t dsa -f /etc/sysconfig/ssh/ssh_host_dsa_key
|
||||||
|
chmod 0600 /etc/sysconfig/ssh/*key*
|
||||||
|
fi
|
||||||
|
if [ -f /var/run/ssh.pid ]; then
|
||||||
|
if pgrep -f /usr/sbin/sshd >/dev/null; then
|
||||||
|
echo -n "ssh seems to run already - dont start it. Check /var/run/ssh.pid!"
|
||||||
|
print_status failure
|
||||||
|
else
|
||||||
|
rm /var/run/ssh.pid
|
||||||
|
echo -n "ssh cleaned up - starting now ssh"
|
||||||
|
/usr/sbin/sshd
|
||||||
|
evaluate_retval
|
||||||
|
pidof sshd >/var/run/ssh.pid
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo -n "Starting Secure Shell"
|
||||||
|
/usr/sbin/sshd
|
||||||
|
evaluate_retval
|
||||||
|
pidof sshd >/var/run/ssh.pid
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
if [ -f /var/run/ssh.pid ]; then
|
||||||
|
echo -n "Stopping Secure Shell"
|
||||||
|
kill -9 `cat /var/run/ssh.pid`
|
||||||
|
evaluate_retval
|
||||||
|
rm /var/run/ssh.pid
|
||||||
|
else
|
||||||
|
echo -n "ssh seems not to run - dont stop it"
|
||||||
|
print_status failure
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
$0 stop
|
||||||
|
sleep 1
|
||||||
|
$0 start
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "USAGE: $0 {start|stop|restart}"
|
||||||
|
esac
|
21
etc/init/sshd.conf
Normal file
21
etc/init/sshd.conf
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
description "ssh daemon startup"
|
||||||
|
author "Harald Kueller <harald.kueller@compuextreme.de>"
|
||||||
|
version 1.0
|
||||||
|
emits none special
|
||||||
|
|
||||||
|
start on (runlevel [2345] and (started rpc))
|
||||||
|
stop on runlevel [016]
|
||||||
|
|
||||||
|
console none
|
||||||
|
|
||||||
|
pre-start script
|
||||||
|
if [ ! -f /etc/sysconfig/ssh/ssh_host_key ]; then
|
||||||
|
ssh-keygen -N "" -t rsa1 -f /etc/sysconfig/ssh/ssh_host_key
|
||||||
|
ssh-keygen -N "" -t rsa -f /etc/sysconfig/ssh/ssh_host_rsa_key
|
||||||
|
ssh-keygen -N "" -t dsa -f /etc/sysconfig/ssh/ssh_host_dsa_key
|
||||||
|
chmod 0600 /etc/sysconfig/ssh/*key*
|
||||||
|
fi
|
||||||
|
end script
|
||||||
|
|
||||||
|
exec /usr/sbin/sshd -D
|
||||||
|
|
34
init/genpkg
Normal file
34
init/genpkg
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#genpkg script für openssh
|
||||||
|
#(c) Rainmaker MultiMedia OHG
|
||||||
|
#
|
||||||
|
#$Author$
|
||||||
|
#$Date$
|
||||||
|
#$Revision$
|
||||||
|
#
|
||||||
|
#$Log$
|
||||||
|
#Revision 1.2 2001/10/17 08:36:53 kueller
|
||||||
|
#Rechtekorrektur für init script
|
||||||
|
#
|
||||||
|
#Revision 1.1.1.1 2001/09/23 00:31:42 kueller
|
||||||
|
#Neustart wg. Datenverlust
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
if [ -d /var/install/sysvinit* ]; then
|
||||||
|
WDIR=`pwd`
|
||||||
|
cd etc/init.d
|
||||||
|
chmod 755 sshd
|
||||||
|
mkdir rc{0,1,2,3,4,5,6}.d
|
||||||
|
for i in 0 1 2 6; do
|
||||||
|
cd rc$i.d
|
||||||
|
ln -s ../sshd K75sshd
|
||||||
|
cd ..
|
||||||
|
done
|
||||||
|
for i in 3 4 5; do
|
||||||
|
cd rc$i.d
|
||||||
|
ln -s ../sshd S15sshd
|
||||||
|
cd ..
|
||||||
|
done
|
||||||
|
cd $WDIR
|
||||||
|
fi
|
55
tmp/postinstall
Normal file
55
tmp/postinstall
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#Framework, welches ein komplettes Linux System aus den Sourcen erstellt
|
||||||
|
#dieses Framework wird im CVS Repository
|
||||||
|
#:pserver:cvs.rainmaker-mm.de/RMM/cvs zur Verfügung gestellt
|
||||||
|
#
|
||||||
|
#Lage dieser Datei im Archiv: $Source$
|
||||||
|
#
|
||||||
|
#(c) Rainmaker MultiMedia OHG
|
||||||
|
#This program is free software; you can redistribute it and/or
|
||||||
|
#modify ist under the terms of the GNU General Public License
|
||||||
|
#as published by the Free Software Foundation; either version
|
||||||
|
#2 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
#This program is distributed in the hope that it will be useful,
|
||||||
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
#See the GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
#You should have received a copy of the GNU General Public License
|
||||||
|
#along with this program; if not write to the Free Software Foundation,
|
||||||
|
#Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
#
|
||||||
|
#Beschreibung:
|
||||||
|
#Postinstallation Datei für openssh
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#Aufrufparameter:
|
||||||
|
#
|
||||||
|
#Letzte Änderung von: $Author$
|
||||||
|
#Datum der letzten Änderung: $Date$
|
||||||
|
#Version der Datei: $Revision$
|
||||||
|
#
|
||||||
|
#$Log$
|
||||||
|
#Revision 1.4 2007/04/29 10:01:24 kueller
|
||||||
|
#ssh user und group wird jetzt fest auf uid 41 und gid 20 angelegt
|
||||||
|
#
|
||||||
|
#Revision 1.3 2007/02/22 14:33:51 kueller
|
||||||
|
#Abfrage auf vorhandensein von sshd (user) verbessert
|
||||||
|
#
|
||||||
|
#Revision 1.2 2002/10/09 08:17:35 kueller
|
||||||
|
#1. Zeile war eine Leerzeile, dadurch kann es zu fehlern bei der Script
|
||||||
|
#ausführung kommen (z.B. falsche Shell)
|
||||||
|
#
|
||||||
|
#Revision 1.1 2002/08/07 20:50:50 hkueller
|
||||||
|
#Postinstall zur anlage des inzwischen notwendigen sshd users
|
||||||
|
#erzeugt
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
if ! getent group sshd >/dev/null; then
|
||||||
|
groupadd -g 20 sshd
|
||||||
|
fi
|
||||||
|
if ! getent passwd sshd >/dev/null; then
|
||||||
|
useradd -u 41 sshd -g sshd
|
||||||
|
fi
|
39
tmp/postremove
Normal file
39
tmp/postremove
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#Framework, welches ein komplettes Linux System aus den Sourcen erstellt
|
||||||
|
#dieses Framework wird im CVS Repository
|
||||||
|
#:pserver:cvs.rainmaker-mm.de/RMM/cvs zur Verfügung gestellt
|
||||||
|
#
|
||||||
|
#Lage dieser Datei im Archiv: $Source$
|
||||||
|
#
|
||||||
|
#(c) Rainmaker MultiMedia OHG
|
||||||
|
#This program is free software; you can redistribute it and/or
|
||||||
|
#modify ist under the terms of the GNU General Public License
|
||||||
|
#as published by the Free Software Foundation; either version
|
||||||
|
#2 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
#This program is distributed in the hope that it will be useful,
|
||||||
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
#See the GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
#You should have received a copy of the GNU General Public License
|
||||||
|
#along with this program; if not write to the Free Software Foundation,
|
||||||
|
#Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
#
|
||||||
|
#Beschreibung:
|
||||||
|
#Postinstallation Datei für openssh
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#Aufrufparameter:
|
||||||
|
#
|
||||||
|
#Letzte Änderung von: $Author$
|
||||||
|
#Datum der letzten Änderung: $Date$
|
||||||
|
#Version der Datei: $Revision$
|
||||||
|
#
|
||||||
|
|
||||||
|
if getent passwd sshd >/dev/null; then
|
||||||
|
userdel sshd
|
||||||
|
fi
|
||||||
|
if getent group sshd >/dev/null; then
|
||||||
|
groupdel sshd
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user