October 19, 2024
  1. Open the terminal and log in as root or use the sudo command.
  2. Edit the SSH server configuration file located at /etc/ssh/sshd_config using a text editor such as nano or vi.
  3. Find the line that reads “#PermitRootLogin” and change it to “PermitRootLogin yes” to allow root access via SSH.
  1. Find the line that reads “#PubkeyAuthentication” and change it to “PubkeyAuthentication yes” to allow public key authentication for SSH connections.
  2. Save and exit the configuration file.
  3. Set the SSH server to start automatically on boot by running the command “systemctl restart ssh”.
sudo systemctl restart ssh
sudo systemctl reload ssh