Sponsored Content
Top Forums Shell Programming and Scripting Create account that expires in 3 days Post 302550683 by dude2cool on Friday 26th of August 2011 05:35:03 PM
Old 08-26-2011
try this, offcourse add whatever else you need as options to useradd, here I just wanted to test the expiry.

Code:
$ sudo useradd -e `date -d '+3 days' '+%Y%m%d'` test1

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to create an account on UNIX-server

How can i create an account on my UNIX-server? 1. The files, can't be deleted by that person. (or better: he can only delete his own upped files, or can delete files, but can't see mine) 2. He can upload files. 3. I can delete and see everything. Hope you guys can help me. B.T.W. nice... (1 Reply)
Discussion started by: SEC
1 Replies

2. UNIX for Dummies Questions & Answers

Create POP 3 Account via Shell

This may be so simple that I am overlooking it somewhere, but search as I may, I cannot find an answer anywhere! I am running a Linux box with sendmail and many different virtual domains. I cannot however, figure out how to setup a pop3 account for a specific domain. For example, I have a... (0 Replies)
Discussion started by: kermite
0 Replies

3. UNIX for Dummies Questions & Answers

Make an account inactive after 90 days.

Is this possible? Say I create an account today and in 90 days I want it to be turned off. Is this sort of thing possible using the built in components of a Unix system? (Using Solaris 9) I see things about password expires, but what if the person changes his password on the 89th day,... (1 Reply)
Discussion started by: LordJezo
1 Replies

4. UNIX for Dummies Questions & Answers

Change Account to not lock account if password expires

I have access to 15+ UNIX boxes at work, and I do not consistently log onto all of them over time. When I do try to access one I havent been on in awhile, my account is locked as the password has expired. I need to request to the UNIX SA's that the password expiration is 90 days and that if it... (1 Reply)
Discussion started by: stringzz
1 Replies

5. UNIX for Dummies Questions & Answers

Create a unix account

Hi, Please could some advise how to create a unix account, from the root account. thanks you (2 Replies)
Discussion started by: venhart
2 Replies

6. Solaris

Create sft account in unix

How to create sftp account in UNIX end. Anyone guide me on this. (2 Replies)
Discussion started by: vijill
2 Replies

7. Solaris

Help me create new user account

I want create user. That user should be login to any server without asking password. How? tell me in detail. :wall: (3 Replies)
Discussion started by: Navkreddy
3 Replies

8. Red Hat

how to create hidden account in centos

hi everybody, iam using 32bit centos 6.2 on my machine, and i want to create hidden user 'test' , i mean to say while iam starting my centos at GUI mode, at that time that username 'test' should not appear at list of users, only i can use that username is command line. logging in through... (1 Reply)
Discussion started by: paruhang
1 Replies

9. AIX

Create another root account

Hi I would like to create another root account, for example root2. I added a new user named root2 and set it's uid and gid ( in /etc/passwd ) to 0. Then I logged in ( account root2 ) and the server asked to change the password, so I changed. And the problem happend. The password of both root... (15 Replies)
Discussion started by: bobochacha29
15 Replies
CHAGE(1)						      General Commands Manual							  CHAGE(1)

NAME
chage - change user password expiry information SYNOPSIS
chage [-m mindays] [-M maxdays] [-d lastday] [-I inactive] [-E expiredate] [-W warndays] user chage -l user DESCRIPTION
chage changes the number of days between password changes and the date of the last password change. This information is used by the system to determine when a user must change her password. The chage command is restricted to the root user, except for the -l option, which may be used by an unprivileged user to determine when her password or account is due to expire. With the -m option, the value of mindays is the minimum number of days between password changes. A value of zero for this field indicates that the user may change her password at any time. With the -M option, the value of maxdays is the maximum number of days during which a password is valid. When maxdays plus lastday is less than the current day, the user will be required to change her password before being able to use her account. This occurance can be planned for in advance by use of the -W option, which provides the user with advance warning. With the -d option, the value of lastday is the number of days since January 1st, 1970 when the password was last changed. The date may also be expressed in the format YYYY-MM-DD (or the format more commonly used in your area). The -E option is used to set a date on which the user's account will no longer be accessible. The expiredate option is the number of days since January 1, 1970 on which the accounted is locked. The date may also be expressed in the format YYYY-MM-DD (or the format more com- monly used in your area). A user whose account is locked must contact the system administrator before being able to use the system again. The -I option is used to set the number of days of inactivity after a password has expired before the account is locked. The inactive option is the number of days of inactivity. A value of 0 disables this feature. A user whose account is locked must contact the system administrator before being able to use the system again. The -W option is used to set the number of days of warning before a password change is required. The warndays option is the number of days prior to the password expiring that a user will be warned her password is about to expire. If none of the options are selected, chage operates in an interactive fashion, prompting the user with the current values for all of the fields. Enter the new value to change the field, or leave the line blank to use the current value. The current value is displayed between a pair of [ ] marks. NOTE
The chage program requires shadow password file to be available. Its functionality is not available when passwords are stored in the passwd file. FILES
/etc/passwd - user account information /etc/shadow - shadow user account information SEE ALSO
passwd(5), shadow(5) AUTHOR
Julianne Frances Haugh <jockgrrl@ix.netcom.com> CHAGE(1)
All times are GMT -4. The time now is 08:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy