-2

I'm using Kali Linux and I want to start with sudo privileges every time I run the terminal using CTRL+ALT+T.

I tried this solution but it's not working:

is-there-a-way-to-stop-having-to-write-sudo-for-every-little-thing-in-linux

Is there a way to do it ?

Thanks in advance.

2
  • Obviously there is a way to do it: The question you reference has several solutions. You can't expect the other users to read through all that, and if anybody answers here, there is a good chance that the answer doesn't work for you. To enable people to help you, state which solutions you tried, and how they failed. "not working" is not a problem description. A problem is described as follows: (1) which steps did you take (2) what did you expect to happen (3) what unexpected results did you get. May 30 '21 at 2:48
  • Are you the sole person using your computer and do you mind if your password is in plain, readable text? May 30 '21 at 3:23
1

There isn't really such a thing as "sudo privileges". There are root privileges, which the sudo command can grant. Or you could log in as root directly, but this isn't generally recommended.

-1

If you do not want to type your password every time you type sudo, you can edit sudoers file by running sudo visudo then making sure the line razimbres ALL=(ALL) NOPASSWD:ALL is present.

If you absolutely do not want to type sudo evry time (which is not recommanded because all your actions will have root privileges), you can add sudo su at the end of your .bashrc (or equivalent) file.

3
  • Thanks Clemente, is there a way to start terminal at root@kali every time ?
    – razimbres
    May 30 '21 at 21:16
  • Noooo! Please don't ever recommend sudo su. And certainly not at the end of your .bashrc
    – roaima
    May 31 '21 at 21:51
  • @roaima I did not recommend it (as it is written between brackets) but I answer the original question :) Jun 4 '21 at 22:46
-2

echo "<username> ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/010_$user-nopasswd

2
  • Could you describe what this does exactly and how it solves the user's issue? Note that it appears as if you are giving the user the rights to execute any command with sudo without having to give a password. You should probably explain why you think this is an adequate measure.
    – Kusalananda
    May 31 '21 at 21:22
  • Since you appear to be relying on the $user variable being set, why not use it as part of the echo command itself? As-is, the answer is not copy-paste-able, since the literal <username> will not match any valid username. Additionally, $user is not guaranteed to contain the current username; perhaps you wanted $USER?
    – Jeff Schaller
    Jun 1 '21 at 1:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.