4

I've made new admin account. I did not set a password for that account and it now asks me for the password. Since I can access the account as it automatically logs on when the laptop is turned on, can I set a new password?

5
  • Linux is a known for its security. And password protection is first priority of linux. You always have to set password either you use it or not. Jul 27, 2014 at 20:17
  • 1
    @Dishank Thats completely wrong. You can have accounts with no password even root.
    – squareborg
    Jul 27, 2014 at 20:44
  • But when you need to install new packages, you will face auth failed every time. Jul 27, 2014 at 20:46
  • @Dishank Not if you configure polkit
    – squareborg
    Jul 27, 2014 at 20:54
  • 1
    Regardless, if you don't have a password on auth or admin - you're crazy.
    – rm-vanda
    Jul 27, 2014 at 20:56

3 Answers 3

3

You can set a password from terminal, just open up your favorite terminal and type:

passwd

If your feeling advanced you can stop Ubuntu prompting for password by configuring polkit

Here's an example of configuring polkit to enable users to install apps without authentication.

5
  • Oh yes. I totally forget. Thanks mate. You made my Below answer totally wrong. Jul 27, 2014 at 20:51
  • A much easier way to allow users to install apps without authentication (generally a bad idea) - is to run sudo visudo and add: yourUser ALL=(ALL) NOPASSWD: /usr/bin/apt-get,/usr/bin/pip #etc
    – rm-vanda
    Jul 27, 2014 at 21:02
  • @rm-vanda Your completely correct. I'm guessing from the tone of the OP's question that they are not of the sudo apt-get kind but are using Ubuntu like a good old user and getting hit for GUI authentication.
    – squareborg
    Jul 27, 2014 at 21:08
  • Ah, yes, I forget those people exist. O_< -- wouldn't that trick work if the command were /usr/bin/software-center -?
    – rm-vanda
    Jul 27, 2014 at 21:18
  • @rm-vanda Yes, but user would have to still type sudo /usr/bin/software-center
    – squareborg
    Jul 27, 2014 at 21:26
1

There is no way you can set password from there.

Restart your PC.

Go to recovery mode.

Press enter on prompt-shell

(command prompt will open with root access)

Type :- passwd (admin-name)

Then its all ok.

1
  • best answer because it's general -- works in a variety of situations.
    – Thufir
    Sep 19, 2014 at 5:05
1

From the sounds of it, you may not understand what exactly an "admin" account is - My answer may be irrelevant, but it seems appropriate to leave it here, anyway.

For a user to be an "admin" - they have to be in the sudo group -

$ sudo usermod -G sudo -a yourAdminUser

and then yourAdminUser will be a real admin.

3
  • Simpler way: sudo adduser yourAdminUser sudo
    – muru
    Jul 27, 2014 at 21:12
  • That works if the user already exists?
    – rm-vanda
    Jul 27, 2014 at 21:16
  • 1
    yes. Given that user and group exists, sudo adduser user group adds user to group.
    – muru
    Jul 27, 2014 at 21:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .