A universal shell script for enabling root SSH access across multiple Linux distributions. Works with Oracle OCI as well.
curl -fsSL -o root.sh "https://github.com/tonyliuzj/oneclick-root/releases/latest/download/root.sh" && chmod +x root.sh && sudo ./root.shwget -qO root.sh "https://github.com/tonyliuzj/oneclick-root/releases/latest/download/root.sh" && chmod +x root.sh && sudo ./root.shThis script automates the setup of root SSH access on fresh Linux systems. It detects the package manager, installs required packages, and configures SSH for root login with password authentication.
- Debian/Ubuntu (apt-get)
- Fedora/RHEL/CentOS (dnf/yum)
- openSUSE (zypper)
- Arch/Manjaro (pacman)
- Alpine (apk)
Run the script with root privileges:
sudo ./root.shThe script will:
- Detect your package manager
- Update package lists
- Install sudo and openssh-server
- Prompt for a new root password
- Configure SSH to allow root login with password authentication
- Restart the SSH service
- Root/sudo access
- Bash shell
- Internet connection for package installation
This script enables root login via SSH with password authentication, which may pose security risks. Use this only in controlled environments such as:
- Development/testing environments
- Lab setups
- Trusted networks
For production systems, consider using SSH key-based authentication instead.
- Installs
sudoif not present - Installs the appropriate SSH server package for your distribution
- Sets
PermitRootLogin yesin/etc/ssh/sshd_config - Sets
PasswordAuthentication yesin/etc/ssh/sshd_config - Clears any conflicting overrides in
/etc/ssh/sshd_config.d/ - Restarts the SSH service using the appropriate init system
MIT