Blog | G5 Cyber Security

Embedded Linux Password Security

TL;DR

Embedded Linux devices often ship with default passwords or weak security configurations. This guide provides practical steps to manage passwords effectively, including changing defaults, using strong hashing algorithms, implementing password policies, and securing storage.

1. Change Default Passwords Immediately

The first and most crucial step is to change all default passwords. Manufacturers often use common credentials for initial access. These are well-known targets for attackers.

sudo passwd root

2. Implement Strong Password Policies

Enforce rules for password complexity and expiration.

You can configure these policies using PAM (Pluggable Authentication Modules). Edit files in /etc/pam.d/, such as common-password.

sudo nano /etc/pam.d/common-password

3. Use Strong Password Hashing

Never store passwords in plain text! Use a robust hashing algorithm with salting.

Verify your system uses a secure hashing algorithm by examining the shadow file (/etc/shadow). The hash should be long and complex.

4. Secure Password Storage

Protect the files containing password hashes from unauthorized access.

sudo chmod 600 /etc/shadow

5. Limit Login Attempts

Reduce the risk of brute-force attacks by limiting the number of failed login attempts.

sudo apt install fail2ban  # Example for Debian/Ubuntu

6. Consider SSH Key Authentication

Disable password-based SSH authentication and use SSH keys instead.

7. Regularly Audit Logs

Monitor logs for suspicious activity, such as failed login attempts or unauthorized access.

Exit mobile version