Add New User with Specific Expire Date

Gabriel9999

Member
Joined
Mar 12, 2019
Messages
38
Reaction score
4
Credits
130
I want to add a user account to my linuxbox. But this user will have specific expire time which will be specified at the useradd definition.
 


JasKinasis

Well-Known Member
Joined
Apr 25, 2017
Messages
1,317
Reaction score
1,867
Credits
8,257
To set an expiry date for the users account with useradd, use the -e option.
e.g.
Bash:
useradd -e  2020-12-31 someuser

The above example will set the expiry date of 31st December 2020 for the account of a user called someuser.

Obviously, if you're setting up a new user, you might want to use several other options, not just the -e option.

A quick bit of duckduckgo-fu yielded this, which will probably help you out a lot. And probably explains things better than I could!
 

sp331yi

Well-Known Member
Joined
Apr 11, 2020
Messages
725
Reaction score
325
Credits
4,614
Was going to add same source -- TecMint.com -- one not to forget!
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Latest posts

Top