![]() |
VOOZH | about |
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
Former Senior Technical Writer at DigitalOcean, specializing in DevOps topics across multiple Linux distributions, including Ubuntu 18.04, 20.04, 22.04, as well as Debian 10 and 11.
Senior Technical Writer at DigitalOcean
Building future-ready infrastructure with Linux, Cloud, and DevOps. Full Stack Developer & System Administrator. Technical Writer @ DigitalOcean | GitHub Contributor | Passionate about Docker, PostgreSQL, and Open Source | Exploring NLP & AI-TensorFlow | Nailed over 50+ deployments across production environments.
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!
Awesome wrote up Justin! Very handy. Thank you!
bookmarking for everβ¦ Absolute beginner and found it awesomeβ¦
absolute not useful! a lot of divagations, but again telling what do do instead HOW to do. beginners need to find HOW the fuck to do it!
@castleless: Sorry you feel that way! This article is trying to provide background material to help people understand the commands. Maybe something like the initial server setup guide is more your speed:
https://www.digitalocean.com/community/articles/initial-server-setup-with-ubuntu-14-04
If you want to add sudo privileges for a user named βmyuserβ, run the command:
<pre> visudo </pre>
Then add the following line to the file:
<pre> myuser ALL=(ALL:ALL) ALL </pre>
Done!
Never mind how to do it differently; how to do it the original way before you change it would be more helpful.
So to recap⦠add
Then on nano as visudo,
``` to writeout and save the file /etc/sudoers.tmp
And it's this sudoers.tmp file which is read by sudo as the config file?
Using a tmp file as a config file is a bit counter-intuitive. Does visudo rename it when it's saved?
Answering my own question, that does seem to be the case. So never mind the name of the file, just do it... :/
@rshpeley: visudo ensures that you donβt leave /etc/sudoers in a broken state. Itβs saved to the temp file, checked for errors, then renamed.
I found this really helpful actually. Thanks Justin, much appreciated!
Maybe Iβm on a later version of Ubuntu since this was written, but it looks like the current config advises using an extra file to add user settings to sudoers.
Is it now correct to uncomment the last line of sudoers #includedir /etc/sudoers.d then add a file in the etc/sudeors.d/ containing your additions?
Also, do I need to restart anything for the changes to take affect?
Hi, Very helpful article. By the way, how can we add an ldap user (normal user) to the sudoerβs file?
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.