Add New User with Specific Expire Date

Started by nikolaymartin, June 08, 2020, 09:26:12 AM

Previous topic - Next topic

nikolaymartin

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.

deanwebb

Hey, good to hear from you again. You hadn't been around in a while, I was getting worried you'd been deleted or blocked as a spammer. :smug:

OK, so a temporary user... this is cool... I'll look that up...

https://unix.stackexchange.com/questions/80968/how-can-i-create-automatically-expiring-user-accounts <-- first search result, betcha it's got the goods!

and daaaaaaaaaaaaaamn, they quote the man page!

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

     If not specified, useradd will use the default expiry date specified
     by the EXPIRE variable in /etc/default/useradd, or an empty string
     (no expiry) by default.

To figure out the date in the future, date -d can give that info.

Take a baseball bat and trash all the routers, shout out "IT'S A NETWORK PROBLEM NOW, SUCKERS!" and then peel out of the parking lot in your Ferrari.
"The world could perish if people only worked on things that were easy to handle." -- Vladimir Savchenko
Вопросы есть? Вопросов нет! | BCEB: Belkin Certified Expert Baffler | "Plan B is Plan A with an element of panic." -- John Clarke
Accounting is architecture, remember that!
Air gaps are high-latency Internet connections.

Otanx

Less than 30 minutes from question asked to answered. Faster than most TACs.

-Otanx

deanwebb

Quote from: Otanx on June 08, 2020, 10:47:52 AM
Less than 30 minutes from question asked to answered. Faster than most TACs.

-Otanx


:badass:

We got us a pretty decent SLA around here, for a bunch of volunteers. :smug:
Take a baseball bat and trash all the routers, shout out "IT'S A NETWORK PROBLEM NOW, SUCKERS!" and then peel out of the parking lot in your Ferrari.
"The world could perish if people only worked on things that were easy to handle." -- Vladimir Savchenko
Вопросы есть? Вопросов нет! | BCEB: Belkin Certified Expert Baffler | "Plan B is Plan A with an element of panic." -- John Clarke
Accounting is architecture, remember that!
Air gaps are high-latency Internet connections.

Otanx

If we break SLA you get your money back.

-Otanx

deanwebb

That other bot responder is taking its sweet time in getting back to us, wonder if they're maxing out on CPU...
Take a baseball bat and trash all the routers, shout out "IT'S A NETWORK PROBLEM NOW, SUCKERS!" and then peel out of the parking lot in your Ferrari.
"The world could perish if people only worked on things that were easy to handle." -- Vladimir Savchenko
Вопросы есть? Вопросов нет! | BCEB: Belkin Certified Expert Baffler | "Plan B is Plan A with an element of panic." -- John Clarke
Accounting is architecture, remember that!
Air gaps are high-latency Internet connections.