By dooma
Hi,
After I tried to add Public Key Authentication, then I added the pubic key to the new remote user following by changing the permitrootlogin to “NO” as this tutorial said : https://www.digitalocean.com/community/tutorials/initial-server-setup-with-centos-7
when I tried to reload the ssh to apply the new setting, it doesn’t and I got this error :
Redirecting to /bin/systemctl restart ssh.service
Failed to restart ssh.service: Unit ssh.service failed to load: No such file or directory.
I tried to restart it using these both commands
systemctl reload sshd & service ssh restart
but it didn’t get restarted. When I checked it’s status, I found that it’s active and running. so what’s the solution to solve that and restart it ?
Thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
The command to restart the service should be:
service sshd restart
From the output you shared it looks like you may have been running service ssh restart which referred to a service “ssh” that could not be found.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.