Difference between revisions of "Sudo"

From Amahi Wiki
Jump to: navigation, search
(Created page with 'This is how you enable sudo for a user: * Login as root * Run: visudo * Find a line that says root ALL=(ALL) ALL * Add another line after that by typing 'o' …')
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This is how you enable sudo for a user:
+
=Enable '''sudo''' for a user=
 +
If you receive the message: "'HDA_username' is not in the sudoers file.  This incident will be reported."
  
 +
==Command Line Edit==
 +
* Login as root
 +
su
 +
* Copy and Paste: 
 +
echo 'loginname ALL=(ALL) ALL' >> /etc/sudoers
 +
* Where ''loginname'' is your user account.
 +
 +
 +
Use 'ALL=(ALL) NOPASSWD:ALL' if you don't want to be prompted a password.
 +
If you are prompted for a password with 'sudo' it is the user password, not root.
 +
 +
==Manual Edit of Sudoers File==
 
* Login as root
 
* Login as root
 
* Run: visudo
 
* Run: visudo

Latest revision as of 03:30, 23 June 2020

Enable sudo for a user

If you receive the message: "'HDA_username' is not in the sudoers file. This incident will be reported."

Command Line Edit

  • Login as root
su
  • Copy and Paste:
echo 'loginname ALL=(ALL) ALL' >> /etc/sudoers
  • Where loginname is your user account.


Use 'ALL=(ALL) NOPASSWD:ALL' if you don't want to be prompted a password. If you are prompted for a password with 'sudo' it is the user password, not root.

Manual Edit of Sudoers File

  • Login as root
  • Run: visudo
  • Find a line that says
          root    ALL=(ALL)       ALL
  • Add another line after that by typing 'o' an entering
          username    ALL=(ALL)       ALL
  • But use your user name instead of username above