How to undo usermod -e?

Adam: 02 February 2022

I am using Ubuntu 18.04.

I used the command

usermod -e YYYY_MM_DD user

Now, the user's account is expired.

What command can I put in order to remove the expiration date on the user account?

Everleigh: 02 February 2022

You can undo it by running usermod -e again, this time passing an empty string in place of the EXPIRE_DATE string ex.

sudo usermod -e '' user

From man usermod:

   -e, --expiredate EXPIRE_DATE
       The date on which the user account will be disabled. The date is
       specified in the format YYYY-MM-DD.

       An empty EXPIRE_DATE argument will disable the expiration of the