By jus29
Probably goes without saying, but I am new to DO and everything involved with it.
I was setting up my first server and set up ssh and I can successfully ssh into my server.
Perhaps I don’t yet have a firm enough grasp on SSH, but when executing certain commands, like sudo service fail2ban restart I am asked to input my password.
I was under, maybe the false, impression that when I SSH I wouldn’t need to use my password. Am I incorrect? Is it perfectly normal to be asked for your password to execute certain commands even if you are SSH-ed into the server?
Thanks for the help, I apologize for any terminology misuse.
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!
Accepted Answer
This question was answered by @newhosting2015:
Hi quoid. What Nixola is saying is that yes, it is normal to have to enter a password every so often when executing commands such as the one you originally mentioned (
sudo service fail2ban restart) …I think the sudo user password is requested something like every fifteen minutes or so, as well as of course at the start of your session if you are entering a sudo command. How you are doing things is correct, in that you are using a new user with root privileges instead of using root. What Nixola was saying to you when referencing “don’t do this”, was basically saying use a sudo user and not the root account, because it is generally advised to disable the root account login after your new user has been created.
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.