0

I heard that its not ok to run stuff always with sudo, because its same like running stuff as administrator on other os. Is it possible to revert it and un-sudo it so it dont have root access?

1 Answers1

2

There is no need to revert anything.

If you run a command prepending sudo, you'll run the command with root privileges.

If you run a command without sudo, you'll run the command with your user privileges.

Example:

$ sudo ls -a /root
[sudo] password for mook: 
.  ..  .bash_history  .bashrc  .cache  .local  .profile  .synaptic
~$ ls -a /root
ls: cannot open directory '/root': Permission denied

In this example I use the command ls -a /root, first with sudo, then without sudo. As you can see, in the second command I don't have root-access and get a permission denied, even if I have used the same command with sudo before.

Melebius
  • 11,431
  • 9
  • 52
  • 78
mook765
  • 15,925
  • Some apps/programs/commands need sudo to run well. Should not use sudo to open programs that do not need it, like firefox. Sudo apps should only run for short periods of time and be ended, sudo also usually has a set time before needing to be given again, you give a command with sudo and do not use another command within a few minutes, will need password again. – crip659 Apr 28 '20 at 21:02
  • @crip659 sudo also usually has a set time before needing to be given again No, the time (usually15 min) is the time you don't need to enter the password when using sudo again within that time. Running a command without sudo will never evaluate privileges. – mook765 Apr 28 '20 at 21:19
  • 1
    @mook765 "will never evaluate privileges" in the last comment should be "will never elevate privileges" – karel Apr 29 '20 at 01:05
  • @karel Yes, sure. – mook765 Apr 29 '20 at 05:46