AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 121049
In Process
benjisail
benjisail
Asked: 2010-03-11 01:28:55 +0800 CST2010-03-11 01:28:55 +0800 CST 2010-03-11 01:28:55 +0800 CST

在 Centos 5.4 上创建 chrooted SFTP 的最简单和最干净的方法是什么?

  • 772

我想以一种干净的方式设置一个带有 chroot(或等效)登录到我的 Centos 5.4 服务器的 SFTP。通过简洁的方式,我的意思是尽可能只使用 YUM 命令,并且使用易于维护和易于扩展的东西(例如添加额外 SFTP 用户的简单方法)。

CentOS 5.4 的问题在于 OpenSSH 在存储库中的版本为 4.3,因此无法使用 OpenSSH 4.8+ 的内置 chroot 功能。

安装 RSSH 需要手动创建一个 chrooted 目录,这对我来说似乎不容易维护。

MySecureShell 是另一种解决方案,但它需要比存储库中更高版本的 openSSL。

我知道我可以手动安装更高版本的 OpenSSH,但我会失去 Yum 命令的所有优势,如果我想在未来进行一些更新,维护起来可能会变得很棘手......

您是否有一种简单而干净的方法来在 centOS 5.4 服务器上设置 chrooted SFTP 登录?

谢谢!

centos ssh sftp chroot
  • 1 1 个回答
  • 1079 Views

1 个回答

  • Voted
  1. Redride
    2010-03-11T04:16:48+08:002010-03-11T04:16:48+08:00

    我找到了以下解决方案:

    # yum install gcc
    # yum install openssl-devel
    # yum install pam-devel
    # yum install rpm-build
    # wget http://ftp.bit.nl/mirror/openssh/openssh-5.2p1.tar.gz
    # wget http://ftp.bit.nl/mirror/openssh/openssh-5.2p1.tar.gz.asc
    # wget  -O- http://ftp.bit.nl/mirror/openssh/DJM-GPG-KEY.asc | gpg –-import
    # gpg openssh-5.2p1.tar.gz.asc
    gpg: Signature made Mon 23 Feb 2009 01:18:28 AM CET using DSA key ID 86FF9C48
    gpg: Good signature from “Damien Miller (Personal Key) ”
    gpg: WARNING: This key is not certified with a trusted signature!
    gpg: There is no indication that the signature belongs to the owner.
    Primary key fingerprint: 3981 992A 1523 ABA0 79DB FC66 CE8E CB03 86FF 9C48
    # tar zxvf openssh-5.2p1.tar.gz
    # cp openssh-5.2p1/contrib/redhat/openssh.spec /usr/src/redhat/SPECS/
    # cp openssh-5.2p1.tar.gz /usr/src/redhat/SOURCES/
    # cd /usr/src/redhat/SPECS
    # perl -i.bak -pe ’s/^(%define no_(gnome|x11)_askpass)\s+0$/$1 1/’ > openssh.spec
    # (I found this didn't work and I had to manually disable the two lines for gnome and x11 askpass by changing the 0 to 1)
    # rpmbuild -bb openssh.spec
    # cd /usr/src/redhat/RPMS/`uname -i`
    # ls -l
    -rw-r–r– 1 root root 275808 Feb 27 08:08 openssh-5.2p1-1.x86_64.rpm
    -rw-r–r– 1 root root 439875 Feb 27 08:08
    openssh-clients-5.2p1-1.x86_64.rpm
    -rw-r–r– 1 root root 277714 Feb 27 08:08
    openssh-server-5.2p1-1.x86_64.rpm
    # rpm -Uvh openssh*rpm
    Preparing… ########################################### [100%]
    1:openssh ########################################### [ 33%]
    2:openssh-clients ########################################### [ 67%]
    3:openssh-server ########################################### [100%]
    # service sshd restart
    
    • -1

相关问题

  • Mac OS X:如何在无头机器上运行 GUI 应用程序

  • Windows SSH 客户端

  • 在 Windows Server 2003 上通过 SSH 启动和停止 Mongrel 服务

  • 隧道 Xbox 网络流量 [关闭]

  • 为什么使用authorized_keys通过ssh自动登录不起作用?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    从 IP 地址解析主机名

    • 8 个回答
  • Marko Smith

    如何按大小对 du -h 输出进行排序

    • 30 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    MikeN 在 Nginx 中,如何在维护子域的同时将所有 http 请求重写为 https? 2009-09-22 06:04:43 +0800 CST
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    0x89 bash中的双方括号和单方括号有什么区别? 2009-08-10 13:11:51 +0800 CST
  • Martin Hope
    Kyle Brandt IPv4 子网如何工作? 2009-08-05 06:05:31 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve