Locking specific account without using passwd


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Locking specific account without using passwd
# 8  
Old 09-15-2008
i found AWK is there a way i can use that to ask for input to search for the account then append LK to lock it delimeted by :
# 9  
Old 09-15-2008
If this is a "Project" as you state, this forum is not to be used for School Projects.
# 10  
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>
# 11  
Old 10-01-2008
yehhh its going to be on a test machine so if it breaks it breaks but im trying to append LK

to the correct field in the shadow field. How could i do that?
# 12  
Old 10-01-2008
Copy the shadow file.
Create an account.
Lock that account with "passwd -l".
Compare shadow file with the copy (man diff).
Post the output from "diff" for the awk experts to see.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
Login or Register to Ask a Question