centos_openssh_server6.1_chroot配置文档

本文档详细介绍了如何在CentOS 5.5上升级OpenSSH到6.1p1,并配置chroot环境,以限制用户仅能在其家目录中活动,确保服务器安全。步骤包括临时启用telnet服务、升级OpenSSH、配置chroot目录以及创建必要的系统文件和设备节点。
摘要由CSDN通过智能技术生成


实现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、以覆盖的方式安装

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值