The command sudo provides other users to run a command as a root. To use sudo user must have their level of privilege in /etc/sudoer file. In some cases this file is set for read only and others can edit that file and add their user name in Sudoer for this case such as Fedora 12 users need to provide this syntax as a root on their terminal.
Syntax for adding a user in Sudoer file is:
chmod 755 /etc/sudoersThis code will be enough to give permissions to the user and his user group.
If you are an ubuntu user you can easily add your user in this file like:
vi /etc/sudoers
And you will get a text file. Afterward you need to press 'i' for edit and edit by adding your username just below
"root ALL=(ALL) ALL"
"username ALL=(ALL) ALL"
Syntax for adding a user in Sudoer file is:
echo "username ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoersAnd to gain the writing privilege you can use the following code in your terminal :
chmod 755 /etc/sudoersThis code will be enough to give permissions to the user and his user group.
If you are an ubuntu user you can easily add your user in this file like:
vi /etc/sudoers
And you will get a text file. Afterward you need to press 'i' for edit and edit by adding your username just below
"root ALL=(ALL) ALL"
"username ALL=(ALL) ALL"
Comments
Post a Comment