Difference between revisions of "Sudo"
Jump to navigation
Jump to search
↑ https://askubuntu.com/questions/192050/how-to-run-sudo-command-with-no-password
Tags: Mobile web edit, Mobile edit |
Tags: Mobile web edit, Mobile edit |
||
Line 2: | Line 2: | ||
* Man page: https://man7.org/linux/man-pages/man8/sudo.8.html | * Man page: https://man7.org/linux/man-pages/man8/sudo.8.html | ||
+ | == Examples == | ||
* Add user to sudo [[group]]: <code>sudo [[usermod]] '''-a'''G sudo YOUR_USERNAME</code> | * Add user to sudo [[group]]: <code>sudo [[usermod]] '''-a'''G sudo YOUR_USERNAME</code> | ||
Revision as of 07:19, 21 April 2021
sudo
is a program for Unix-like computer operating systems that allows users to run programs with the security privileges of another user.
Examples
Task
- Allow user YOUR_USER_NAME to run sudo commands without typing the password:
Include in /etc/sudoers
, using the visudo
command, the following line at the end of the file:
YOUR_USER_NAME ALL=(ALL) NOPASSWD:ALL
[1]
- Understand order rules are applied and impact: https://vim.fandom.com/wiki/Set_Vim_as_your_default_editor_for_Unix
- Use Ansible to modify file for passwordless sudo execution in Ubuntu
Security vulnerabilities
- CVE-2019-14287 https://nvd.nist.gov/vuln/detail/CVE-2019-14287, https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-14287. CVSS Base Score: 8.8
Exploitable if the following configuration is present:
username hostname = (ALL, !root) path-to-command
Errors
sudo: unable to resolve host
See: resolv.conf
[sudo] password for USERNAME: USERNAME is not in the sudoers file. This incident will be reported.
Options
-S, --stdin
Related terms
See also
sudo
,id
,visudo
,useradd
,userdel
,usermod
,groups
,passwd
,chown
,chmod
,chgrp
,groupadd
,groupdel
, Passwordless sudo, passwd (package),sudo --help
- journalctl
Advertising: