实现ssh强大的chroot功能
在openssh 4.8p1以前的版本,要支持chroot,必须使用第三方的修改。但从openssh 4.8p1以后,chroot功能已经被内置了,为此可以直接在服务器系统(CentOS 5.5)上搭建。
1、为保证远程升级失败而无法连接服务器,在升级前临时打开telnet访问备用。
安装telnet服务
# yum -y install telnet-server
检查telnet是否开机启动
# chkconfig --level 35 --list|grep telnet
# vim /etc/xinetd.d/telnet
disable = no
# /etc/init.d/xinetd start
# netstat -anp|grep 23
tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN 1594/xinetd
$ telnet 192.168.0.200
Telnet是不能以root直接登陆的。以普通用户登录后再su切换root。SSH升级成功后,记得关闭telnet服务。
2、升级openssh server到目前最新版openssh-6.1p1
# ssh -v
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
wget http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-6.1p1.tar.gz
a、以并行的方式升级
tar xzvf openssh-6.1p1.tar.gz
cd openssh-6.1p1
ssh -v
./configure
make
make install
#This will install the OpenSSH binaries in /usr/local/bin, configuration files
in /usr/local/etc, the server in /usr/local/sbin, etc. To specify a different
installation prefix, use the --prefix option to configure:
/usr/local/sbin/sshd -t -f /usr/local/etc/sshd_config
b、以覆盖的方式安装