Cannot perform a remote backup to a Debian target server due to disabled root SSH access
Unlocking SSH Under Root on Debian OS Target Server Via Terminal for Remote Backup
Problem
Cannot perform a remote backup to a Debian target server.
Debian has SSH access under root user disabled by default.
Solution
Enable SSH access under the root user.
- Access the terminal/console of the remote server.
- Run the following command to permit root login:
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd\_config
- Run the following command to restart the SSH service:
systemctl restart sshd.serviceNOTE: After performing your backup operation, it may be desirable to disable root access again for security reasons.
To re-secure the root account:
- Access the terminal/console of the remote server.
- Run the following command to permit root login:
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin no/g' /etc/ssh/sshd\_config
- Run the following command to restart the SSH service:
systemctl restart sshd.service
Updated on: 10/12/2025
Thank you!
