Hi, i need to enable root ask for password when connecting through ssh, but when i add the line: passwd root in sshd_config file and restart the service it fails. The error message points to that line. I’ve also set PasswordAuthentication to yes, just above passwd root.
Thanks for any help.
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!
While you are highly encouraged to use SSH keys for authentication when connecting to a server, you can enable access via password for the root account.
You are seeing that error as that line is incorrect. That is a command to run, not a line to put in the file.
First, to permit root logins with a password, you would need to add the following to your sshd_config file:
PermitRootLogin yes
PasswordAuthentication yes
Then to actually set the password for the root account, you will need to run this command:
- sudo passwd root
It will prompt you to enter a new password for the root user.
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.