Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 6896  / 3 Years ago, tue, july 27, 2021, 11:15:43

How can I make something like that:



There are two users: user with normal privileges, and administrator with admin privileges.



I want to make it like that:



user@localhost:~$ sudo vim 
[sudo] password for administrator: <admin's password here>


And I am on the administrator account now.


More From » 12.10

 Answers
6

If you meant that when logged in as user you want to execute a command as administrator then you need to do:



user@localhost:~$ sudo -u administrator vim


However, the user's password will be asked not the one from adminitrator. To do so you need to run as administrator (hmm) the following command to configure sudo:



visudo


Then scroll down in the opened file and look for other Defaults definition. In this section, preferrably at the end of it, add a new line with:



Defaults targetpw


And save the file and exit. Note that this will change the default behaviour for all sudo users, so if your user administrator needs to use sudo to have root privilege, you would better know the root password!


[#33732] Thursday, July 29, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
urnaetted

Total Points: 10
Total Questions: 113
Total Answers: 117

Location: Burundi
Member since Sat, Aug 21, 2021
3 Years ago
;