免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2085 | 回复: 0
打印 上一主题 下一主题

Solaris8下安装SSH指南 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-08-04 13:35 |只看该作者 |倒序浏览
Solaris8下安装SSH指南

需要下载的软件:
gcc
libgcc
openssh
openssl
prngd
tcp_wrappers
zlib
ANDIrand
这些软件可以去
http://www.sunfreeware.com
或者
ftp://ftp.sjtu.edu.cn/sites/ftp.sunfreeware.com/
中下载。至于ANDIrand可以从以下地址下载:
http://www.cosy.sbg.ac.at/~andi/SUNrand/pkg/ANDIrand-0.7-5.8-sparc-1.pkg
下载后安装以上软件包:
[email=root@se450]root@se450[/email]
# gunzip gcc*
[email=root@se450]root@se450[/email]
# gunzip libgcc*
[email=root@se450]root@se450[/email]
# gunzip openssh*
[email=root@se450]root@se450[/email]
# gunzip openssl*
[email=root@se450]root@se450[/email]
# gunzip prngd*
[email=root@se450]root@se450[/email]
# gunzip tcp_wrappers*
[email=root@se450]root@se450[/email]
# gunzip zlib*
[email=root@se450]root@se450[/email]
# pkgadd -d gcc-3.4.6-sol8-sparc-local
[email=root@se450]root@se450[/email]
# pkgadd -d openssl-0.9.8h-sol8-sparc-local
[email=root@se450]root@se450[/email]
# pkgadd -d libgcc-3.3-sol8-sparc-local
[email=root@se450]root@se450[/email]
# pkgadd -d zlib-1.2.3-sol8-sparc-local
[email=root@se450]root@se450[/email]
# pkgadd -d tcp_wrappers-7.6-sol8-sparc-local
[email=root@se450]root@se450[/email]
# pkgadd -d openssh-5.0p1-sol8-sparc-local
[email=root@se450]root@se450[/email]
# pkgadd -d prngd-0.9.25-sol8-sparc-local
[email=root@se450]root@se450[/email]
# pkgadd -d ANDIrand-0.7-5.8-sparc-1.pkg
安装完后创建sshd和prngd自启动脚本:
vi /etc/init.d/sshd:
#!/bin/bash
#
#
#star or stop the ssh daemon
case $1 in
    start)
           if [ -f /usr/local/sbin/sshd ];then
               echo "Start the sshd daemon"
               /usr/local/sbin/sshd &
           fi
           ;;
    stop)
           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
[email=root@se450]root@se450[/email]
# ln -s /etc/init.d/sshd /etc/rc2.d/S99sshd
/etc/init.d/prngd:

#!/bin/bash
#
#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
[email=root@se450]root@se450[/email]
# ln -s /etc/init.d/prngd /etc/rc2.d/S99prngd
下来创建sshd的组和用户:
[email=root@se450]root@se450[/email]
# mkdir /var/empty
[email=root@se450]root@se450[/email]
# chown root:sys /var/empty
[email=root@se450]root@se450[/email]
# chmod 755 /var/empty
[email=root@se450]root@se450[/email]
# groupadd sshd
[email=root@se450]root@se450[/email]
# useradd -g sshd -c 'sshd privsep' -d /var/empty -s /bin/false sshd
[email=root@se450]root@se450[/email]
# chown root /etc/init.d/sshd
[email=root@se450]root@se450[/email]
# chgrp sys /etc/init.d/sshd
[email=root@se450]root@se450[/email]
# chmod 555 /etc/init.d/sshd
[email=root@se450]root@se450[/email]
#chmod +x /etc/init.d/sshd /etc/init.d/prngd
完了后启动prngd进程:
[email=root@se450]root@se450[/email]
# /etc/init.d/prngd start
starting PRNG daemon
Info: Random pool not (yet) seeded
Could not bind socket to /var/spool/prngd/pool: No such file or directory 出现这个错误,解决办法如下:
[email=root@se450]root@se450[/email]
# mkdir -p /var/spool/prngd
[email=root@se450]root@se450[/email]
# /etc/init.d/prngd start
starting PRNG daemon
如果出现Info: Random pool not (yet) seeded 这样的错误,是因为你没用安装ANDIrand软件包所致.
在启动sshd进程前,还得做如下操作:
[email=root@se450]root@se450[/email]
#/usr/local/bin/ssh-keygen -d -f /usr/local/etc/ssh_host_dsa_key -N ""
[email=root@se450]root@se450[/email]
#/usr/local/bin/ssh-keygen -b 1024 -f /usr/local/etc/ssh_host_rsa_key -t rsa -N ""
[email=root@se450]root@se450[/email]
# /etc/init.d/sshd start即可!
如需要root以ssh方式登陆,还得修改/usr/local/etc/sshd_config文件,把里面的PermitRootLogin yes行前的注释符号去掉,然后重新启动sshd即可!


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/36549/showart_1105501.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP