how change the user and root password in linux mint 19?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
reginaldo2
Level 1
Level 1
Posts: 3
Joined: Mon Aug 20, 2018 8:56 pm

how change the user and root password in linux mint 19?

Post by reginaldo2 » Mon Aug 27, 2018 7:37 pm

how change the user and root password in linux mint 19?
password is disabled to be chanded here
password is disabled to be chanded here

benali72
Level 4
Level 4
Posts: 222
Joined: Sat Mar 23, 2013 11:49 am

Re: how change the user and root password in linux mint 19?

Post by benali72 » Tue Aug 28, 2018 12:08 am

To change a user id password, you can open a terminal window and type in the command --

$ passwd

It will prompt you for your current password, then allow you to enter a new one to change it.

To change the root user id password, open a terminal window then switch to the root user id --

$ su root

Then enter passwd like before --

$ passwd

Enter your old and new passwords.

There are GUIs to change passwords, but the terminal window approach should work regardless of your GUI or Mint version.

sgtor
Level 4
Level 4
Posts: 333
Joined: Sat May 13, 2017 9:39 pm

Re: how change the user and root password in linux mint 19?

Post by sgtor » Tue Aug 28, 2018 3:07 am

If you haven't logged into root yet then you need to do this

Code: Select all

sudo bash
that gives you a root shell then just type

Code: Select all

passwd
It will ask you for a password then you have a root account with password.

From there you can type in

Code: Select all

su
and type the root password.

It can be a bit confusing to know which password to enter but the easy way to remember is

sudo needs your user password
su needs root password

both give you root access

Mute Ant
Level 14
Level 14
Posts: 5135
Joined: Tue Sep 03, 2013 7:45 pm
Location: Norfolk UK

Re: how change the user and root password in linux mint 19?

Post by Mute Ant » Tue Aug 28, 2018 4:14 am

Sometimes a user has encryption to hide their data when they are logged out. The gross case is an Encrypted Home Folder, but there are others, like when Firefox offers to save your forum password, or Caja offers to remember the password for a LUKS USB stick. A simple guideline will help you avoid locking yourself out of your own data...

o Log in as user X to change the password of user X.
While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named "manual".

reginaldo2
Level 1
Level 1
Posts: 3
Joined: Mon Aug 20, 2018 8:56 pm

Re: how change the user and root password in linux mint 19?

Post by reginaldo2 » Tue Aug 28, 2018 9:52 am

When I change my password and reboot the machine, I can't login with the new password. When I type the password to enter, it accept the password but I receive a blackscreen and back to the login screen. Then I need to press ctrl+alt+f1 and change the password to the old original password to login.

Mute Ant
Level 14
Level 14
Posts: 5135
Joined: Tue Sep 03, 2013 7:45 pm
Location: Norfolk UK

Re: how change the user and root password in linux mint 19?

Post by Mute Ant » Tue Aug 28, 2018 4:31 pm

Root can change any login password without needing the original, but only the original password can unlock the $HOME folder data that makes logging in worth while.

Rupert Says: "Data stored in an encrypted volume will only be accessible with the original password."

Plain-text backup files are always useful, especially if the live data is encrypted.
While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named "manual".

reginaldo2
Level 1
Level 1
Posts: 3
Joined: Mon Aug 20, 2018 8:56 pm

Re: how change the user and root password in linux mint 19?

Post by reginaldo2 » Tue Aug 28, 2018 6:38 pm

so I can not change the password when I install linux mint with HOME folder encryption?

User avatar
GS3
Level 5
Level 5
Posts: 595
Joined: Fri Jan 06, 2017 7:51 am

Re: how change the user and root password in linux mint 19?

Post by GS3 » Wed Aug 29, 2018 7:11 am

