Linux 2-Factor Authentication Set up is the only way to add an extra layer of security to your Linux server. Anyone who is using Linux needs to add or enable two-factor authentication for his or her security. In case you are Linux administrator or you are looking for a way to make sure your account is highly protected, set up two-factor authentication from this guide.
From this page, a lot of things will be talked about, how to enable two-factor authentication, how it works, its benefits, and how to log in with two-factor authentication on Linux. The only good thing you will do to yourself is to get a cup of coffee to relax your brain as you read down the page. This page has really helped a lot of Linux administrators in securing their server from the second person or hacker.
Two-factor authentication can also be called two steps verification. It comes each time you log in or access your account. If you set it up, a passcode will be sent to you on your mobile device. With that code with you, you can access or login to the account. It’s highly admissible to keep that code secret and private to yourself. The code will be sent either as a TEXT or PHONE CALL. You will be the one to decide how it will come.
Please know one vital caveat to this: Immediately you’ve set this up or enabled it, you can not log into the account without a six-digit code from which comes from the authenticator. This will put another step for you anytime you want to access the account, so try to know if you have to pull out any of your smartphones any time you want to log in to Linux machine or even use sudo, then this might be hard for you. Also, this added or entered guide enacts with it an extra layer of security you might not like. Though it gives you the highest security.
The Benefits of Two Factor Authentication on LINUX
- Simplifying user experience
- Fraud defense
- Identity authentication
- Cost-effective security
- Easy integration
Necessarily Things to Install to Set up Two Factor Authentication on LINUX
- Go to Google Play Store on your available device
- You can now look for google authenticator
- You need to download and install Google Authenticator.
- Click on the entry by Google Inc.
- Click on Install
- Click on Accept
- Just calm down and let the installation complete from the guide.
Am sure from this step and guide, you are on the gate to enable and set up two-factor authentication on LINUX
How to Set up or Enable Two Factor Authentication on LINUX
- You can now open or connect to a terminal window
- Issue instruction sudo apt-get install libpam-google-authenticator
- Enter sudo password
- Click on the Enter button on the page
- In case you are been asked, enter y
- Tap on the Enter
- Just follow up the instruction to complete the installation
Time to Configure
Let’s start by saying at your terminal window, give the command sudo nano /etc/pam.d/common-auth. Enter the following line to the down of the file:
auth required pam_google_authenticator.so nullok
You can now save and close it.
It’s necessary and must to setup Google-authenticator for any user who wants to log into the machine. Let’s show with a single user. Go or connect to the terminal window and, as the user in we are using as an example, issue or give the instruction google-authenticator. You will be asked to get a series of queries. The first queries will be: Do you want authentication tokens to be time-based (y/n) y.
For more tip or information this, go to https://www.linux.com/topic/desktop/how-set-2-factor-authentication-login-and-sudo/
Any comments or questions, use an empty box down the page for a quick reply from us. Thanks!