标题:编译安装更新SSH到6.7 出处:刘新修 时间:Sun, 04 Oct 2015 14:25:13 +0000 作者:刘新修 地址:http://liuxinxiu.com:80/make_install_sshd/ 内容: C++代码 下载openssh-6.7p1.tar.gz wget http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-6.7p1.tar.gz cd openssh-6.7p1/ 备份ssh配置文件 : mv /etc/ssh /etc/ssh.bak 查看是否缺包 rpm -qa | egrep "gcc|make|perl|pam|pam-devel|zlib|zlib-devel" 如果有配置yum了的话可以直接yum安装这些包,这样既可以检验是否装了,没装的直接装上。 yum -y install gcc* make perl pam pam-devel zlib zlib-devel openssl openssl-devel 先卸载完旧版本的openssh rpm -e `rpm -qa | grep openssh 如果configure时出现-- configure: error: *** OpenSSL headers missing - please install first or check config.log *** [root@localhost openssh-6.7p1]# 解决办法:安装openssl以及openssl-devel yum install openssl openssl-devel ./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-zlib --with-md5-passwords make make install 查看最新的版本: sshd -v 复制启动脚本到/etc/init.d cp /home/openssh-6.7p1/contrib/redhat/sshd.init /etc/init.d/sshd 加入开机自启 chkconfig --add sshd chkconfig sshd on chkconfig --list 启动sshd,用start或reload。不要restart,restart 会直接断开连接,而并不会接着启动sshd服务,这时候要通过其他途径进入机器,然后启动sshd服务才行。 如果xshell4连接不上,修改配置,使xshell4默认支持: vi /etc/ssh/sshd_config #x11Forwarding yes #UseLogin yes Generated by Bo-blog 2.1.1 Release