i used to love LA

recently i found myself advising two of my very closest friends that they should stay away from living in Los Angeles — - one already lives in LA, well, not really, she actually lives in Santa…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




How to add Users to Sudoers File in Ubuntu

sudo allows you to run a Unix command as a different user. Using /etc/sudoers file to confirm what privileges are available to you, this command effectively elevates your access rights, thus allowing you to run commands and access files that would otherwise be not available to you.

The sudoers file is a text file that lives at “/etc/sudoers.” It controls how sudo works on your machine. You are probably familiar with sudo’s primary role of elevating your current account’s privileges to root, the superuser on all Unix-based systems.

The sudoers file is located at /etc/sudoers . And you should not edit it directly, you need to use the visudo command.

Now mainly the VISUDO file is used for adding the users in sudoers file.

Here’s what the Ubuntu man page says about it, I think it’s a great summary:

We are going to use visudo file to add users to that file.

Since /etc/sudoers file defines rules for (sometimes passwordless) access to privileged access, you can only run visudo as root.

You don’t need to specify any command line options. Just become root and run the command. You’ll be shown your default text editor window with the /etc/sudoers file.

Just run the below command:

After running this above command you will get the below file, in this just add users.

You can see “User privilege specification”, the only root is added there down to root line you can add many users as same as root.

Like:

After adding users in visudo file “ctlr+x” and enter “y”it will save the visudo file. Now you can use Sudo. Like installing libraries, updating, etc.

Once you finish editing, visudo will perform a number of checks on the resulting /etc/sudoers.tmp file before appying its changes into /etc/sudoers file. If an issue is found, you’ll get the message about it after you save the file and exit your text editor:

Just press Enter to see the options:

Most likely you’ll want to press e to continue editing the file. But if you can’t find what’s wrong (it may well be that /etc/sudoers was broken by someone else before you, because — you guessed it — they edited file manually instead of using visudo) — if that’s the case, you may just press x to exit and to investigate the /etc/sudoers file more.

Granting sudo access to a user in Ubuntu is a simple task, all you have to do is to add the users to the “visudo” file.

I hope this article helped you. Please leave comments/suggestions below!

Add a comment

Related posts:

Menina.

Eyes full of pain upon a face that has barely lived, No one notices you, no one cares who you are or what you have to give. Staring at the people in front of you, the ones you so long to be, You…

Hyperledger Fabric 2.0 released with various updates

Hyperledger has recently announced the release of Hyperledger Fabric 2.0, the updated version of its popular blockchain — Hyperledger Fabric. Some of the features that the new version offers include…