Updated on 2026-01-31 GMT+08:00

Configuring Remote Login

  1. Run the following command to update the apt service:

    sudo apt update # Update the service.

  2. Install the SSH service and modify configurations.

    sudo apt update install openssh-server # Install the SSH service.
    sed -i '/^PermitRootLogin/d' /etc/ssh/sshd_config
    sed -i '/^PasswordAuthentication/d' /etc/ssh/sshd_config
    sed -i '/^UseDNS/d' /etc/ssh/sshd_config
    sed -i '/^ChallengeResponseAuthentication/d' /etc/ssh/sshd_config
    sh -c 'echo "PermitRootLogin yes" >>/etc/ssh/sshd_config'
    sh -c 'echo "PasswordAuthentication yes" >>/etc/ssh/sshd_config'
    sh -c 'echo "UseDNS no" >>/etc/ssh/sshd_config'
    sh -c 'echo "ChallengeResponseAuthentication no" >>/etc/ssh/sshd_config'
    

  3. Restart the service for the modification to take effect.

    systemctl restart sshd  # Restart the service for the modification to take effect.