Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
61
rated 0 times [  61] [ 0]  / answers: 1 / hits: 18879  / 2 Years ago, fri, july 15, 2022, 9:00:18

This seems to be a chicken-egg problem.
The most common task using sudo is installing and removing software.



sudo apt-get purge <appname>


But sudo itself can be removed.



sudo apt-get purge sudo # Do not run this command on production computers!


This is where the fun comes



ubuntu@ubuntu:~$ sudo
bash: /usr/bin/sudo: No such file or directory


Although it's obvious that no person in his right mind will purge sudo (other than me), someone can be fooled to run this command (not directly, in its hex mode, or whatever it's called) or a person could SSH in disguised as tech guru and do the mess.



So is there a way of reinstalling sudo?


More From » sudo

 Answers
0

I can install applications using:



pkexec apt-get install <appname>


From man pkexec:




  pkexec allows an authorized user to execute PROGRAM as another user. If
username is not specified, then the program will be executed as the
administrative super user, root.



So, I suppose that pkexec apt-get install sudo should work as well.






Edit: now I can confirm: yes, sudo can be installed using using pkexec apt-get install sudo:



reinstall sudo



(click to enlarge)


[#26499] Saturday, July 16, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
nerta

Total Points: 414
Total Questions: 103
Total Answers: 97

Location: England
Member since Wed, Apr 19, 2023
1 Year ago
nerta questions
Thu, May 12, 22, 16:04, 2 Years ago
Thu, Dec 2, 21, 09:19, 3 Years ago
Thu, May 27, 21, 00:41, 3 Years ago
Sun, Dec 11, 22, 08:33, 1 Year ago
;