are there "session IDs"?
Seven Reeds <[email protected]> Tue, 19 Mar 2013 16:58:29 -0500
| Newsgroups | gmane.linux.pam |
|---|---|
| Message-ID | <CACtmOWB4ozXNftArLpkkyd=n4sFQQ8oYB5k6e-W=855fpa3bSw@mail.gmail.com> |
Hi,
I am running Ubuntu.
I am writing an executable that pam_exec will call in "session" mode.
It will respond to session open/close events. It is almost completely
working. This morning I was testing it using "su" and it was doing
what i expected. I then started ssh-ing to the machine. That's when
things became puzzling.
if I "su" while on the machine the PAM_TTY environment variable is
indeed a TTY string and is unique to the "session". However, if I
treat "ssh" like "su" and try to ssh to a different user on the same
machine, ex:
$ ssh [email protected]
then the PAM_TTY variable just shows "ssh". If I were logged in
multiple times then all would appear to be on the same "line", so to
speak.
This does make sense I suppose. The "su" continues to use the tty of
the caller. The "ssh" will eventually have a new tty. I am calling
my PAM_EXEC's program very late in the session stack so I assumed that
a tty would be available.
Since the tty is not available, is there a unique session identifier
that I can use? I have not seen mention of one.
Seven