Skip to content

A simple bash script to enable SSH root login with a password on Ubuntu servers. This script modifies SSH configuration and sets a root password, allowing secure root access via SSH.

Notifications You must be signed in to change notification settings

DrSaeedHub/RootSet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 

Repository files navigation

RootLogin - Enable Root SSH Login with Password

A simple bash script to enable SSH root login with a password on Ubuntu servers. This script modifies SSH configuration and sets a root password, allowing secure root access via SSH.


βœ… Features:

  • Enables SSH root login with a password.
  • Prompts user to set a custom root password.
  • Automatically updates SSH configuration.
  • Compatible with cloud-init SSH configuration (60-cloudimg-settings.conf).

πŸš€ Usage

  1. Connect to your server:

Ensure you are connected to your server as a user with sudo privileges.

  1. Run the Script:

Execute the script directly from the repository:

bash <(curl -Ls https://raw.githubusercontent.com/DrSaeedHub/RootSet/main/enable-root-login.sh)
  1. Follow the Prompts:
  • Enter the new root password when prompted.
  • Confirm the root password.
  • The script will automatically restart the SSH service and apply the changes.

πŸ” Security Considerations

  • This script modifies the SSH configuration to allow root login with a password.
  • It is recommended to disable root login after performing necessary operations for better security:
nano /etc/ssh/sshd_config

Set the following values:

PermitRootLogin no
PasswordAuthentication no

Restart the SSH service:

sudo systemctl restart sshd

πŸ“¦ Files:

  • enable-root-login.sh - Main script to enable root login.

❓ Troubleshooting

  • If you encounter Permission denied (publickey) after running the script, ensure that SSH service is properly restarted:

    sudo systemctl restart sshd
  • Verify the SSH configuration:

    sudo sshd -t

🀝 Contributing

Feel free to fork the repository, make improvements, and submit a pull request. Contributions are welcome!


πŸ› οΈ Author

Created by DrSaeedHub.

About

A simple bash script to enable SSH root login with a password on Ubuntu servers. This script modifies SSH configuration and sets a root password, allowing secure root access via SSH.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages