pymumu / jail-shell

Jail-shell is a linux security tool mainly using chroot, namespaces technologies, limiting users to perform specific commands, and access sepcific directories.
GNU General Public License v2.0
110 stars 20 forks source link

undefined symbol: pam_get_user #3

Closed brandstettermichael closed 4 years ago

brandstettermichael commented 4 years ago

Related issue: https://github.com/gravitational/teleport/issues/3171

I'm trying to use jail-shell pam module with "Teleport" it's a SSH Gateway, when using the jail-shell pam module with it I get: PAM unable to dlopen(/lib/x86_64-linux-gnu/security/pam_jail_shell.so): /lib/x86_64-linux-gnu/security/pam_jail_shell.so: undefined symbol: pam_get_user

I tried to use ldd on the file "pam_jail_shell.so":

/lib/x86_64-linux-gnu/security# ldd -r pam_jail_shell.so 
    linux-vdso.so.1 (0x000072e1dab34000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x000072e1d9d7a000)
    /lib64/ld-linux-x86-64.so.2 (0x000072e1dab35000)
undefined symbol: pam_get_user  (./pam_jail_shell.so)
undefined symbol: pam_vsyslog   (./pam_jail_shell.so)
undefined symbol: pam_putenv    (./pam_jail_shell.so)

Check related issue for more details (like my common-session file which Teleport run).

Maybe I need to import a parent library ? I don't know what I am missing..

Your module work in normal SSH tho.

brandstettermichael commented 4 years ago

Doing:

LD_PRELOAD=/lib/x86_64-linux-gnu/libpam.so.0 ldd -r security/pam_jail_shell.so 
    linux-vdso.so.1 (0x000072632017f000)
    /lib/x86_64-linux-gnu/libpam.so.0 (0x000072631f564000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x000072631f1b7000)
    libaudit.so.1 => /lib/x86_64-linux-gnu/libaudit.so.1 (0x000072631ef8f000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x000072631ed8b000)
    /lib64/ld-linux-x86-64.so.2 (0x0000726320180000)
    libcap-ng.so.0 => /lib/x86_64-linux-gnu/libcap-ng.so.0 (0x000072631eb85000)

Return no errors

brandstettermichael commented 4 years ago

Starting teleport with LD_PRELOAD=/lib/x86_64-linux-gnu/libpam.so.0 resolve the issue. Seems like something is wrong on their side, maybe ? Like they are not loading the libpam.so.0 module.

I close the issue this doesn't seem to be related with your module ;)