determining whether passwd auth succeeds

Damien Miller djm at mindrot.org
Sat Aug 11 16:58:14 EST 2001


On Sat, 11 Aug 2001, Lucas Fisher wrote:

> Hi,
> I'm writing a c++ wrapper around ssh for KDE, mainly for use in a sftp 
> client.  My problem is when starting ssh with the sftp subsystem openssh 
> gives no indication that password authentication succeeded.  This makes it 
> difficult for my wrapper to determine if the connection succeeded.  Now 
> determining it didn't succeed can be done by checking for another password 
> prompt.  The problem with this is password verification could take time 
> (correct?).  So if I send the password then immediately do a read from the 
> terminal, there is no guarantee I'll get the second password prompt
> if the password was incorrect, right?  I could wait a couple
> of seconds and if I don't get another password prompt assume
> authentication succeeded, but this is a bad solution. Are there any
> other techniques I could employ?

You could select() with a timeout. Better still you could write a native
GUI sftp client using the routines in sftp-client.[ch].

-d

-- 
| Damien Miller <djm at mindrot.org> \ ``E-mail attachments are the poor man's 
| http://www.mindrot.org          /   distributed filesystem'' - Dan Geer




More information about the openssh-unix-dev mailing list