Installare Openssh dai sorgenti


./configure --sysconfdir=/etc/ssh --with-tcp-wrappers --with-md5-passwords
make -j 7
make install

controllare che il file /etc/ld.so.conf contenga le path delle librerie epoi lanciare
ldconfig

Questo di seguito è il file /etc/rc.d/rc.sshd

####################/etc/rc.d/rc.sshd#####################################

root@proxy2:~# cat /etc/rc.d/rc.sshd
#!/bin/sh
# Start/stop/restart the secure shell server:

sshd_start() {
# Create host keys if needed.
if [ ! -r /etc/ssh/ssh_host_key ]; then
/usr/local/bin/ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ''
fi
if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then
/usr/local/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
fi
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
/usr/local/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
fi
/usr/local/sbin/sshd -f /etc/ssh/sshd_config
}

sshd_stop() {
killall sshd
}

sshd_restart() {
if [ -r /var/run/sshd.pid ]; then
echo "WARNING: killing listener process only. To kill every sshd process, you must"
echo " use 'rc.sshd stop'. 'rc.sshd restart' kills only the parent sshd to"
echo " allow an admin logged in through sshd to use 'rc.sshd restart' without"
echo " being cut off. If sshd has been upgraded, new connections will now"
echo " use the new version, which should be a safe enough approach."
kill `cat /var/run/sshd.pid`
else
killall sshd
fi
sleep 1
sshd_start
}

case "$1" in
'start')
sshd_start
;;
'stop')
sshd_stop
;;
'restart')
sshd_restart
;;
*)
echo "usage $0 start|stop|restart"
esac

################################# FINE ######################################################

decommentare le seguenti righe nel file
/etc/ssh/sshd_config

HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key

lanciare
ln -s /etc/ssh/moduli /usr/local/etc/

Riavviare sshd

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

*