RedHat安装OpenSSH和配置sftp锁定目录
[日期:2012-12-05]
来源:51cto
作者:lhf507
[字体:大 中 小]
操作系统:
[root@station28 ~]# cat /etc/issue.net
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
Kernel \r on an \m
[root@station28 ~]# uname -a
Linux station28.example.com 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
在配置sftp时,需要chroot特定的目录,则openssh的版本需不低于5.1,我这下载的是openssh 6.1版本的源码包,需要进行编译,
则需要安装gcc,同时需要安装openssl-devel-0.9.8e-12.el5
openssh-6.1p1下载地址:或者进入官网下载
ftp://ftp.openbsd.org.ar/pub/OpenBSD/OpenSSH/portable/openssh-6.1p1.tar.gz
若不安装openssl-devel,则报如下错误:
[root@station28 openssh-6.1p1]#./configure --prefix=/usr/local/ssh --sysconfdir=/etc/ssh --with-zlib --with-ssl-dir=/usr/local/ssl--with-md5-passwords --mandir=/usr/share/man
checking for openssl/opensslv.h... no
configure: error: *** OpenSSL headers missing - please install first or check config.log ***
1、配置yum,安装gcc,openssl-devel-0.9.8e-12.el5,和telnet(当ssh不能用的时候,用于连接服务器)
[root@station28 ~]# cat /etc/yum.repos.d/base.repo
[base]
baseurl=file:///mnt/Server
gpgcheck=0
[root@station28 ~]# yum -y install "gcc*"
[root@station28 ~]# yum -y install "openssl-devel-0.9.8e-12.el5"
[root@station28 openssh-6.1p1]# yum -y install "telnet-server*"
卸载openssh,观察openssh的各个包包含的内容:
[root