| 1 |
Troubleshooting chroots is usually hairy, which is why pam_chroot puts out |
| 2 |
so many syslog messages. This file contains a few things to check on if |
| 3 |
you're having problems. If you don't find the answer here, then you may |
| 4 |
also want to check the pam-list archives. |
| 5 |
|
| 6 |
Note that all of the following assumes that you have put pam_chroot into |
| 7 |
debug mode (add the "debug" option to the pam_chroot line in the |
| 8 |
appropriate /etc/pam.d file) and that syslogd is configured to put |
| 9 |
auth.debug messages in some known location (/var/log/messages, |
| 10 |
/var/adm/messages, /var/adm/syslog/syslog.log, etc.) |
| 11 |
|
| 12 |
Under normal operation, pam_chroot will output something similar to the |
| 13 |
following messages when it is in debug mode: |
| 14 |
|
| 15 |
Oct 17 08:38:23 nell pam_chroot[25932]: session: reading config file (/etc/security/chroot.conf) |
| 16 |
Oct 17 08:38:23 nell pam_chroot[25932]: session: expanded path "/chroot" -> "/chroot" |
| 17 |
Oct 17 08:38:23 nell pam_chroot[25932]: session: found chroot_dir "/chroot" for user "schmolli" |
| 18 |
Oct 17 08:38:23 nell pam_chroot[25932]: session: preparing to chroot() |
| 19 |
Oct 17 08:38:23 nell pam_chroot[25932]: session: chroot(/chroot) ok |
| 20 |
Oct 17 08:38:23 nell pam_chroot[25932]: session: returning success |
| 21 |
|
| 22 |
NOTE: the "preparing to chroot()" message is new as of pam_chroot-0.7 |
| 23 |
|
| 24 |
If something had gone wrong with the above session, you would have seen a |
| 25 |
message stating what went wrong, and probably a message stating that an |
| 26 |
error was being returned. |
| 27 |
|
| 28 |
PROBLEM: No pam_chroot syslog messages after the "calling chroot" message |
| 29 |
SOLUTION: This usually happens when the chroot() succeeds, but there is |
| 30 |
no syslogd socket listening inside the chroot. pam_chroot is still |
| 31 |
trying to syslog those messages, but syslogd isn't hearing them. You |
| 32 |
can fix this by "making syslogd work inside the chroot." The way you |
| 33 |
do that varies by OS. Check the man pages for syslogd. |
| 34 |
On linux: add "-a /chroot/dev/log" as an argument to syslogd in the |
| 35 |
appropriate init.d script. |
| 36 |
On solaris: add "-p /chroot/dev/log" as an argument to syslogd in the |
| 37 |
appropriate init.d script. |
| 38 |
|
| 39 |
PROBLEM: No pam_chroot messages at all |
| 40 |
SOLUTION: This usually indicates that the pam_chroot module is not being |
| 41 |
used at all. This might be because you did not add it to the |
| 42 |
appropriate /etc/pam.d file, or it might be that PAM is not being used |
| 43 |
at all. (For example, you might have set 'UsePAM no' in your |
| 44 |
/etc/ssh/sshd_config.) It might also be that syslogd is not running or |
| 45 |
is not configured to report auth.debug messages in the file that you're |
| 46 |
looking for them in. |
| 47 |
There are a multitude of reasons that PAM might not be being used, and |
| 48 |
they're usually application configuration issues, rather than issues with |
| 49 |
PAM itself. |
| 50 |
OpenSSH: Recent versions of OpenSSH require that the following be set in |
| 51 |
your sshd_config: |
| 52 |
ChallengeResponseAuthentication yes |
| 53 |
UsePAM yes |
| 54 |
|
| 55 |
If all else fails, you can use a process tracing tool (strace under linux, |
| 56 |
truss under solaris, or tusc under HP) to figure out what calls your |
| 57 |
application is making, what files it is reading, etc. That will usually |
| 58 |
provide you with a few clues. This is ugly and possibly time-consuming, |
| 59 |
but then again, it's not really very easy to debug somebody else's chroot |
| 60 |
problem over email. |
| 61 |
|