251 reputation
1311
bio website valentin.hilbig.de
location DE
age
visits member for 3 years, 11 months
seen Aug 22 at 2:21

Unix-Geek


Jul
12
comment Switch on PAM debugging to Syslog
Please note that all lines like pam_* actually are PAM realated. The other lines are output by the tools anyway, regardless if they use PAM or not. This means: If PAM denies, for any reason, it is really hard to find the real cause, if it is in PAM. The non-PAM lines are not helpful (as the problem sits in PAM) and the PAM lines are often not helpful, too, as they are often too silent. With the presence of many PAM modules you really have a hard time guessing which module might be the culprit, let alone to find out how to enable debugging, as this is different for each single one.
Jul
12
comment Switch on PAM debugging to Syslog
/var/log/auth.log is syslog. The problem is not logging but debugging. If for example the PAM stack fails early, you will not see anything, because the modules which output to syslog are not invoked at all. Or something fails and something not, but both log exactly the same lines. It is correct that, I guess, 95% of all cases can be solved by looking into the usual logs, but 5% cannot, as there simply is no trace of what really happens behind the scenes.
Feb
22
comment Command to prepend string to each line?
awk -v T="[TEST %Y%m%d-%H%M%S] " '{ print strftime(T) $0 }' to output a timestamp
Feb
21
comment Command to prepend string to each line?
sed X cmd does read cmd and does not execute it. Either cmd | sed 's/^/[ERROR] /' or sed 's/^/[ERROR] /' <(cmd) or cmd > >(sed 's/^/[ERROR] /'). But beware the latter. Even that this allows you to access the return value of cmd the sed runs in background, so it is likely you see the output after cmd finished. Good for logging into a file, though. And note that awk probably is faster than sed.
Feb
21
comment Command to prepend string to each line?
T="[ERROR] " awk '{ print ENVIRON["T"] $0 }' or T="[ERROR]" awk '{ print ENVIRON["T"] " " $0 }'
Feb
21
comment Command to prepend string to each line?
awk -vT="[ERROR] " '{ print T $0 }' or awk -vT="[ERROR]" '{ print T " " $0 }'
Feb
20
comment Switch on PAM debugging to Syslog
Thanks. Good hint. I'll try if I ever have problems again. So hopefully never .. ;)
Jan
3
comment why is kswapd using high CPU on an idle system?
Please note that the kswap hanging at 100% was confirmed being a Linux bug. It was fixed in mid/end 2012 kernels.
May
26
comment LVM thin provisioning
But it is currently disabled in Wheezy (LVM 2.02.95-7) as thin_check binaries are missing.
May
24
comment How to find the gateway IP address in Linux
I would suggest something like route -n|awk '$4~/G/{print $2; exit(0)}' for the first gateway, but ip route get IP is better, because it lists the route which would be really taken to the given IP, which is difficult to find with route alone
May
24
comment How to find the gateway IP address in Linux
read x x i x< <(ip r g 1), result is in variable $i for further use
Mar
28
comment Unix shell: easy way to get IP from hostname
Because shell traditionally is seen as scripting, not programming ;)
Aug
30
comment Remote IP's with HAProxy
Better use option forwardfor header X-Real-IP and reqidel ^X-Real-IP:, this stops faking IPs in your logs. FYI: X-Real-IP is the default header for NginX' option set_real_ip_from.
Aug
9
comment nginx url rewriting: difference between break and last
pubbs.net link is broken as the domain was taken over. Sorry, was not able to find where it should point. ;(
Jul
4
comment How to tell which local branch is tracking which remote branch in Git?
+1 Your answer gave me exactly what I needed: git rev-parse --symbolic-full-name HEAD vs. git rev-parse --symbolic-full-name HEAD@{u}, thanks!
Nov
1
comment Unix shell: easy way to get IP from hostname
Thanks. And updated for IPv6.
Jul
21
comment Switch on PAM debugging to Syslog
OK, well, I think you answer accutally is correct! It's not the answer's fault that PAM is mute. So for the time being I accept it as "solution" until PAM capitulates. Thanks.
Jul
21
comment Switch on PAM debugging to Syslog
Thanks for the hint, but unfortunately this does not help: pam_unix(sshd:auth): unrecognized option [verbose=1]
Jul
21
comment Switch on PAM debugging to Syslog
I forgot to mention that you must set PermitEmptyPasswords yes in /etc/ssh/sshd_config of course, then PAM outputs something like pam_unix(sshd:auth): authentication failure, but still nothing to the debug channel nor any hint which PAM module caused the failure.
Jul
21
comment Switch on PAM debugging to Syslog
Here is how to create this trouble yourself on Debian: passwd -d user and then try to ssh into the box as this user. The output "failed password" in syslog has nothing to do with PAM debugging at all, so PAM stays silent.