Change Last Login within /etc/shadow


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Change Last Login within /etc/shadow
# 1  
Old 01-22-2010
Change Last Login within /etc/shadow

Was wondering if any had a script to change the last login field within the /etc/shadow? Need to it run against machines to "reset" the last login so local accounts will not expire if account isn't access within the mandatory setting we are force to implement.

Thanks!!!!
# 2  
Old 01-22-2010
Hi.

Question: If you can (i.e. are able to) modify such a thing, and in doing so, circumvent the policy "you are forced to implement", why can't you just circumvent the policy by not implementing it in the first place?
# 3  
Old 01-25-2010
We are forced to have the accounts expire after 60 days. I want a script that I can run to change the last change date on accounts that are not used very often. example: run the script for the local accounts to have last change date become yesterday.
# 4  
Old 01-25-2010
Logging in does not write to the shadow file.

Record keeping of "last login" varies according to your Operating System and it is not always installed by default.
What Operating System do you have?


BTW. As hinted above, most Administrators would exclude non-user accounts (e.g. "oracle" or whatever) from such a policy because of the complex issues with automated tasks when the password expires.
# 5  
Old 01-25-2010
our system accounts are excluded from the policy but we have local accounts that are subject to the policy. OS are Sol9 & 10, SUSE and Red Hat.
# 6  
Old 01-25-2010
So why not exclude the local accounts that you need too?
I'm assuming that this is an audit requirement and you have to show that the policy is in effect, ie. passwords are set to expire after X days, when someone looks at your system but in reality, you're not abiding by it fully.

I've been there and it's usually easier to get an exception for those users that require it than to write whatever scripting is necessary to catch them all, or if it's a manual thing, to set your calendar to remind you to do it. Eventually, it will catch you and an automated process will fail because of an expired password.

Good luck.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Change login process

Hello everybody ! At the beginning - I hope everything will be understandable as I know that my english skills are not as good as I would like. I use Manjaro Linux for one year, previously used Ubuntu for 6 years. Today I got an idea to create small USB electronic device but I don't know how... (6 Replies)
Discussion started by: halfboy
6 Replies

2. Solaris

Change Password on First Login

Hi there, Is there a way to ask the solaris user to change passwordo n the first login. I am looking at how to do this for every single new user. (5 Replies)
Discussion started by: alvinoo
5 Replies

3. Shell Programming and Scripting

change login

Hi, I have a script called from php, which executes the following code: basename $arxivo .doc > nombre nom=`cat nombre` antiword -t $arxivo > $nom.txt rm nombre The problem is that I do not antiword conversion. I guess the problem must be that the user does not have permissions... (2 Replies)
Discussion started by: uri_crack
2 Replies

4. Post Here to Contact Site Administrators and Moderators

change of login id..

Hi, Can I change my login id having my current account alive? I found one thread related to this which shows that it is possible. I also agree that this is not done in normal terms. Still, can I request for it? I really dont want to lose my current account and my post count. would... (1 Reply)
Discussion started by: clx
1 Replies

5. Post Here to Contact Site Administrators and Moderators

How can i change my login ID?

Hello, How can i change my login ID? My login ID is younus_syed. Thanks & Regards Younus Syed (10 Replies)
Discussion started by: younus_syed
10 Replies

6. UNIX for Dummies Questions & Answers

I want to change login failure message, "login incorrect"

I want to change login failure message, "login incorrect" deny user login for user id tom sudo passwd -l tom type username and type password on login prompt and then it will display login failure message "login incorrect" console ############ login: tom password: login incorrect... (2 Replies)
Discussion started by: lifegeek
2 Replies

7. Shell Programming and Scripting

force to change password(by modifying /etc/shadow)

hi by modifying /etc/shadow how can I Force a change of password so that user has at least 1 week to login? I did it by using: echo "enter username to force password change" read user; chage -M 7 $user; How can I do it by modifying /etc/shadow?? (6 Replies)
Discussion started by: tjay83
6 Replies

8. AIX

Change users login name

Hi, I need to change some users login name in AIX. With solaris i donīt had problems, i have used "usermod". But in AIX the usermod command donīt have the same behavior. Can someone give me a tip on how to perform these changes? Thanks in advance. (9 Replies)
Discussion started by: spacewalker
9 Replies

9. UNIX for Dummies Questions & Answers

Password change at login????

I want Red Hat Linux 7.2 prompt for new password at next login time. How can I do this????? passwd -f don't work for linux...... (4 Replies)
Discussion started by: rrivas
4 Replies

10. UNIX for Dummies Questions & Answers

change login dir

Ok when I log in to my terminal I land in a dir. How can I change the dir that I start from when I login? Thanks for the help, sure it is a no brainer for you guys cd (5 Replies)
Discussion started by: lorcet222
5 Replies
Login or Register to Ask a Question