how to differentiate inside PAM "login using ssh" vs. "file transfer via scp" ?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


  have a PAM related question
  - lets say we have two linux boxes A and B
  - box B runs an Openssh server
  - I have to use cases:
    - UC1: ssh login from A to B
    - UC2: transfer files from A to B using scp
  - from my understanding both use cases UC1 and UC2 create a new
instance of sshd
    and handle the case

  - now my question:
    - I have to extend the PAM handling for B in a way that I can
distinguish between
      use case UC1 and UC2
    - the reason is that I need specific handling inside PAM for UC1
vs. UC2
    - currently I have no idea how to find out inside my PAM code if
the code runs UC1 or UC2
    - my first plan was to differentiate via  getenv("SSH_CLIENT") and
      but both are null at the time I need the info - so cannot use

  any idea ?


Site Timeline