I was hoping that somebody could help me out with this.
I just deployed a new FTP server and I have a script that creates the new account. How would I go about having it expire 3 days after after creation?
useradd -s /bin/false -m -p $pass $username
There are nearly as many answers to this as there are flavors of UNIX. So, what platform are you using (useradd isn't unique to just one)?
I'm trying to do this for a Ubuntu 10.10 server
---------- Post updated at 05:20 PM ---------- Previous update was at 05:12 PM ----------
Id like to use something like the --expire switch but that requires me to input a date every time
try this, offcourse add whatever else you need as options to useradd, here I just wanted to test the expiry.
$ sudo useradd -e `date -d '+3 days' '+%Y%m%d'` test1
dude2cool:
try this, offcourse add whatever else you need as options to useradd, here I just wanted to test the expiry.
$ sudo useradd -e `date -d '+3 days' '+%Y%m%d'` test1
Am I correct to assume that in your example test1 is the name of the account created?
Yes, test1 is the account name
Is there a way for me to see howlong till a account expires or even list expired accounts?