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
Its been a while that haven't publish anything. I have been using Raspberry Pi for long time since it was released and the old pi hangs around doing nothing. So i thought of hooking up an GPS to raspberry pi so that viewers out there who has interest in electronics and programming will know how it can be done.
Note: Raspberry Pi inputs or outputs supports 3.3v so the RX and TX pins also support 3.3v. So be careful about handling the voltages with the pi and devices interfacing.
I have a ublox GPS but it supports 5v so i need to do level conversion. If you want to know about level conversion please checkout my YouTube channel or the old blog posts.
Note: Raspberry Pi inputs or outputs supports 3.3v so the RX and TX pins also support 3.3v. So be careful about handling the voltages with the pi and devices interfacing.
I have a ublox GPS but it supports 5v so i need to do level conversion. If you want to know about level conversion please checkout my YouTube channel or the old blog posts.
First have to disable pi console in order to use the UART. If not it will get terminated. For more information Google for disabling console.
import serial
gpsport = serial.Serial("/dev/ttyAMA0", baudrate=9600, timeout=0.2)
while True:
rxgps = gpsport.readline()
if len(rxgps) > 10:
print(rxgps)
The above python script can be used for test whether pi receives serial data from GPS attached. Or you can write your own python script.
Bammm the Raspberry Pi receives the serial data from the GPS and here is a screen capture.
You can see stream of NMEA data flow from the GPS. The most important field to capture is GPGGA string. It will include position data and more.
Enjoy the hack and play/tweak for more data from other strings.
Comments