Mute Ant wrote:
Tue Aug 28, 2018 4:31 pm
Root can change any login password without needing the original, but only the original password can unlock the $HOME folder data that makes logging in worth while.
So, in reality, the account log-in password and the $HOME folder password are two different passwords. We know how to change the account user password so the next question would be how can I change the home folder password. And I hope the correct answer to that question is not "you can't change it" because that would be a really bad answer.
HP Compaq Elite 8300 CMT - Linux Mint 18.2 Sonya - Kernel 4.4.0-169-generic X64 - Cinnamon 3.4.4 - Nemo

User avatar
catweazel
Level 19
Level 19
Posts: 9749
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: how change the user and root password in linux mint 19?

Post by catweazel » Wed Aug 29, 2018 7:16 am

GS3 wrote:
Wed Aug 29, 2018 7:11 am
that would be a really bad answer.
Not if you understand encryption, in which case it makes sense.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.

User avatar
GS3
Level 5
Level 5
Posts: 595
Joined: Fri Jan 06, 2017 7:51 am

Re: how change the user and root password in linux mint 19?

Post by GS3 » Wed Aug 29, 2018 7:51 am

catweazel wrote:
Wed Aug 29, 2018 7:16 am
Not if you understand encryption, in which case it makes sense.
catweazel I am going to try to not be too harsh here but that is a totally empty answer which requires some explanation for support. As it is it means nothing.

I know very little about Linux but I do happen to know something about encryption. Quite a bit, in fact.

The data should generally not be directly encrypted with the user-assigned password because in that case changing the password means re-encrypting all the data which is just crazy.

The standard way of dealing with this is how encrypted disks do it. Can you imagine if you had to re-encrypt the entire disk every time you wanted to change the password?

The way it is done is that the system uses a nonce (a random key) to encrypt the data and then encrypts that nonce with the user's password. This has several very substantial advantages:

- To change the user password all you need to do is encrypt the nonce (key) with the new password.

- The nonce key is not kept anywhere in the clear. The disk software needs the password to decrypt the encrypted key.

- No password means no decryption but, furthermore, erasing the file where the encrypted key is kept means the data is irrecoverable forever. No need to reformat disk to erase data. In a fraction of a second the data is gone.

This is how full encryption disks do it. This is how PGP does it. When you encrypt a file or other data with PGP it is not encrypted directly with the user's key. Rather it is encrypted with a random key, which is included in that data encrypted with the user's key.

This also has the advantage that several keys can be used to decrypt the same data because all you have to do is encrypt the data key with the several user's keys.

In summary: encrypting data directly with the user's password is (1) non-standard and (2) crazy inconvenient.

If you have any information that contradicts this I would be very interested in seeing it.
HP Compaq Elite 8300 CMT - Linux Mint 18.2 Sonya - Kernel 4.4.0-169-generic X64 - Cinnamon 3.4.4 - Nemo

User avatar
catweazel
Level 19
Level 19
Posts: 9749
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: how change the user and root password in linux mint 19?

Post by catweazel » Wed Aug 29, 2018 7:57 am

GS3 wrote:
Wed Aug 29, 2018 7:51 am
If you have any information that contradicts this I would be very interested in seeing it.
No, you may be correct.

https://askubuntu.com/questions/109898/ ... lternate-i

It's too late at night for my old brain.

Cheers.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.

User avatar
GS3
Level 5
Level 5
Posts: 595
Joined: Fri Jan 06, 2017 7:51 am

Re: how change the user and root password in linux mint 19?

Post by GS3 » Wed Aug 29, 2018 8:51 am

In my experience people often use encryption without really understanding how that particular implementation works and later are unpleasantly surprised to learn they cannot access their data. Often the encrypted data is tied to some hardware or to a particular software installation and cannot be decrypted unless on that hardware and installation. If that computer dies the data is gone forever unless you have backups somewhere else. Taking that hard disk and plugging it into another computer will not give you access to the data. Users need to understand the underlying encryption system or they are setting themselves up for a very unpleasant surprise.

Trusted Platform Module (TPM) chips and other software safety devices are all great if you understand how they work and how to protect yourself against their failure.

