安装openssl(就是我们常用的ssh)
软件需求:
下载地址: http://ftp.bytemine.net/pub/
Openssl
Openssh
以上用最新的版本
我所用的版本
openssh-4.6p1.tar.gz
安装openssl
#cd /usr/local/src #tar zxvf openssl-0.9.8e.tar.gz #cd openssl-0.9.8e #./config shared zlib #make #make test #make install mv /usr/bin/openssl /usr/bin/openssl.OFF mv /usr/include/openssl /usr/include/openssl.OFF ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl ln -s /usr/local/ssl/include/openssl /usr/include/openssl
配置库文件搜索路径
#echo "/usr/local/ssl/lib" >> /etc/ld.so.conf #ldconfig –v
测试
openssl version -a OpenSSL 0.9.8e 11 Apr 2007 built on: Sat Mar 24 21:24:41 CST 2007 platform: linux-elf options: bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(idx) compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM OPENSSLDIR: "/usr/local/ssl"
表示openssl 按装成功
安装Openssh
在安装之前,为了保守一点儿,先检查一下pam—deve有没有安装,因为很多时候,因为没有安装这个文件可能会出现 :
Configure:error:PAM header not found
这个需要安装pam-deve
可以直接使用yum install pam*
[root@server openssh-4.6p1]# #cd /usr/local/src [root@server openssh-4.6p1]#tar zxvf openssh-4.6p1.tar.gz [root@server openssh-4.6p1]#cd openssh-4.6p1
[root@server openssh-4.6p1]#./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-zlib --with-ssl-dir=/usr/local/ssl --with-md5-passwords --mandir=/usr/share/man [root@server openssh-4.6p1]# make [root@server openssh-4.6p1]# make install [root@server openssh-4.6p1]# cp contrib/redhat/sshd.init /etc/init.d/sshd [root@server openssh-4.6p1]# chmod +x /etc/init.d/sshd
[root@server openssh-4.6p1]# chkconfig --add sshds (让重启自动起来) [root@server openssh-4.6p1]# service sshd start
会出现如下的报错(其实这时候sshd已经起来了
sshd:WARNING: initlog is deprecated and will be removed in a future release
错误,可能是前面编译安装ssh在启动服务的时候没有更改文件路径,解决方法是:编辑/etc/init.d/sshd
Vi /etc/init.d/sshd
#initlog -c "$SSHD $OPTIONS" && success || failure $SSHD $OPTIONS && success || failure
[root@server openssh-4.6p1]#/etc/init.d/sshd restart
[root@server openssh-4.6p1]# sshd –v (验证一下)