Skip to content

PiSecure-SSH is a powerful and user-friendly bash script tailored to safeguard your Raspberry Pi's SSH access. This script not only helps you create and manage user accounts with sudo privileges but also fine-tunes your SSH configuration for optimal security. Say goodbye to security loopholes and protect your Raspberry Pi with PiSecure-SSH.

Notifications You must be signed in to change notification settings

PKHarsimran/PiSecure-SSH

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

🔒 Secure SSH Setup Script

📖 Overview

The secure-ssh-setup.sh script is designed to automate the process of securing an SSH server by performing the following tasks:

  • Adding a new user with a specified username and password.
  • Adding the new user to the appropriate sudo group based on the operating system.
  • Updating the SSH configuration file with security enhancements.
  • Restarting the SSH service to apply the changes.

✨ Features

  • Adds a new user and sets their password.
  • Adds the user to the sudo group (Debian/Ubuntu) or wheel group (CentOS/RHEL/Fedora).
  • Updates SSH configuration settings:
    • ClientAliveInterval
    • ClientAliveCountMax
    • PermitEmptyPasswords
    • Protocol
    • Port
  • Restarts the SSH service to apply the new settings.
  • Provides detailed logging for each step.

⚙️ Prerequisites

  • A Linux-based system (Debian, Ubuntu, CentOS, RHEL, Fedora).
  • Root or sudo access to run the script.

🚀 Usage

  1. Download the Script:

    Clone the repository or download the secure-ssh-setup.sh script to your local machine.

    git clone https://github.com/PKHarsimran/PiSecure-SSH.git
    cd PiSecure-SSH/scripts
  2. Modify the Script:

    Open the script and update the USERNAME and PASSWORD variables with your desired values.

    USERNAME="newuser"
    PASSWORD="password"
  3. Run the Script:

    Execute the script with root or sudo privileges.

    sudo bash secure-ssh-setup.sh

📜 Logging

The script provides detailed logging at each step to ensure that users are informed of the progress and any potential issues.

About

PiSecure-SSH is a powerful and user-friendly bash script tailored to safeguard your Raspberry Pi's SSH access. This script not only helps you create and manage user accounts with sudo privileges but also fine-tunes your SSH configuration for optimal security. Say goodbye to security loopholes and protect your Raspberry Pi with PiSecure-SSH.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages