How to disable passwords in Linux when logging in or executing commands

Who I am
Philippe Gloaguen
Author and references


Of course, if you are the only one using the computer and every moment you execute a command, you will be prompted for the password. This is very annoying and extreme, and perhaps if you need to use this trick it will allow you to disable passwords in Linux when you log in or run commands.

It is also important to note that we do not agree at all with the elimination of those tools that allow you to keep the computer away from intruders. They just want to get your personal information in order to harm you in some way. Or see your files, but equally it's good that you have this information handy.

How to disable passwords in Linux when logging in or executing commands

For Linux computer users, it is very difficult to find information on what they should do to solve their computer problems. To disable passwords in Linux While accessing or executing commands, you need to perform the following operations.

Remember that before carrying out these steps, you must make sure that your security is not compromised and that, on the contrary, it no longer brings you problems that are later impossible to correct. That said, we'll show you several methods you can use for log in without having to enter the password. 

The first method we will use is to use the terminal through it we can perform different actions either for system support and for administration. Being in the terminal we will run the following command. Sudo visudo this to access the sudoers file when you do this a series of commands and data will appear on the screen.

Using commands to disable passwords

There we will look for the following information or command "Members of the administration group can obtain root privileges". When we find it, before the last All you are going to write the following NOPASSWD statement and it should look like this NOPASSWD: ALL now we just have to save the changes made.

For this we will use a combination of Ctrl keys and the O key and then to exit the editor we have to do the following key combination. The Ctrl key and the X key, so we can verify that it will no longer be necessary to enter a password when logging in or when having to execute an order in the terminal.

Now we will show you another method which will allow the commands to run as root. For this we will perform the same operation we did previously to insert the file sweats. And being there, we will look for the following line “Allow members of the sudo group to execute any command”. And in the last line it should appear as ALL = (ALL) NOPASSWD: ALL.

To finish and save the changes made, we will use the key combination again. These are the Ctrl key and the O key. Now let's move on to the third method so that Linux doesn't ask for a password when some commands are executed. Here we can be more specific and ask for it to be applied with the desired commands.

To do this, we will go to the same line as “Allow members of the sudo group to execute any command” and the last line should look like this. ALL = (ALL) NOPASSWD: / usr / bin / apt-get /, / sbin / shutdown and finally save the changes by pressing the Ctrl key and then the O key.

You have to be very careful with the instructions you enter, because otherwise you can create a conflict on your machine. And in this way we have shown you how to disable passwords in linux when logging in or executing commands.

add a comment of How to disable passwords in Linux when logging in or executing commands
Comment sent successfully! We will review it in the next few hours.