How to Setup 2 Factor Authentication on your SSH Server

preview_player
Показать описание
In this video i will show you quickly how to install 2 factor authentication on your Linux SSH server and as a bonus how to configure 2 factor if you already have ssh key enabled on the server as well.

Commands from the Video:
## Installing Authenticator software ##
sudo apt install libpam-google-authenticator -y
google-authenticator
Y / Y / Y / N / Y (default answers for the questions)

### Editing the files with no SSH key enabled ###
sudo nano /etc/pam.d/sshd
## Add the line to the doctument ##

sudo nano /etc/ssh/sshd_config
## edit the following ##
ChallengeResponseAutentication yes
UsePAM yes

### Editing the files with SSH key enabled ###
sudo nano /etc/pam.d/sshd
## Add the line to the doctument ##

sudo nano /etc/ssh/sshd_config
## edit the following ##
ChallengeResponseAutentication yes
UsePAM yes
## add the line to the document ##
AuthenticationMethods publickey,keyboard-interactive
Рекомендации по теме