This is a simple setup guide to enabling Two Factor Authentication (2FA) on Linux SSH login. I this article I wont go deep into setup and issues that I have faced when implementing this. First thing is first Update your system first. I have used Ubuntu 20.04 and it is always up to date. To enable 2FA you need to install google authenticator modules sudo apt install libpam-google-authenticator Configuration for PAM and SSHD Add the the following line to /etc/pam.d/sshd and After adding this line please restart the sshd services. auth required pam_google_authenticator.so Go to /etc/ssh/sshd_config and check if the following line exist. Default value will be "no" so change it to "yes" to activate. ChallengeResponseAuthentication yes Configuration for Authenticator In the terminal run google authenticator command It will ask few things to acknowledge by user. Details you can see from the below video. Once this part is done you are ready to use the 2FA in ubuntu. T...
Now the code has been cut down to less that 30 lines. here is a part of the code...
do{
if(input(pin_a0))
{
test = 0b11011011;
}
else if(input(pin_a1))
{
test = 0b10011001;
}
for(i=0;i<8;i++)
{
value = bit_test(test,i);
output_low(S_CLK);
output_low(L_CLK);
if(value==1)
{
output_bit(Data,1);
output_bit(S_CLK,value);
output_bit(Data,0);
}
else if(value==0)
{
output_bit(S_CLK,1);
output_bit(S_CLK,0);
}
do{
if(input(pin_a0))
{
test = 0b11011011;
}
else if(input(pin_a1))
{
test = 0b10011001;
}
for(i=0;i<8;i++)
{
value = bit_test(test,i);
output_low(S_CLK);
output_low(L_CLK);
if(value==1)
{
output_bit(Data,1);
output_bit(S_CLK,value);
output_bit(Data,0);
}
else if(value==0)
{
output_bit(S_CLK,1);
output_bit(S_CLK,0);
}
Comments