How to enable SSH root login on Alpine Linux
Note: Be aware that enabling root access via SSH has security implications!
On Alpine Linux, root SSH access using passwords is disabled by default. The following tutorial shows you how to enable password-based root login via SSH when using openssh. (I have not tested whether root access is enabled when installing Alpine Linux using dropbear instead of openssh)
First, open the SSH config file using
edit_sshd_config.sh
vi /etc/ssh/sshd_configNow look for this line:
sshd_config_snippet.txt
#PermitRootLogin prohibit-passwordPress I in order to activate vi editing mode.
Remove the # at the beginning of the line and change prohibit-password to yes:
sshd_config_permit_root.sh
PermitRootLogin yesNow save and exit by pressing Esc and then pressing :wq and Enter.
After that, restart openssh using
restart_sshd.sh
service sshd restartNow you can login as root using the password.
Check out similar posts by category:
Alpine Linux
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow