Paul Tomblin has the right offer.
Set up logging in your sshd_config to point to the syslog tool, which you can log separately:
=> see man 3 syslog for more objects. Choose one, for example,
Then configure your syslog.conf as follows:
local5.info |/var/run/mysshwatcher.pipe
Add the script that you are going to write to / etc / inittab so that it continues to work:
sw0:2345:respawn:/usr/local/bin/mysshwatcher.sh
then write a script:
#!/bin/sh P=/var/run/mysshwatcher.pipe test -p $P || mkfifo $P while read x <$P; do
Finally, restart your syslogd and restart inittab (init q) and it should work. If you use other variants of these services, you need to configure them accordingly (for example, newsyslogd => /etc/newsyslog.conf; Ubuntu: /etc/event.d isntead of inittab)
This is very rudimentary and lacking, but should be enough for you to start ...
Additional Information: man sshd_config for additional logging / verbosity options.
mjy
source share