-2

I don't want it to ever complain about permissions or ask for sudo password ever again. Is there any way to do this?

Val9265
  • 43
  • 1
  • 2

1 Answers1

4

I have to say it is a really bad idea since it removes a big part of the security. To remove password prompts for commands/apps using sudo do

sudo visudo

to open the sudo file. Once in there change:

%sudo   ALL=(ALL:ALL) ALL

to

%sudo  ALL=(ALL) NOPASSWD:ALL

Then exit and save using Ctrl+x, y, Enter

To remove password prompts for some graphical applications that use policy kit, not sudo do the following: create a .pkla file in

/etc/polkit-1/localauthority/50-local.d/

for example the file could be named 99-nopassword.pkla and the path would be

/etc/polkit-1/localauthority/50-local.d/99-nopassword.pkla

That file should contain:

[No password prompt]
Identity=unix-group:sudo
Action=*
ResultActive=yes
See the pklocalauthority manpage for more information.

Edit:

To completely remove the necessity of sudo for a terminal session, type sudo -i to execute your shell. After that you don't have to run sudo until you close that session

Sources:

How to disable the password prompts?

Disable authentication prompts in 15.04?

terdon
  • 98,183
  • 15
  • 197
  • 293
ADDB
  • 1,570
  • 1
  • 12
  • 20
  • Thanks for answering. What about permissions though? If I do this, can I install anything without it complaining about permissions? – Val9265 Jul 01 '17 at 09:52
  • 2
    You still have to write sudo but it wont ask for a password. To completely remove sudo you'd have to switch to root user by typing `su root` but that's an idea even worse. If you know you have to type many commands in the terminal and don't want to write sudo every time you can also execute `sudo /bin/bash` to open an administrator shell in which you won't need sudo. – ADDB Jul 01 '17 at 09:55
  • 1
    @Val9265 it's good idea to accept that answer if it solved your problem – Sumeet Deshmukh Jul 01 '17 at 13:17
  • @ADDB `sudo -i` gives a root login shell, right? Why use `sudo /bin/bash` then? – takatakatek Jul 01 '17 at 14:03
  • 1
    @takatakatek there's a slight different, that makes `sudo -i` preferable to `sudo /bin/bash`, because `sudo -i` runs the specific shell of the user's password entry, while `sudo /bin/bash` is only for that one shell. – ADDB Jul 01 '17 at 14:09
  • @ADDB , So if I have specified `/bin/zsh` in `/etc/passwd` then `sudo -i` gives me *Zsh*, whereas `sudo /bin/bash` always gives *Bash*. Is that correct? – takatakatek Jul 01 '17 at 14:21
  • Right @takatakatek – ADDB Jul 01 '17 at 14:22