View all Worklets
Linux

Linux - System Preferences - Disable Password Authentication for SSH

Disables SSH Password Authentication on Linux Systems.

Worklet Details

Introduction to the Bash-based Disable Password Authentication for SSH Worklet

ThisDisable Password Authentication for SSH Worklet is a  Bash-based tool designed for Linux systems. Its primary function is to disable password-based SSH authentication, enhancing the security of the system by limiting access to SSH services.

Why would you use the Disable Password Authentication for SSH Worklet?

The key reason to utilize this Worklet is to improve the security of your Linux based endpoints. By disabling SSH password authentication, the Worklet reduces the risk of unauthorized access. 

Since password-based SSH authentications can be vulnerable to brute-force attacks, disabling this mode of authentication is an important step in reducing attack vectors. Opting for SSH keys instead can significantly enhance the security profile of your system.

Components of the Disable Password Authentication for SSH Worklet

The evaluation script checks the current state of password authentication for SSH on the Linux system. If password authentication is active, the remediation script is triggered. This script edits the SSH configuration file ('/etc/ssh/sshd_config'), disabling password authentication and then restarts the SSH service to implement the changes.

How does the Disable Password Authentication for SSH Worklet work?

The Worklet operates in two stages. Initially, it checks the existence of the SSH configuration file and the state of password authentication. If password authentication is enabled, the Worklet proceeds to the remediation phase. 

The remediation script uses the 'sed' command to edit the SSH configuration file, disabling the password authentication. After the configuration file is updated, the Worklet checks for the correct syntax using 'sshd -t'. 

If the syntax is correct, the SSH service is restarted to reflect the changes.

What is the expected outcome when you use the Disable Password Authentication for SSH Worklet?

Upon successful execution of this Worklet, the password authentication for SSH service on your Linux system will be disabled. The SSH service will be safely restarted to implement this change. 

The disabling of password-based authentication in favor of key-based authentication strengthens the security of your SSH server by limiting the access to SSH login. 

If password authentication is already disabled or the configuration file is missing, no changes will take place. In case of any errors, the Worklet will provide appropriate error messages for troubleshooting.

View in app

Consider Worklets your easy button

What's a Worklet?

A Worklet is an automation script, written in Bash or PowerShell, designed for seamless execution on endpoints – at scale – within the Automox platform. Worklet automation scripts perform configuration, remediation, and the installation or removal of applications and settings across Windows, macOS, and Linux.

do more with worklets