[Solved] Jail does not have SSH env variables available.

Discussion in 'Installation/Configuration' started by Nap, Dec 11, 2020.

  1. Nap

    Nap Member

    I have a small problem where the ISPConfig jailed virtual hosts do not have the `SSH_CONNECTION` environment variable available. This is causing a problem with `gitolite`.

    I'm assuming that the 'jail' software is 'chroot'. Whilst I don't want to accept environment variables from the clients themselves, but I do need this variable passed in from SSH and CHROOT.

    How can I get SSH/CHROOT to pass the SSH_CONNECTION variable to jailed users?
     
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    I think there's a config setting under /etc/jailkit/ for env variables to allow. (I'll take a look when I'm at a computer.) That would be a good one to add in ispconfig, if you want to create an issue for it in gitlab.
     
    ahrasis likes this.
  3. Nap

    Nap Member

    Thanks Jesse. You're on the right track but I've figured it out already.
    In global /etc/jailkit, the `jk_chrootsh.ini` file needed to be modified as follows:

    env = TERM, PATH, SSH_CONNECTION, SSH_ORIGINAL_COMMAND
     
    till and ahrasis like this.

Share This Page