Wednesday, May 13, 2009

SSH pe Solaris 6

# Se instaleaza openssl, openssh, zlib,libgcc, prngd
mkdir /var/empty
chown root:sys /var/empty
chmod 755 /var/empty
groupadd sshd
useradd -g sshd -c 'sshd privsep' -d /var/empty -s /bin/false sshd
cat /var/log/* > /etc/prngd-seed
/usr/local/sbin/prngd /var/run/egd-pool
ssh-keygen -t rsa1 -f /usr/local/etc/ssh_host_key -N ""
ssh-keygen -t rsa1 -f /usr/local/etc/ssh_host_key -N ""
ssh-keygen -t dsa -f /usr/local/etc/ssh_host_dsa_key -N ""
ssh-keygen -t rsa -f /usr/local/etc/ssh_host_rsa_key -N ""
ln -s /etc/init.d/sshd /etc/rc2.d/S98sshd
ln -s /etc/init.d/prngd /etc/rc2.d/S97sshd
chmod ug+x /etc/init.d/sshd
chown root /etc/init.d/sshd
chgrp sys /etc/init.d/sshd
/etc/init.d/sshd start

# /etc/init.d/sshd contine:
#!/bin/sh

pid=`/usr/bin/ps -e | /usr/bin/grep sshd | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'`
case $1 in
'start')
/usr/local/sbin/sshd
;;
'stop')
if [ "${pid}" != "" ]
then
/usr/bin/kill ${pid}
fi
;;
*)
echo "usage: /etc/init.d/sshd {start|stop}"
;;
esac

############################################

# /etc/init.d/prngd contine:
#!/bin/sh

pid=`/usr/bin/ps -e | /usr/bin/grep prngd | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'`
case $1 in
'start')
/usr/local/sbin/prngd /var/spool/prngd/pool
;;
'stop')
if [ "${pid}" != "" ]
then
/usr/bin/kill ${pid}
fi
;;
*)
echo "usage: /etc/init.d/prngd {start|stop}"
;;
esac

No comments:

Post a Comment