GithubHelp home page GithubHelp logo

2fa's Introduction

Use 2fa and Pub-key on a Linode

Use this guide after you have secured your server to only allow pub-key authentication. Password auth and root login should be disabled.

First install Google Authenticator.

sudo apt install libpam-google-authenticator

Generate a key in your users home directory with the following command.

google-authenticator

Answer yes to the questions and scan the QR code.

Make the following changes to /etc/ssh/sshd_config

Add this to the end of the file to allow 2fa input and public key authentication.

AuthenticationMethods publickey,keyboard-interactive

Chan values to yes for the following:

UsePAM yes

ChallengeResponseAuthentication yes

Restart SSH

sudo systemctl restart ssh

Edit /etc/pam.d/sshd

Comment out # the following line

@include common-auth

Add the following two lines to the bottom of the file

#One-time password authentication via Google Authenticator
auth required pam_google_authenticator.so

View Key

Use the following command from the users home directory to show the secret key so that you may add another device manaually.

head -n 1 .google_authenticator

More info: https://github.com/google/google-authenticator-libpam

2fa's People

Contributors

boogogee avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.