<div dir="ltr"><div>SSH (and by association conch) sends feedback to users but unless you ssh -v you won't see much of it. Sending text feedback without using the standard auth methods might require you to move your two factor auth into your protocol but this doesn't feel like a good idea to me. I'm relatively new to conch and my use case is quite different to yours so if I'm wrong and there is a way to do this I hope someone else jumps in to correct me.<br>
<br>I did a quick test with <a href="http://twistedmatrix.com/documents/current/api/twisted.conch.checkers.SSHProtocolChecker.html">http://twistedmatrix.com/documents/current/api/twisted.conch.checkers.SSHProtocolChecker.html</a> as my portals checker and that lets me require both password (something you know) and key (something you have).<br>
My test doesn't handle "ticking" already used auth methods off the list of authentications that can continue but I don't think it would be too hard to get that working.<br>I see the following in my ssh client connection when connecting to my server. As I said I don't tick off used methods which is why you see "Authentications that can continue: password,publickey" instead of just password.<br>
<br>$ ssh -v -p 5022 user@localhost <br>OpenSSH_6.2p2 Ubuntu-6ubuntu0.1, OpenSSL 1.0.1e 11 Feb 2013<br>debug1: Reading configuration data /home/tom/.ssh/config<br>....<br>debug1: Remote protocol version 2.0, remote software version Twisted<br>
....<br>debug1: Authentications that can continue: password,publickey<br>debug1: Next authentication method: publickey<br>debug1: Offering RSA public key: /home/tom/.ssh/id_rsa<br>debug1: Server accepts key: pkalg ssh-rsa blen 279<br>
Authenticated with partial success.<br>debug1: Authentications that can continue: password,publickey<br>....<br>debug1: Next authentication method: password<br>user@localhost's password: <br>debug1: Authentication succeeded (password).<br>
Authenticated to localhost ([127.0.0.1]:5022).<br>debug1: channel 0: new [client-session]<br>debug1: Entering interactive session.<br>debug1: Sending environment.<br>debug1: Sending env LANG = en_GB.UTF-8<br><br></div><div>
Hope that helps.<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 5, 2014 at 12:03 AM, David Timothy Strauss <span dir="ltr"><<a href="mailto:david@davidstrauss.net" target="_blank">david@davidstrauss.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is there a straightforward way to send text feedback to users when<br>
their authentication fails? At Pantheon, we use a custom<br>
implementation of IRealm. I'm hoping there's a way to send or return<br>
the output from there.<br>
<br>
We particularly need this because users will have various two-factor<br>
authentication modes configured, and a simple pass/fail for<br>
authentication will leave many scratching their heads.<br>
<br>
I don't see any examples of such output on the relevant documentation page [1].<br>
<br>
[1] <a href="https://twistedmatrix.com/documents/current/core/howto/cred.html" target="_blank">https://twistedmatrix.com/documents/current/core/howto/cred.html</a><br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</blockquote></div><br></div>