How to use 2FA with cert based SSH auth?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I used this guide to enable Google TOTP auth on Ubuntu 16.04.



SSH only allows cert based auth (PasswordAuthentication no)



I set ChallengeResponseAuthentication yes and restarted the SSH service.



I don't get prompted for a 2FA token.



So I added the following line to sshd_config:



AuthenticationMethods publickey,keyboard-interactive



Then restarted the SSHd



Now I get prompted for a password after entering the cert password, but the 2FA codes are not accepted. I used both the main numeric keyboard and the dedicated numeric keyboard to enter the numbers.



UsePAM yes hasn't been changed.



How to config 2FA with cert based SSH auth?







share|improve this question


























    up vote
    0
    down vote

    favorite












    I used this guide to enable Google TOTP auth on Ubuntu 16.04.



    SSH only allows cert based auth (PasswordAuthentication no)



    I set ChallengeResponseAuthentication yes and restarted the SSH service.



    I don't get prompted for a 2FA token.



    So I added the following line to sshd_config:



    AuthenticationMethods publickey,keyboard-interactive



    Then restarted the SSHd



    Now I get prompted for a password after entering the cert password, but the 2FA codes are not accepted. I used both the main numeric keyboard and the dedicated numeric keyboard to enter the numbers.



    UsePAM yes hasn't been changed.



    How to config 2FA with cert based SSH auth?







    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I used this guide to enable Google TOTP auth on Ubuntu 16.04.



      SSH only allows cert based auth (PasswordAuthentication no)



      I set ChallengeResponseAuthentication yes and restarted the SSH service.



      I don't get prompted for a 2FA token.



      So I added the following line to sshd_config:



      AuthenticationMethods publickey,keyboard-interactive



      Then restarted the SSHd



      Now I get prompted for a password after entering the cert password, but the 2FA codes are not accepted. I used both the main numeric keyboard and the dedicated numeric keyboard to enter the numbers.



      UsePAM yes hasn't been changed.



      How to config 2FA with cert based SSH auth?







      share|improve this question














      I used this guide to enable Google TOTP auth on Ubuntu 16.04.



      SSH only allows cert based auth (PasswordAuthentication no)



      I set ChallengeResponseAuthentication yes and restarted the SSH service.



      I don't get prompted for a 2FA token.



      So I added the following line to sshd_config:



      AuthenticationMethods publickey,keyboard-interactive



      Then restarted the SSHd



      Now I get prompted for a password after entering the cert password, but the 2FA codes are not accepted. I used both the main numeric keyboard and the dedicated numeric keyboard to enter the numbers.



      UsePAM yes hasn't been changed.



      How to config 2FA with cert based SSH auth?









      share|improve this question













      share|improve this question




      share|improve this question








      edited May 8 at 21:16

























      asked May 8 at 20:28









      Gaia

      1201113




      1201113

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1033748%2fhow-to-use-2fa-with-cert-based-ssh-auth%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1033748%2fhow-to-use-2fa-with-cert-based-ssh-auth%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Which professions warranted travel in Medieval times?

          How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

          Trouble downloading packages list due to a “Hash sum mismatch” error