How to : check username & password is same or not in solaris 10 ?


 
Thread Tools Search this Thread
Operating Systems Solaris How to : check username & password is same or not in solaris 10 ?
# 1  
Old 12-14-2008
How to : check username & password is same or not in solaris 10 ?

Thanks
AVKlinux
# 2  
Old 12-15-2008
Possibley Script

Skeletellay, extract contents of the /etc/password file & capture the first colum (username) into a array
- cat /etc/passwd | awk -F 'print $1' >> into <array> (check syntax)

Then loop each entry & run a passwd command. Caputure whether sucessful or not - passswd will prompt for the password again if unsussful upto 5 attempts so you wil need to disable this ( again non-syntax script below)

for each $i in <array>
'passwd $i $i'
if 'id' = $i then
'exit' (i.e. logout)
'echo $i is password to $i' >> results.txt
else
'echo $i is not the password to $i' >> results.txt
end if
exit


Of course, this probably won't work, but hey I enjoyed writing it!


------
ms. stevi
# 3  
Old 12-15-2008
Heh, it probably won't work because the passwords are actually stored in the shadow file or in LDAP. I believe for Sol10, "getent passwd" will work, but won't return the password if it's in a shadow file. So you have to do something like this:
Code:
pwd=`getent passwd $USER | awk -F: '{ print $2 }'`
if [ "$pwd" = "x" ]; then
  # password is in shadow file: look there
  pwd=`awk -F: '$1 ~ /^'$USER'$/ { print $2 }'`
fi
echo $USER:$pwd

I don't know what happens if you query LDAP and the password is in a secure LDAP directory. I just don't know. In Linux, you get back a *.
# 4  
Old 12-15-2008
In Solaris, you can't do that, even if you try, might be with least success for the forth coming issues that you might come across or face.
# 5  
Old 12-15-2008
Quote:
Originally Posted by incredible
In Solaris, you can't do that, even if you try, might be with least success for the forth coming issues that you might come across or face.
Was that in response to me, Stevie or both?
# 6  
Old 12-15-2008
Quote:
Originally Posted by incredible
In Solaris, you can't do that, even if you try, might be with least success for the forth coming issues that you might come across or face.
Here is what I would do (based on the assumption that accounts won't be locked on first failed attempt) and is essentially the same method as Stevie used, but will work even in the event that the passwd command cannot be used.

1. Inform the users that you are going to perform a security audit of passwords.
2. Run a script that runs a login against each user attempting to use the username as a password, the result speaks for itself.

You will sacrifice a login attempt for each user, but you will have informed them all of this.

As for me, I have a security policy which requires that tools like JTR are used to identify weak passwords, so I don't do specific checks like this manually.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing Username & password through shell script to java code

Hi, I have a shell script (script.sh) in which we are calling java code which asks for Username: Password: for authentication purpose currently we are passing the credential manually and run the script. but I am trying echo -e "user_id\npassword" | script.sh but its not... (1 Reply)
Discussion started by: rakeshtomar82
1 Replies

2. Shell Programming and Scripting

How can i su automaticaly in same server with different username and same password?

Hi I am new to shell scripting, Can you please help me in writing a script that can switch user in same server with different user name and same password. I want to perform some functional task in a particular user and need to switch user and perform same activity in another user and so on ... ... (4 Replies)
Discussion started by: Dew
4 Replies

3. Red Hat

Need to crack username and password on laptop

I am not a computer geek but I recently was given a Dell Latitude c400 laptop which has Red Hat Linux 2.4.20-6 GRUB Version 0.93. First of all I have no clue how to even use this operating system and I was never given the username or password. Is there anyone out there who could possibly help me... (4 Replies)
Discussion started by: missfixit74
4 Replies

4. Shell Programming and Scripting

Check for Specific Username Password Expire

hey Guys, I haven't posted in a while, But you guys were really helpful alst time. I have had a issue with User Passwords expiring, and since I dont check /var/cron/log on the regular I never know these suers are expiring, making certain nightly jobs not run. With this script, I want to be... (14 Replies)
Discussion started by: gkelly1117
14 Replies

5. Solaris

Check Solaris Zones Processor & Memory allocations

Hi, I am a newbee in the solaris administration. My question is how to 1. Check the total CPU and memory of a global zone. 2. Check the allocated CPU and memory for each of the residing non-global zones. I have already tried prtconf which gives the following output /usr/sbin/prtconf... (4 Replies)
Discussion started by: poga
4 Replies

6. UNIX for Dummies Questions & Answers

How do you reset username/password

Picked up a 3b2 running System V. Works fine, but it requires a username and password. Is the username "root" or "sysadm"? How do I find out and how to I reset it or bypass it? Thanks. (2 Replies)
Discussion started by: TanRuNomad
2 Replies

7. Shell Programming and Scripting

Username and password

Hi I am new to using unix and am struggling with a script i am writing. What i am trying to do is get a user to enter a username, check the original file i created with username and pin to see if their is a corresponding entry. Next ask the user to enter the pin and see if this matches... (5 Replies)
Discussion started by: somersetdan
5 Replies

8. UNIX for Dummies Questions & Answers

How can i hide username/password

hi all, i run sqlplus command on unix(HP-UX) like "sqlplus username/password@serverA @deneme.sql" but when someone run "ps -ef | grep sqlplus", it can see my username and password :( How can i hide username and password. thanx. (1 Reply)
Discussion started by: temhem
1 Replies

9. Shell Programming and Scripting

username password in script

Can we write a script to telnet to a unix server from unix with the username and password hardcoded in the script?? something like ssh a@b -p password ??? (5 Replies)
Discussion started by: roshanjain2
5 Replies

10. UNIX for Advanced & Expert Users

setting username and password for ftp

hi, i have set up an FTP server in one of our systems. could some one tell me the procedure to set up the username and password for it to enable other users to access the server. thanks (1 Reply)
Discussion started by: div
1 Replies
Login or Register to Ask a Question