DEV Community

Cover image for ๐Ÿ›ก๏ธ Linux Admin Project: Secure Bank Customer Portal with Automated Auditing
Rajpreet Gill
Rajpreet Gill

Posted on

๐Ÿ›ก๏ธ Linux Admin Project: Secure Bank Customer Portal with Automated Auditing

A Real-World Banking System Using useradd, chmod, ACLs, systemd, and More!

๐Ÿš€ What if you could manage 10,000 bank customers using only Linux commands?
In this hands-on project, youโ€™ll simulate a secure banking portal that handles users, enforces privacy, encrypts backups, and even triggers alerts on suspicious activity.

๐Ÿฆ Scenario: Youโ€™re the Sysadmin for a Bank

Your Mission:

  • Give employees admin access (but safely).
  • Ensure customers can only access their data.
  • Maintain daily encrypted transaction logs.
  • Detect fraudulent logins in real time.

Letโ€™s turn a regular Linux machine into a secure bank portal. ๐Ÿ’ป๐Ÿ’ธ

## ๐Ÿ“‘ Table of Contents

๐Ÿ”ง Step 1: Create Users & Groups

๐Ÿ›  Tools: useradd, usermod, groups

# Employees and Customers

Image description

Similarly, Create Groups, Assign Users to groups

sudo groupadd employees
sudo groupadd customers

sudo usermod -aG employees manager teller
sudo usermod -aG customers john jane

โœ… Why?

  • Groups control permissions.
  • Customers canโ€™t peek into each otherโ€™s data.
  • Employees can manage transactions but not compromise privacy.

๐Ÿ’ฐ Step 2: Secure the Banking Directories

๐Ÿ›  Tools: mkdir, chmod, chown, setfacl

# Create folders
Image description

# Permissions
Image description

Image description

# Let employees read but not write customer data
Image description

๐Ÿ”’ Why?

  • chmod 700: Only the customer can access their folder.
  • setfacl: Employees can view but not edit customer files.
  • /bank/transactions: Editable only by employees.

๐Ÿ” Step 3: Monitor Suspicious Activity

๐Ÿ›  Tools: grep, journalctl, find

# Failed logins (fraud detection)

sudo grep "Failed password" /var/log/auth.log

Image description

Similarly, You can Check Suspicious activity by these commands:

# Audit sudo usage

sudo journalctl -q | grep "sudo.*COMMAND"

# Detect changes in the last hour

sudo find /bank -type f -mmin -60 -ls

๐Ÿšจ Why?

  • Spot brute-force attacks and insider misuse.
  • Know whoโ€™s using sudo, when, and for what.
  • Track recent changes to sensitive files.

โฐ Step 4: Automate Encrypted Daily Backups

๐Ÿ›  Tools: systemd, tar, gpg, cron

# 1. Backup script

Image description

# 2. Make executable

Image description

# 3. Systemd timer

Image description

# 4. Start the timer

Image description

๐Ÿ—๏ธ Why?

  • Protects data even if the system is breached.
  • Systemd ensures it runs reliablyโ€”even after reboot.

๐Ÿง Step 5: Simulate a Customer Login

Image description

๐Ÿ’ป Demo: Bank Customer Login Simulation

Terminal GIF showing login flow

๐Ÿ“˜ Conclusion

With just a few Linux commands, you've built a:
โœ… Secure multi-user bank portal
โœ… Automated encrypted backups
โœ… Real-time monitoring system

๐Ÿ’ก Want to take it further? Add:

  • Email alerts for suspicious logins
  • Web frontend using Apache/Nginx
  • PostgreSQL for storing balances

#30DaysLinuxChallenge #CloudWhisler
DevOps #Linux #RHCSA #Opensource #AWS #CloudComputing

Catch out by My LinkedIn profile
https://www.linkedin.com/in/rajpreet-gill-4569b4161/

Top comments (1)

Collapse
 
nevodavid profile image
Nevo David

been messing with user permissions before but tbh never thought about banking setups like this, feels like i'm missing a trick