<mohammadrony>

SSH Server Config

Copy original config

sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.orig

Change configuration

sudo vi /etc/ssh/sshd_config
  • Allow public key authentication

    PubkeyAuthentication yes
    AuthorizedKeysFile .ssh/authorized_keys
    
  • Allow root login

    PermitRootLogin yes
    
  • Allow selected user

    AllowUsers root <user>
    

Restart SSH service

sudo systemctl reload ssh