Jailed SSH with jailkit and vscode problem

Discussion in 'ISPConfig 3 Priority Support' started by variable99, Aug 19, 2025.

  1. variable99

    variable99 Member HowtoForge Supporter

    I need to solve problem that vscode does not work with jailkit users.
    Does anyone has working [vscode] section for jk_init.ini ?
    Together with AI I made this concoction:

    Code:
    [uidbasics]
    comment = common files for all jails that need user/group information
    paths = /etc/passwd
          , /etc/group
          , /etc/nsswitch.conf
          , /etc/ld.so.conf
    
    libraries = /lib/x86_64-linux-gnu/libnsl.so.2
              , /lib/x86_64-linux-gnu/libnss_files.so.2
              , /lib/x86_64-linux-gnu/libnss_dns.so.2
              , /lib/x86_64-linux-gnu/libnss_compat.so.2
              , /lib/x86_64-linux-gnu/libnss_hesiod.so.2
              , /lib/x86_64-linux-gnu/libnss_myhostname.so.2
              , /lib/x86_64-linux-gnu/libnss_systemd.so.2
    
    [netbasics]
    comment = Debian 12 networking basics
    libraries = /lib/x86_64-linux-gnu/libnss_files.so.2
    
    files = /etc/nsswitch.conf
            /etc/resolv.conf
            /etc/host.conf
            /etc/hosts
            /etc/protocols
            /etc/services
    
    directories = /etc/ssl/certs
    
    [vscode]
    comment = VS Code Remote SSH support
    
    # Basic executables VS Code server may need
    executables = /bin/bash, /bin/sh, /bin/ls, /bin/mkdir, /bin/rm, /bin/ln, /bin/uname, /usr/bin/env, /bin/tar, /bin/gzip, /usr/bin/which, /usr/bin/id
    
    # Required libraries for Debian 12 x86_64
    libraries = /lib/x86_64-linux-gnu/libc.so.6
                /lib/x86_64-linux-gnu/libm.so.6
                /lib/x86_64-linux-gnu/libgcc_s.so.1
                /usr/lib/x86_64-linux-gnu/libstdc++.so.6
                /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
    
    # Optional NSS libraries for hostname resolution
    paths = /lib/x86_64-linux-gnu/libnss_files.so.2
          , /lib/x86_64-linux-gnu/libnss_dns.so.2
          , /lib/x86_64-linux-gnu/libnss_compat.so.2
          , /lib/x86_64-linux-gnu/libnss_systemd.so.2
          , /etc/resolv.conf
          , /etc/hosts
          , /etc/nsswitch.conf
          , /etc/ssl/certs
          , /usr/lib/ssl/certs
    
    # Include basic UID/GID info
    includesections = uidbasics
    
    From vscode side I still get:

    Code:
    [LinuxPrereqs]: The remote host may not meet VS Code Server's prerequisites for glibc and libstdc++
    The only solution to this is to run bash user without jailkit restrictions, but this is not acceptable, as user can go outside his home directory and explore other vhosts in shared environment.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I'm not using VSCode with Jailkit users, so I can't provide you with a working config for that.
     
  3. variable99

    variable99 Member HowtoForge Supporter

    No problems, maybe other members had similar issue. Old thread about vscode problem unfortunately had no solution. fslock problem is not an issue anymore. Hard to find information on the web what exact requirement does vscode server needs. Very obscure bits exist.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    I guess you asked various AI already about the issue?
     
  5. variable99

    variable99 Member HowtoForge Supporter

    Yes, those are not helpful at all. Even suggested to link some root directories which renders jailkit useless as jailed user may receive full access to the node :D . AI tools are good for very limited tasks and you must check and check and re-check again their answers...
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    I think AI can be quite helpful, but of course you must re-check the answer :)

    Here is what Claude 4 suggests:

    Code:
    [uidbasics]
    comment = common files for all jails that need user/group information
    paths = /etc/passwd
          , /etc/group
          , /etc/nsswitch.conf
          , /etc/ld.so.conf
    
    libraries = /lib/x86_64-linux-gnu/libnsl.so.2
              , /lib/x86_64-linux-gnu/libnss_files.so.2
              , /lib/x86_64-linux-gnu/libnss_dns.so.2
              , /lib/x86_64-linux-gnu/libnss_compat.so.2
              , /lib/x86_64-linux-gnu/libnss_hesiod.so.2
              , /lib/x86_64-linux-gnu/libnss_myhostname.so.2
              , /lib/x86_64-linux-gnu/libnss_systemd.so.2
    
    [netbasics]
    comment = Debian 12 networking basics
    libraries = /lib/x86_64-linux-gnu/libnss_files.so.2
    
    files = /etc/nsswitch.conf
            /etc/resolv.conf
            /etc/host.conf
            /etc/hosts
            /etc/protocols
            /etc/services
    
    directories = /etc/ssl/certs
    
    [vscode]
    comment = VS Code Remote SSH support
    
    # Basic executables VS Code server needs
    executables = /bin/bash, /bin/sh, /bin/ls, /bin/mkdir, /bin/rm, /bin/ln, /bin/uname, /usr/bin/env, /bin/tar, /bin/gzip, /usr/bin/which, /usr/bin/id, /bin/cat, /bin/cp, /bin/mv, /usr/bin/dirname, /usr/bin/basename, /usr/bin/readlink, /bin/ps, /usr/bin/kill, /usr/bin/pkill
    
    # Essential system libraries for VS Code Server
    libraries = /lib/x86_64-linux-gnu/libc.so.6
              , /lib/x86_64-linux-gnu/libm.so.6
              , /lib/x86_64-linux-gnu/libgcc_s.so.1
              , /usr/lib/x86_64-linux-gnu/libstdc++.so.6
              , /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
              , /lib/x86_64-linux-gnu/libdl.so.2
              , /lib/x86_64-linux-gnu/libpthread.so.0
              , /lib/x86_64-linux-gnu/librt.so.1
              , /lib/x86_64-linux-gnu/libresolv.so.2
              , /lib/x86_64-linux-gnu/libnss_files.so.2
              , /lib/x86_64-linux-gnu/libnss_dns.so.2
              , /lib/x86_64-linux-gnu/libnss_compat.so.2
              , /lib/x86_64-linux-gnu/libnss_systemd.so.2
    
    # Required paths and directories
    paths = /etc/resolv.conf
          , /etc/hosts
          , /etc/nsswitch.conf
          , /etc/ssl/certs
          , /usr/lib/ssl/certs
          , /proc/version
          , /proc/meminfo
          , /proc/cpuinfo
    
    directories = /tmp
                , /proc
                , /dev
                , /usr/lib/x86_64-linux-gnu
                , /lib/x86_64-linux-gnu
    
    # Include basic UID/GID info
    includesections = uidbasics
     
  7. variable99

    variable99 Member HowtoForge Supporter

    Now I stuck to not be able to create /proc folder inside the jail.

    mkdir: cannot create directory ‘/var/www/clients/client702/web654/proc’: Operation not permitted
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

     

Share This Page