Deleting Inactive Solaris users


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Deleting Inactive Solaris users
# 1  
Old 07-02-2010
Deleting Inactive Solaris users

Hello,

I want to do a search for users on my solaris boxes that have been inactive for a defined number of days and then delete them.

Any ideas how to determine or calculate the number of days (possibly using the /var/adm/wtmpx file) from the user's last login to the current date of search.

Sorry if this has been posted before

TIA
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. What is on Your Mind?

Purge of Inactive Users with Zero Posts and Other Anti-spam Measures

In order to keep the site "clean, safe and warm", I have recently purged all accounts at UNIX.COM which meet the ALL of the following 3 criteria: No user activity in 2018 No posts (zero post count) Link in user profile. In addition, I purged all users who registered but never confirmed... (6 Replies)
Discussion started by: Neo
6 Replies

2. Solaris

Disable Inactive User in Solaris 11

Goal: To disable a Solaris user, after that user was inactive for X days. My understanding for linux was that there was no systematic way to disable inactive users, therefore we had to set a password expiration via /etc/default/passwd, MaxWeeks; then in /etc/default/useradd (/etc/shadow), the... (1 Reply)
Discussion started by: Drasavokian
1 Replies

3. UNIX for Dummies Questions & Answers

Migrate users from 1 Solaris 10 to a different Solaris 10 server

Hello, I have to backup users from one server and put them on another server. I have tried cp -pr, copied over the passwd, group, shadow and appended the users from the old server to the new servers files, rebooted and still can't login. The server accepts that new accounts are there but not... (2 Replies)
Discussion started by: hs3082
2 Replies

4. Solaris

Help with Solaris 10 - Patching Inactive Boot

Hi I have a Sun M4000 with 1 Global and 4 non-global zones running Solaris. the downtime to apply the latest Recommend Patch Cluster is about 8hrs. The client will not give me the downtime. I want to use PATCHING TO INACTIVE BOOT ENVIRONMENT method and need urgent assistance. I have a... (2 Replies)
Discussion started by: samruthroy
2 Replies

5. Solaris

List all inactive users who has not logged on since last 90 days

I need actuall script which List all inactive users who has not logged on since last 90 days Thanks in advance. Di! (17 Replies)
Discussion started by: haridham
17 Replies

6. UNIX for Dummies Questions & Answers

List all inactive users who has not logged on since last 90 days

Hi, Can I get a script to list out all the users, who has not logged on since last 90 days. Last command in not working due due to /var/adm/wtmpx is more than 2 GB. Thanks in advance. Regards, Roni (10 Replies)
Discussion started by: manasranjanpand
10 Replies

7. Shell Programming and Scripting

make script deleting mp3 with warnig to users

hi i need to make a script that will check the directories of the users on mp3 or mp4 files. if so they must be automaticly deleted and they have to get a warning message instead. this should be running every day at 1 pm and should be done within the cron file. could someone help me with... (2 Replies)
Discussion started by: stefan
2 Replies

8. UNIX for Dummies Questions & Answers

How to logout inactive users????

I would like to automatically logout from the system inactive users depending on their functions. For example there are users that I would like to logout after 15 minutes of inactivity, but there are others that I would like to logout after 30 minutes of inactivity. It's possible to do this??? (6 Replies)
Discussion started by: rrivas
6 Replies
Login or Register to Ask a Question
chage(1)						      General Commands Manual							  chage(1)

NAME
chage - change user password expiry information SYNOPSIS
chage [-D binddn] [-P path] [-m mindays] [-M maxdays] [-d lastday] [-I inactive] [-E expiredate] [-W warndays] user chage -l [user] DESCRIPTION
chage is used to list and change the password expiry information of a user. It allows the system administrator to change the number of days between allowed and required password changes and the date of the last password change. It allows also to define when an account will expire. The chage command is restricted to the system administrator, except for the -l option, which may be used by an user to determine when his password or account is due to expire. If no option is given, chage operates in an interactive mode, 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. If the users exists in the local passwd file, but not in the local shadow file, chage will create a new entry in the shadow file. OPTIONS
-D, --binddn binddn Use the Distinguished Name binddn to bind to the LDAP directory. The user will be prompted for a password for simple authentica- tion. -P, --path path The passwd and shadow files are located below the specified directory path. chage will use this files, not /etc/passwd and /etc/shadow. This is useful for example on NIS master servers, where you do not want to give all users in the NIS database auto- matic access to your NIS server and the NIS map is build from special files. -l, --list This option will list the password expiry information in a human readable format. The user will see the date when he changed the password the last time, when the password will be expire, when the password will be locked and when the account will expire. -m, --mindays mindays With this option the minimum number of days between password changes is changed. A value of zero for this field indicates that the user may change her password at any time. Else the user will not be permitted to change the password until min days have elapsed. -M, --maxdays maxdays With this option the maximum number of days during which a password is valid is changed. When maxdays plus lastday is less than the current day, the user will be required to change his password before being able to use the account. -d, --lastday lastday With this option the date when the password was last changed can be set to another value. lastday has to be specified as number of days since January 1st, 1970. The date may also be expressed in the format YYYY-MM-DD. If supported by the system, a value of zero forces the user to change the password at next login. -E, --expiredate expiredate With this option the date when the account will be expired can be changed. expiredate has to be specified as number of days since January 1st, 1970. The date may also be expressed in the format YYYY-MM-DD. -I, --inactive inactive This option is used to set the number of days of inactivity after a password has expired before the account is locked. A user whose account is locked must contact the system administrator before being able to use the account again. A value of -1 disables this feature. -W, --warndays warndays With this option the number of days of warning before a password change is required can be changed. This option is the number of days prior to the password expiring that a user will be warned the password is about to expire. FILES
passwd - user account information shadow - shadow user account information SEE ALSO
passwd(1), passwd(5) AUTHOR
Thorsten Kukuk <kukuk@suse.de> pwdutils November 2005 chage(1)