Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: OpenSSH: Dev

openssh, pam, challenge-response problem

 

 

OpenSSH dev RSS feed   Index | Next | Previous | View Threaded


skalak at monetplus

Sep 8, 2009, 1:12 AM

Post #1 of 2 (754 views)
Permalink
openssh, pam, challenge-response problem

Hello,

when configuring the OpenSSH to authenticate through pam_radius, I
encountered the following problem:

The radius server is configured to accept username and generic
password, it then generates some textual string as a challenge-request
and waits again for username and this time for challenge-response.

Pam_radius use pam->conv function, retrieved with
pam_get_item(PAM_COM), with challenge-request and type
PAM_PROMPT_ECHO_ON, to present the challenge-request to user and to
retrieve the challenge-response.

OpenSSH sets the PAM_CONV function to sshpam_passwd_conv() (defined in
pam_auth.c). But this function doesn't have implemented the
PAM_PROMPT_ECHO_ON flavor, and returns the PAM_CONV_ERROR :-(

It should be possible to implement the PAM_PROMPT_ECHO_ON conversation
either with read()/write() or with fdopen()/fprintf()/fgets()/fclose()
(as is done similary for stdin in sshpam_tty_conv()), but we need the
socket. The only way to pass the information into the pam module is by
Authctxt structure. So we need to add the "int socket" field into the
Convctxt structure and then use it (if not set to -1) for
challenge-response authentication.

Sounds possible?

Best regards
Zdenek OGAR Skalak
--
Ing. Zdenek OGAR Skalák
Monet+ a.s. <http://www.monetplus.cz>
Za Dvorem 505, 763 14 Zlín - Štípa, CZ
Tel: +420 / 577 110 411, Fax: +420 / 577 914 557


--
Tato zprava byla prohledana na vyskyt viru
a nebezpecneho obsahu antivirovym systemem
MailScanner a zda se byt cista.

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


dtucker at zip

Sep 8, 2009, 5:24 AM

Post #2 of 2 (697 views)
Permalink
Re: openssh, pam, challenge-response problem [In reply to]

Skalak Zdenek wrote:
> Hello,
>
> when configuring the OpenSSH to authenticate through pam_radius, I
> encountered the following problem:
>
> The radius server is configured to accept username and generic
> password, it then generates some textual string as a challenge-request
> and waits again for username and this time for challenge-response.
>
> Pam_radius use pam->conv function, retrieved with
> pam_get_item(PAM_COM), with challenge-request and type
> PAM_PROMPT_ECHO_ON, to present the challenge-request to user and to
> retrieve the challenge-response.
>
> OpenSSH sets the PAM_CONV function to sshpam_passwd_conv() (defined
> in pam_auth.c). But this function doesn't have implemented the
> PAM_PROMPT_ECHO_ON flavor, and returns the PAM_CONV_ERROR :-(
>
> It should be possible to implement the PAM_PROMPT_ECHO_ON
> conversation either with read()/write() or with
> fdopen()/fprintf()/fgets()/fclose() (as is done similary for stdin in
> sshpam_tty_conv()), but we need the socket. The only way to pass the
> information into the pam module is by Authctxt structure. So we need to
> add the "int socket" field into the Convctxt structure and then use it
> (if not set to -1) for challenge-response authentication.
>
> Sounds possible?

No. At the authentication stage there's no connection to the user other
than the encrypted channel, so there's no place to write plaintext to.
If you did manage to write to the socket connected to the client it
would almost certainly kill the connection with a MAC failure.

That said, what you're describing *should* work with the SSH2
keyboard-interactive authentication type, which was designed to do
exactly this type of multiple-step challenge-response.

Does "ssh -2 -o PreferredAuthentications=keyboard-interactive
yourserver" work? If so, you can just disable PasswordAuthenticaton in
sshd_config and leave ChallengeResponseAuthentication enabled. If not,
what does the client give with "-vvv", and what does the server give
with debugging (-ddde) enabled?

The next problem you may have is that sshd doesn't allow changes of
username in the middle of an authentication. There's more information
(but no ideal solution) at
https://bugzilla.mindrot.org/show_bug.cgi?id=1215.

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

OpenSSH dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.