Ubuntu / Debian RADIUS Authentication
This integration will help you connect users with your MonoSign IdP over the RADIUS protocol. However, before you continue, you must ensure you have a valid license and configuration on your Management Portal.
đĄ Outcomes
This will help you add your IdP (your Identity Provider) to your Linux Servers and Desktops and secure them with Multi-Factor Authentication.
This is highly recommended for securing your access to your servers and desktops.
đ Instructions
This documentation will contain 3 main steps and 1 optional step for integration.
Creating an Application on MonoSign for your Ubuntu Servers or Desktops.
Installing requirements to your Ubuntu Server or Desktop.
Configuration of your RADIUS PAM (Pluggable Authentication Module) installation on your Server or Desktop
Securing SSH login
Securing Desktop / GUI login
RADIUS implementation contains a secret: you need to treat it like a Password. This information should never be shared with anyone and should be protected carefully.
1. Creating an Application on MonoSign
Go to your Management Portal and click Applications on the left sidebar. Create a new application.
![](../__attachments/9502721/CleanShot%202022-06-23%20at%2012.41.33@2x-20220623-164139.png?inst-v=866e9140-3da7-430a-a281-7dc8294ac19e)
Click âKeysâ and then âAdd New Keyâ. Next, choose Key Type as RADIUS.
You need to configure NAS-Identifier and Secret. You will need this information while configuring your Ubuntu Desktop or Server.
Your Secret must be unique, and treat it like a password.
If you donât know your NAS-Identifier (your RADIUS identifier that helps MonoSign understand which system they are authenticated to) you can keep it empty if you have just one RADIUS implementation.
![](../__attachments/9502721/CleanShot%202022-06-23%20at%2012.45.53@2x-20220623-164559.png?inst-v=866e9140-3da7-430a-a281-7dc8294ac19e)
You can save your configuration.
2. Installing requirements to your Ubuntu Server or Desktop
Now you need to install the PAM module on your Desktop or Server. Just open your Terminal and type the following command to install the package.
sudo apt update
sudo apt install libpam-radius-auth
The version number should be â2.xâ or above. You can check the installed version with the following command.
apt show libpam-radius-auth
After you execute it, you will see the following results or similar.
![](../__attachments/9502721/CleanShot%202022-06-23%20at%2012.53.06@2x-20220623-165318.png?inst-v=866e9140-3da7-430a-a281-7dc8294ac19e)
This installation will help us to handle authentication requests through the RADIUS protocol.
Now, you need to configure your â/etc/pam_radius_auth.confâ file. This file contains your RADIUS server information. Before editing this file, we recommend you back up this file. You can use the following command to back up your file to your home folder.
sudo cp /etc/pam_radius_auth.conf ~/pam_radius_auth.conf.backup
Now, we can edit the file.
sudo nano /etc/pam_radius_auth.conf
First, you should comment on all current settings.
![](../__attachments/9502721/CleanShot%202022-06-23%20at%2013.05.24@2x-20220623-170536.png?inst-v=866e9140-3da7-430a-a281-7dc8294ac19e)
And add the following information to the end of the file.
You can even remove all lines and keep your file simple.
#monosign-hostname-or-ip #secret #timeout
your-radius-ip-or-hostname your-secret 120
We have configured the RADIUS on the Server. Letâs continue with the authentication methods.
3. Configuration of your RADIUS PAM (Pluggable Authentication Module) installation on your Server or Desktop
There are three ways to secure your authentication. There are SSH, Console (sudo) and Desktop login. We are going to use SSH and Desktop login for this demo. But the addition to that, we will also show you how you can secure your sudo and console login too.
a. Securing SSH login
We will not cover all the aspects of PAM, but it is recommended to learn it a little bit more to handle situations more effectively.
Another file we must edit is â/etc/ssh/sshd_configâ. SSH configurations use this file. But a little bit more. We can do all the configuration for SSH connections. But we will just need to edit a couple of lines to tell, respect our configuration.
sudo nano /etc/ssh/sshd_config
Edit the following lines and remove the â#â letter if they have.
UsePAM yes
# This option will be there if you have 21.x or above
KbdInteractiveAuthentication yes
# This option will be there if you have 20.x or before
ChallengeResponseAuthentication yes
Save the file (You can use Ctrl+X and Y for shortcuts). We have finished our configuration with sshd_config. Letâs continue with another one.
In Linux systems, SSH logins use a file named â/etc/pam.d/sshdâ. SSH logins use this file while users try to authenticate to the server or desktop. Letâs edit the file.
sudo nano /etc/pam.d/sshd
Add the following line to the start of the file.
auth sufficient pam_radius_auth.so
and comment out the following line @include common-auth
to # @include common-auth
.
# @include common-auth
It is done. You can test your SSH login.
![](../__attachments/9502721/CleanShot%202022-06-23%20at%2013.36.36-20220623-173718.gif?inst-v=866e9140-3da7-430a-a281-7dc8294ac19e)
Login to your Server / Desktop
You have secured your SSH logins đ
b. Securing Desktop / GUI login and sudo Login
We have covered most of the configuration with the first step. Additionally, we will modify another file named âcommon-authâ.
sudo nano /etc/pam.d/common-auth
Add the following line to the end of the file.
auth sufficient pam_radius_auth.so
Thatâs it. You have now secured the your console and GUI login too.