sshd Maintaining

sshd maintaining

Install openssh-server

sudo apt install openssh-server
sudo /etc/init.d/ssh start

Test the config file

If the server fail to start, to see what’s wrong

sudo /usr/sbin/sshd -T

A backup file for sshd_config

sudo cp /usr/share/openssh/sshd_config /etc/ssh

Start and stop sshd

sudo systemctl start ssh.service 
sudo /etc/init.d/ssh start
sudo systemctl stop ssh.service 

Generate Host Keys

sudo ssh-keygen -A

Privilege separation user sshd does not exist

add sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin to /etc/passwd and restart the service.