This is one reason I like and use PGP for encryption. I know it does not depend on any hardware or software installation. If I have (1) the encrypted data, (2) the key and (3) PGP software, then I can recover the data. Anytime, anywhere. No problem.
HP Compaq Elite 8300 CMT - Linux Mint 18.2 Sonya - Kernel 4.4.0-169-generic X64 - Cinnamon 3.4.4 - Nemo

rene
Level 12
Level 12
Posts: 4311
Joined: Sun Mar 27, 2016 6:58 pm

Re: how change the user and root password in linux mint 19?

Post by rene » Wed Aug 29, 2018 10:26 am

reginaldo2 wrote:
Tue Aug 28, 2018 6:38 pm
so I can not change the password when I install linux mint with HOME folder encryption?
You can, and if you change your user password as your user (i.e., not as root, including not through sudo) everything should in fact be transparent; I've just tested on a Mint 19 Cinnamon 64-bit VM and it in fact is...

That is: after changing my password with simply passwd, no sudo, no root shell, I can logout and login again with the new password with no hint of trouble. If there is for you, something else is broken but you should still be able to fix things up manually:

After changing my password with e.g. sudo passwd $(whoami), i.e., as root, indeed I'm seeing the behaviour you describe; login in just drops you back to the login screen again. To remedy that, from the login screen use Ctrl-Alt-F1 to log in on a virtual console, as your user and with the new password. Then run

Code: Select all

ecryptfs-rewrap-passphrase ~/.ecryptfs/wrapped-passphrase
and input the old and new password (latter twice) respectively. Hit Ctrl-D to log out, Ctrl-Alt-F7 to switch back to the login screen, and you should be able to login as your user with the new password.

Has also just now been tested so if you are seeing different behaviour then something unexpected is broken; without an idea what that could be, the only remaining advise is reinstall.

Changing the root password is secondary and standard; once you have your user working again, a simple sudo passwd root will do. sudo passwd -dl root to restore the "pristine" situation of having no root password...

User avatar
GS3
Level 5
Level 5
Posts: 595
Joined: Fri Jan 06, 2017 7:51 am

Re: how change the user and root password in linux mint 19?

Post by GS3 » Wed Aug 29, 2018 10:59 am

Let's see if I understand correctly. So the password to log in to the user account and the password to access the user data are the same? And can be changed by root?

So, if Root is not protected by password then root can change a user's password and has access to that user's account and data?
HP Compaq Elite 8300 CMT - Linux Mint 18.2 Sonya - Kernel 4.4.0-169-generic X64 - Cinnamon 3.4.4 - Nemo

rene
Level 12
Level 12
Posts: 4311
Joined: Sun Mar 27, 2016 6:58 pm

Re: how change the user and root password in linux mint 19?

Post by rene » Wed Aug 29, 2018 11:11 am

I'd rather not get into a generic discussion here until OP declares being helped. Such not happening is what in fact annoyed me into installing that VM...

But quickly then, no, things are generally as you describe somewhere above. ~/.ecryptfs/wrapped-passphrase is a random key itself encrypted with the user's login password (try ecryptfs-unwrap-passphrase ~/.ecryptfs/wrapped-passphrase and input your user password to have said key displayed). The rewrap simply decrypts it with the old password and re-encrypts it with the new one; the key itself remains unchanged.

User avatar
GS3
Level 5
Level 5
Posts: 595
Joined: Fri Jan 06, 2017 7:51 am

Re: how change the user and root password in linux mint 19?

Post by GS3 » Wed Aug 29, 2018 11:57 am

rene wrote:
Wed Aug 29, 2018 11:11 am
I'd rather not get into a generic discussion here until OP declares being helped.
Fair enough. I have started another thread on this topic.
HP Compaq Elite 8300 CMT - Linux Mint 18.2 Sonya - Kernel 4.4.0-169-generic X64 - Cinnamon 3.4.4 - Nemo

Post Reply

Return to “Newbie Questions”