Sponsored Content
Top Forums Shell Programming and Scripting Locking specific account without using passwd Post 302236456 by avronius on Monday 15th of September 2008 02:16:57 PM
Old 09-15-2008
1. Understand the contents of the shadow file:
Code:
man shadow
username:password:lastchg:min:max:warn:inactive:expire:flag
/etc/shadow  entries should appear in exactly the same order as  /etc/passwd  entries;

If you prepend *LK* to the beginning of a line in /etc/shadow, you will break things.
If you append *LK* to the end of the line, you may get unexpected results.

<soapbox>
Manually mangling /etc/shadow is problematic for the following reason:
If you corrupt the root entry, you will not be able to perform administrative tasks on the server, and will need to reboot from alternate media to repair.

There is a reason that we have commands like passwd. They are to ensure the integrity of the system as a whole. If you wish to bypass these safeties, you risk the entire environment.</soapbox>
 

10 More Discussions You Might Find Interesting

1. Solaris

solari s 10 auto account locking

does anyone know in solaris 10, can you lock an account if the user does not change their password within a certain amount of time? What i want to do is, if a user doesnt change their password within 90 days, i want the account locked. This is similar to the redhat linux passwd -i command. ... (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies

2. Shell Programming and Scripting

Looking for specific user ID's from the passwd file

Hello, My issue is that I want to look for specific users that have their first and last initial followed by four numbers. For example: ab1234 I've already got the user ID's out of the passwd file more passwd | awk -F ":" '{print $1}' > userids I just need to know how to just pick... (8 Replies)
Discussion started by: LinuxRacr
8 Replies

3. Solaris

ftp account locking

I need some help trying to figure out why our ftp account keeps getting locked with no manual intervention. We have end of day processes that run nightly and the last thing it does is ftp files to a server. Everyonce in a while the script fails because the account has been locked. How could this... (5 Replies)
Discussion started by: morgadoa
5 Replies

4. Solaris

Solaris 10 Kerberos with local account locking

Hello Gurus, I desperately need help to replicate the functionality that I had with Solaris 8 and SEAM into Solaris 10. Our application needs a few users which are created with the application install. One of our customer requires Kerberos as single sign-on because of their IT department... (0 Replies)
Discussion started by: rmaavnii
0 Replies

5. Solaris

passwd cmd reenables passwd aging in shadow entry

Hi Folks, I have Solaris 10, latest release. We have passwd aging set in /etc/defalut/passwd. I have an account that passwd should never expire. Acheived by emptying associated users shadow file entries for passwd aging. When I reset the users passwd using passwd command, it re enables... (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies

6. Red Hat

List shell of specific account

Hi everyone. I am wondering how I would accomplish outputting the shell of a specific account on a single line of output. For example I would like to list the shell of 'news' as... /bin/sh providing its current shell is /bin/sh. This probably is a simple answer that I haven't been able to... (2 Replies)
Discussion started by: austinharris43
2 Replies

7. Shell Programming and Scripting

Issue in passing passwd to login into a sudo account

Hi Gurus, I have small issue... I used to pass the passwd for sudo commands like below, gzcat ~/passwd.gz | sudo su - <villin> >> eof ------ ----- ------ eof And it was able to login into "villin" sudo account successfully. But now, I'm using the same in another script for the... (2 Replies)
Discussion started by: raghu.iv85
2 Replies

8. AIX

When did AIX start using /etc/security/passwd instead of /etc/passwd to store encrypted passwords?

Does anyone know when AIX started using /etc/security/passwd instead of /etc/passwd to store encrypted passwords? (1 Reply)
Discussion started by: Anne Neville
1 Replies

9. Solaris

Particular user account shouldn't be locked after entering wrong passwd specfic no. times

Hi all In my system we have implemented user lockout feature after 3 failure attempt if he tries to login directly or if he run the any command through sudo and enter wrong password thrice. Now I have requirement in which particular user account shouldn't be locked when he run the command... (1 Reply)
Discussion started by: sb200
1 Replies

10. Solaris

Which process/script is locking account ?

There is a account - ohsuser on Solaris-10 zone. It is getting locked every 2-3 minutes. Can I know, what is process or script, which is using this account and locking it ? root@tswsd23-prdt01:/root# cat /var/adm/messages | tail -10 Sep 24 11:05:53 tswsd23-prdt01 nmo: Excessive (3) login... (5 Replies)
Discussion started by: solaris_1977
5 Replies
SHADOW(5)							File Formats Manual							 SHADOW(5)

NAME
shadow - encrypted password file DESCRIPTION
shadow contains the encrypted password information for user's accounts and optional the password aging information. Included is Login name Encrypted password Days since Jan 1, 1970 that password was last changed Days before password may be changed Days after which password must be changed Days before password is to expire that user is warned Days after password expires that account is disabled Days since Jan 1, 1970 that account is disabled A reserved field The password field must be filled. The encryped password consists of 13 to 24 characters from the 64 character alphabet a thru z, A thru Z, 0 thru 9, . and /. Refer to crypt(3) for details on how this string is interpreted. The date of the last password change is given as the number of days since Jan 1, 1970. The password may not be changed again until the proper number of days have passed, and must be changed after the maximum number of days. If the minimum number of days required is greater than the maximum number of day allowed, this password may not be changed by the user. An account is considered to be inactive and is disabled if the password is not changed within the specified number of days after the pass- word expires. An account will also be disabled on the specified day regardless of other password expiration information. This information supercedes any password or password age information present in /etc/passwd. This file must not be readable by regular users if password security is to be maintained. FILES
/etc/passwd - user account information /etc/shadow - encrypted user passwords SEE ALSO
chage(1), login(1), passwd(1), su(1), passwd(5), pwconv(8), pwunconv(8), sulogin(8) AUTHOR
Julianne Frances Haugh (jockgrrl@ix.netcom.com) SHADOW(5)
All times are GMT -4. The time now is 03:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy