Two-Factor Authentication for SSH Login on Linux Logo

Two-Factor Authentication for SSH Login on Linux

0
Free
Updated 11 March 2025
Visit Website

This tutorial describes how to set up two-factor authentication for an SSH server by integrating Google Authenticator with OpenSSH. Install Google Authenticator on Linux The first step is to install Google Authenticator on your Linux host. You can do this by running the following command: sudo apt-get install google-authenticator Configure Google Authenticator Once installed, you can configure Google Authenticator by running the following command: google-authenticator You will be prompted to enter a secret key. Make a note of this key, as you will need it later. Configure OpenSSH To configure OpenSSH to use Google Authenticator, you need to create a new file in the /etc/pam.d directory. You can do this by running the following command: sudo nano /etc/pam.d/sshd Add the following lines to the end of the file: auth required pam_google_authenticator.so Save and close the file. Then, restart the SSH server by running the following command: sudo service ssh restart Use Google Authenticator To use Google Authenticator, you will need to generate a one-time passcode on your Android device. You can do this by opening the Google Authenticator app and scanning the QR code that was generated during the configuration process. Enter the one-time passcode on your Linux host, and you will be logged in to your SSH server. Summary: This tutorial describes how to set up two-factor authentication for an SSH server by integrating Google Authenticator with OpenSSH.

FEATURES

EXPLORE BY TAGS

SIMILAR TOOLS

Fast and simple way to check any HTTP Headers

A tool for SSH server auditing with comprehensive analysis capabilities.

A simple security capture the flag framework for running contests

CLI program for cybersecurity solution management with multiple functionalities and authentication methods.

CTF write-ups from SababaSec team

Certificate Transparency Monitor that alerts you when an SSL/TLS certificate is issued for your domains.

SecGen creates vulnerable virtual machines and hacking challenges for learning security penetration testing techniques.

A comprehensive server cryptographic protocol analyzer with API and CLI interface.

A library for validating and accessing environment variables in Node.js programs

PINNED

Proton Pass Logo

Proton Pass is a cross-platform password manager that provides encrypted storage, password generation, and security monitoring features with integrated 2FA and dark web monitoring capabilities.

Data Protection
NordVPN Logo

NordVPN is a commercial VPN service that encrypts internet connections and hides IP addresses through a global network of servers, featuring integrated threat protection and multi-device support.

Network Security
Mandos Logo

Fractional CISO service that helps B2B companies implement security leadership to win enterprise deals, achieve compliance, and develop strategic security programs.

Consulting
Checkmarx SCA Logo

Checkmarx SCA

A software composition analysis tool that identifies vulnerabilities, malicious code, and license risks in open source dependencies throughout the software development lifecycle.

Application Security
Orca Security Logo

Orca Security

A cloud-native application protection platform that provides agentless security monitoring, vulnerability management, and compliance capabilities across multi-cloud environments.

Cloud Security
DryRun Logo

DryRun

A GitHub application that performs automated security code reviews by analyzing contextual security aspects of code changes during pull requests.

Application Security
CyberSecTools logoCyberSecTools

Explore the largest curated directory of cybersecurity tools and resources to enhance your security practices. Find the right solution for your domain.

Operated by:

Mandos Cyber • KVK: 97994448

Netherlands • contact@mandos.io

VAT: NL005301434B12

Copyright © 2025 - All rights reserved