0

I some external Gateway through which the ssh requests come and need to log the sessionID in the linux when the connection happens. I can send the sessionID (some string) along with the username while connecting through SSH

i.e when making a ssh connection I can send username@sessionID

I want the authentication to happen with username and sessionID be stored in some log file /var/log/sessionlog.txt

How do I achieve that ?

what have I tried: Using PAM to change the username using the pam_sm_authenticate function of custom authentication pam_set_user (this will set the username@username to just username) but the ssh logs are:

  1. can't find username 'someusername@axvb123'
  2. disabling the keyboard-interactive for the non-existent user
  3. the authentication succeeded when it should have failed)

0

You must log in to answer this question.

Browse other questions tagged .