因为自己的傻,所以才有的此篇日志。也许有人可以发现,在我博客上已经有篇名为“LFS配置IP及安装OpenSSH”,而再写这篇日记是因为自己在Linux下使用了光盘里的OpenSSH,然后装上后使用自己硬盘上的SSH时老是提示已经占用,结果反复装了好几遍才意识到这个问题!~这就好比一个人骑在马上数马的数目一样,总是少一头。哎,悲剧。
切入正题。
下载openssl-0.9.8e.tar.gz包和openssh-4.6p1.tar.gz包。先装SSL。
安装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的版本号,以验正是否安装正确
#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”
安装OpenSSH
#cd /usr/local/src
#tar zxvf openssh-4.6p1.tar.gz
#cd 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
#make
#make install
查看openssh版本号,验正安装结果
# ssh -v
OpenSSH_4.6p1, OpenSSL 0.9.8e 11 Apr 2007
usage: ssh [-1246AaCfgkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-e escape_char] [-F configfile]
[-i identity_file] [-L [bind_address:]port:host:hostport]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-R [bind_address:]port:host:hostport] [-S ctl_path]
[-w local_tun[:remote_tun]] [user@]hostname [command]
调试启动,如果以下显示均正常,就可以正常启动sshd了。
#/usr/sbin/sshd -d
debug1: sshd version OpenSSH_4.6p1
debug1: private host key: #0 type 0 RSA1
debug1: read PEM private key done: type RSA
debug1: private host key: #1 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: private host key: #2 type 2 DSA
debug1: rexec_argv[0]=’/usr/sbin/sshd’
debug1: rexec_argv[1]=’-d’
socket: Address family not supported by protocol
debug1: Bind to port 22 on 0.0.0.0.
Server listening on 0.0.0.0 port 22.
Generating 768 bit RSA key.
RSA key generation complete.
启动服务
#/usr/sbin/sshd
OK了~如果遇见了问题欢迎留言,我反正是给这个OpenSSH给弄得头破血流了~