Installation
This section covers installing the 1Kosmos Linux PAM package, configuring the required license and PAM files, setting up sshd, and verifying the setup with a test SSH login.
Installing the PAM Package
RHEL
# Install prerequisites
sudo yum install -y tar libuuid vim-common libcurl
# Install 1Kosmos PAM
sudo ./blockId.<version>.<timestamp>.shUbuntu
# Install prerequisites
sudo apt install uuid-runtime libcurl4
# Install 1Kosmos PAM
sudo ./blockId.<version>.<timestamp>.shConfiguring the License File
After installation, update the license_config file at /opt/BlockId/data/license_config with your tenant details. Only a root user can modify this file. Use a text editor such as vi to set the following parameters:
TENANT_DNS=yourtenant.1kosmos.net
COMMUNITY=yourcommunity
Configuring PAM Files
RHEL — password-auth
Update /etc/pam.d/password-auth to ensure 1Kosmos 2FA is not bypassed:
Do not have any
authrule with a control flag set tosufficientor[...success=done...]— these will bypass all subsequent PAM rules including 1KosmosReplace any such rules with
[success=X default=ignore], where X is the number ofauthrules below the current one in the fileEnsure the last
authrule (pam_deny.so) has its control flag set torequisite
Example: If auth sufficient pam_sss.so forward_pass has three auth rules below it, update it to:
If the last rule appears as auth required pam_deny.so, update it to:
password-auth — before modification:

password-auth — after modification:

RHEL — sshd
Update /etc/pam.d/sshd:
Add the
pam_blockId.sorule immediately after the primary authentication (typicallypassword-auth) with control flag set torequisiteEnsure no preceding PAM rules use
sufficientorsuccess=doneIf a
substackentry exists beforepam_blockId.so, change it toincludeand ensure it does not contain anysufficientorsuccess=donerules
sshd — before modification:

sshd — after modification:

Ubuntu — sshd
Update /etc/pam.d/sshd:
Add the
pam_blockId.sorule after the primary authentication (common-auth) with control flag set torequisite
sshd — before modification:

sshd — after modification:

Configuring sshd_config
Add the following flags to /etc/ssh/sshd_config:
ChallengeResponseAuthentication
yes
Enables keyboard-interactive authentication
KbdInteractiveAuthentication
yes
Deprecated alias for ChallengeResponseAuthentication
UsePAM
yes
Enables the PAM interface
MaxAuthTries
1
Maximum authentication attempts per connection
PubkeyAuthentication
no
Disables public key auth to prevent bypassing 1Kosmos MFA
If /etc/ssh/sshd_config.d/50-redhat.conf exists, comment out the ChallengeResponseAuthentication no line.
Note: Restart sshd after any changes: service sshd restart
Configuring SELinux (RHEL Only)
If SELinux is enabled on the host, additional permissions are required for the 1Kosmos PAM to function.
Verify SELinux status:
sestatusSet SELinux to permissive mode:
setenforce 0Install policycoreutils:
Open a new terminal and SSH into the host — this generates the audit logs needed in the next step
Create a semodule from the audit logs:
This creates two files: BlockIDPAM.te and BlockIDPAM.pp
Install the semodule:
Re-enable enforcing mode:
setenforce 1
Testing the Setup
SSH into the configured Linux host:
After entering the correct password, the 1Kosmos 2FA login menu appears. The options displayed depend on the authentication methods configured for the Linux CP application in AdminX.
Last updated
Was this helpful?

