I need to keep track of all SSH connections on my server. In my /etc/hosts.allow I have something like this:
sshd: ALL : spawn ( echo "`date` from %u %a " >> /var/log/ssh/%d.log ) &
where %a logs the client IP, and %u is supposed to log the username. But instead %u just logs unknown. Is there a way to fix this? I need to log both the IP and the username for each connection.