检查系统是否安装ssh
#rpm –qa |grep ssl
#rpm –qa |grep ssh
#sshd -v
源码升级安装ssh需zlib-
cd /usr/local/src
lftp -e 'mget * ; bye' username:password@192.168.1.4/%2Fhome/sys/script #tar包来源
dos2unix install_ssh.sh
chmod +x install_ssh.sh
./install_ssh.sh
#!/bin/bash
cd /usr/local/src
tar xzvf zlib-
cd zlib-1.2.5
./configure --prefix=/usr/local/zlib-1.2.5 -share
make install
#echo '/usr/local/zlib-会导致图形界面问题
ldconfig -v
ln -s /usr/local/zlib-
cd ..
cd /usr/local/src
tar -zxvf openssl-
cd openssl-1.
./config shared zlib-dynamic --prefix=/usr/local --with-zlib-lib=/usr/local/zlib-1.2.5/lib --with-zlib-include=/usr/local/zlib-1.2.5/include
make install
#bit=$(getconf LONG_BIT)
#if [ "$bit" == 64 ]; then
# echo '/usr/local/openssl-
#elif [ "$bit" == 32 ] ; then
# echo '/usr/local/openssl-1.
#fi
ldconfig -v
ln -s /usr/local/openssl-
echo 'PATH=/usr/local/openssl/bin:$PATH' >> /etc/profile
echo 'export PATH' >> /etc/profile
cd ..
service sshd stop
OPENSSH_PKGS=`rpm -qa | grep openssh`
for pkg in $OPENSSH_PKGS
do
rpm -e "$pkg" --nodeps
done
cd ..
cd /usr/local/src
tar -zxvf openssh-5.5p1.tar.gz
cd openssh-5.5p1
./configure --prefix=/usr --sysconfdir=/etc/ssh --libexecdir=/usr/libexec/openssh --with-tcp-wrappers --without-zlib-version-check
make install
cp ./contrib/redhat/sshd.init /etc/init.d/sshd
chmod +x /etc/init.d/sshd
chkconfig --add sshd
service sshd start
cd /usr/local/src/
rm -rf openssh-5.5p1*
rm -rf openssl-
rm -rf zlib-1.2.5.tar.gz
rm -rf openssl-1.
rm -rf zlib-1.2.5