0

The situation arise when I want to exchange my used laptop which requires password authentication during login and while issuing sudo commands. The other party wants no password at all. Is that even possible?

4
  • No, it isn't and it shouldn't be. Not even Windows allows that. Commented May 16, 2021 at 8:06
  • 1
    When you say "remove login password" do you mean the ability to log in to ubuntu without the need to enter your password? That part is possible but removing the need for sudo protection is ill-advised but possible see this reference
    – graham
    Commented May 16, 2021 at 8:30
  • 1
    Ok thanks. I have already tried using sudo visudo .. that seems to work bypassing the requirement at commandline. But I would like to know how to log in to ubuntu without the need to enter the password. (I tried enabling auto login at user settings after which it seems it logins but it still asks for after a while!) Commented May 16, 2021 at 8:41
  • 2
    This is the Gnome keyring which by default uses your user password and unlocks automatically at login. If you have passwordless login, it does not unlock and asks you when some app tries to unlock it (e.g. Chromium or sshagent). You can remove the password from the keyring by using an empty password.
    – pLumo
    Commented May 16, 2021 at 10:24

1 Answer 1

1

To remove login and sudo passwords do the following:

  1. Login password:
  • Enable Automatic Login. (This should allow you to log in automatically into the OS) .

  • Also, remove the password from the keyring by using an empty string.
    An alternative (but I won't advise since I don't know the implications) may be to remove the file login.keyring as shown below:

    $ rm ~/.local/share/keyrings/login.keyring
    
  1. Sudo password:
  • Edit the sudoers file:

    $ sudo visudo
    
  • Disable the sudo password:

    • First, check whether there’s an existing rule with your alias.
      (In the file sudoers. I think it is found in /etc/).
      If there is, it should look like: YOUR_USERNAME ALL=(ALL) <SOMETHING>:ALL.

       ~$ sudo nano /etc/sudoers
      
    • If there isn’t, move to the end of the file and create a new rule there as follows:

       YOUR_USERNAME ALL=(ALL) NOPASSWD:ALL
      
    • Save the changes and exit the editor: Ctrl + O and Ctrl + X.

  • Voilà! You can now test it by installing an app.

Hope this goes a long way to help you...

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.