1. 在sunfreeware下载如下安装包
zip-2.32-sol8-sparc-local.gz
zlib-1.2.3-sol8-sparc-local.gz
libgcc-3.4.6-sol8-sparc-local.gz
prngd-0.9.25-sol8-sparc-local.gz
tcp_wrappers-7.6-sol8-sparc-local.gz
openssl-0.9.8f-sol8-sparc-local.gz
openssh-4.7p1-sol8-sparc-local.gz
2.gunzip解压并安装
pkgadd -d ./zip-2.32-sol8-sparc-local
pkgadd -d ./zip-2.32-sol8-sparc-local
pkgadd -d ./zlib-1.2.3-sol8-sparc-local
pkgadd -d ./libgcc-3.4.6-sol8-sparc-local
pkgadd -d ./prngd-0.9.25-sol8-sparc-local
pkgadd -d ./tcp_wrappers-7.6-sol8-sparc-local
pkgadd -d ./openssl-0.9.8f-sol8-sparc-local
pkgadd -d ./openssh-4.7p1-sol8-sparc-local
3.在/etc/passwd 增加一行
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
4. 创建一个/var/empty 目录, 然后在/etc/init.d/ 创建一个文件sshd
/etc/init.d/sshd
#! /bin/sh
#
# start/stop the secure shell daemon
case "$1" in
'start')
# Start the ssh daemon
if [ -f /usr/local/sbin/sshd ]; then
echo "starting SSHD daemon"
/usr/local/sbin/sshd &
fi
;;
'stop')
# Stop the ssh deamon
PID=`/usr/bin/ps -e -u 0 | /usr/bin/fgrep sshd | /usr/bin/awk '{print $1}'`
if [ ! -z "$PID" ] ; then
/usr/bin/kill ${PID} >/dev/null 2>&1
fi
;;
*)
echo "usage: /etc/init.d/sshd {start|stop}"
;;
esac
执行以下命令
#chmod +x /etc/init.d/sshd
#ln –s /etc/init.d/sshd /etc/rc2.d/S99sshd
5. 创建另外一个文件/etc/init.d/prngd
#! /bin/sh
#
# start/stop the pseudo random generator daemon
case "$1" in
'start')
# Start the ssh daemon
if [ -f /usr/local/sbin/prngd ]; then
echo "starting PRNG daemon"
/usr/local/sbin/prngd /var/spool/prngd/pool&
fi
;;
'stop')
# Stop the ssh deamon
PID=`/usr/bin/ps -e -u 0 | /usr/bin/fgrep prngd | /usr/bin/awk '{print $1}'`
if [ ! -z "$PID" ] ; then
/usr/bin/kill ${PID} >/dev/null 2>&1
fi
;;
*)
echo "usage: /etc/init.d/prngd {start|stop}"
;;
esac
为prngd创建一个临时目录并执行其他两个命令
mkdir -p /var/spool/prngd.
#chmod +x /etc/init.d/prngd
#ln –s /etc/init.d/prngd /etc/rc2.d/S99prngd
6. 创建密钥
# /usr/local/bin/ssh-keygen -d -f /usr/local/etc/ssh_host_dsa_key -N ""
# /usr/local/bin/ssh-keygen -b 1024 -f /usr/local/etc/ssh_host_rsa_key -t rsa -N ""
7. 在/usr/local/etc/sshd_config对下面一行取消注释
Protocol 2,1
8. 启动进程
# /etc/init.d/prngd start
# /etc/init.d/sshd start
阅读(1419) | 评论(0) | 转发(0) |