Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I am trying to get chroot to work with OpenSSH, but below config gives me error when restarting ssh, see errot below: Match user djm ForceCommand internal-sftp ChrootDirectory /chroot ...
  1. #1
    Just Joined!
    Join Date
    Jan 2008
    Posts
    14

    Red face chroot with OpenSSH not working RedHat 5 / CentOS 5

    Hi,

    I am trying to get chroot to work with OpenSSH, but below config gives me error when restarting ssh, see errot below:

    Match user djm
    ForceCommand internal-sftp
    ChrootDirectory /chroot


    My OS: CentOS release 5.3 (Final)

    My SSH version:
    [root@dev01 jpssh]# ssh -v
    OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008

    [root@webhost2 jpssh]# rpm -qa | grep ssh
    openssh-4.3p2-29.el5
    openssh-clients-4.3p2-29.el5
    openssh-server-4.3p2-29.el5


    ==
    [root@dev01 jpssh]# /etc/init.d/sshd restart
    Stopping sshd: [FAILED]
    Starting sshd: /etc/ssh/sshd_config: line 14: Bad configuration option: Match
    /etc/ssh/sshd_config: line 15: Bad configuration option: ForceCommand
    /etc/ssh/sshd_config: line 16: Bad configuration option: ChrootDirectory
    /etc/ssh/sshd_config line 124: Subsystem 'sftp' already defined.
    [FAILED]


    Related link: Chroot in OpenSSH

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    From the looks of it, your SSH version doesn't support this new feature. The most current version is 5.2 and you are running 4.3. Go to OpenSSH and install the most recent version. Since these are tarballs, not rpm's, you will first need to remove the current openssh from your system with yum. FYI, I am also running CentOS 5.3, and 4.3 is the openssh version available from the CentOS/RedHat repositories, rpmforge in this case.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Jan 2008
    Posts
    14
    Many thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...