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
First of all what is ngrok?
ngrok exposes local servers behind NATs and firewalls to the public internet over secure tunnels. This can be used by developers who want to run webhooks with https if you dont have a local ssl certificate. For example telegram, Facebook etc use webhook but they only allow ssl.
If you want to know more about the ngrok, <---- please click this link for more information.
The script
after setup the ngrok in the local machine you can run the ngrok command to start the tunnel. in my case i run the ngrok as a service which i have explained in my previous post.
After the service is running you can run the python script or your preferred to fetch the public_url from ngrok which can be use to automate the process. For example Telegram Bot with webhook enable only communicates with https urls so from this method you can get the randomly generated https url to use in such scenarios.
In case if you have a doubt about usage of ngrok and automation please give comment and don't forget to subscribe.
ngrok exposes local servers behind NATs and firewalls to the public internet over secure tunnels. This can be used by developers who want to run webhooks with https if you dont have a local ssl certificate. For example telegram, Facebook etc use webhook but they only allow ssl.
If you want to know more about the ngrok, <---- please click this link for more information.
The script
after setup the ngrok in the local machine you can run the ngrok command to start the tunnel. in my case i run the ngrok as a service which i have explained in my previous post.
After the service is running you can run the python script or your preferred to fetch the public_url from ngrok which can be use to automate the process. For example Telegram Bot with webhook enable only communicates with https urls so from this method you can get the randomly generated https url to use in such scenarios.
In case if you have a doubt about usage of ngrok and automation please give comment and don't forget to subscribe.
Comments