- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: password validation
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2004 09:22 AM
04-27-2004 09:22 AM
Any help is greatly appreciated
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2004 09:45 AM
04-27-2004 09:45 AM
Re: password validation
-Hazem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2004 09:58 AM
04-27-2004 09:58 AM
Re: password validation
is there any other way ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2004 10:05 AM
04-27-2004 10:05 AM
SolutionIf you wantr to do this in a scripting language the answer is Perl. Note that the UNIX crypt function is actually a hash so that the process is not reversible. The idea is that you pass in the plaintext passwd as the first argument to crypt and the first two characters (the salt) of the stored passwd hash to the crypt function to produce a new hash. If this hash is identical to the original hash, the passwd's match. Perl's crypt function automatically ignore anything pass the first 2 characters for the salt argument. Man perlfunc and look at the crypt function for more details.
Attached is a 3 minute example. It returns 0 for ok and non-zero for anything else.
pwtest.pl
STAT=${?}
if [[ ${STAT} -eq 0 ]]
then
echo "All ok"
else
echo "You be bad"
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2004 10:16 AM
04-27-2004 10:16 AM
Re: password validation
In this case here a shell script part, which could solve it:
USER=$(who am i) # should return the real logged in user / not sure if you need to i.e. cut -c1-8
su bin -c "su $user -c \"true\"" ; OK=$?
# as bin the user HAS to enter the password
if [ "$OK" != 0 ]
then
# su failed
echo "Errormessage"
exit 1
fi
# rest of your script
$(logname) can work instead to $(who am i) as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2004 10:35 AM
04-27-2004 10:35 AM
Re: password validation
pwtest.pl did the trick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2004 07:09 PM
04-27-2004 07:09 PM
Re: password validation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2004 06:51 AM
04-29-2004 06:51 AM
Re: password validation
pwtest.pl is in /usr/contrib/bin as follows :
[/home/mortaluser]$ ll /usr/contrib/bin/pwtest.pl
-rws--x--x 1 root sys 498 Apr 28 11:27 /usr/contrib/bin/pwtest.pl
[/home/mortaluser]$ /usr/contrib/bin/pwtest.pl
YOU HAVEN'T DISABLED SET-ID SCRIPTS IN THE KERNEL YET!
FIX YOUR KERNEL, PUT A C WRAPPER AROUND THIS SCRIPT, OR USE -u AND UNDUMP!
I hopelessly tried to put a shell script like the one below, placed in the same /usr/contrib/bin directory:
[/home/mortaluser]$ cat /usr/contrib/bin/pwtest_wrapper.sh
#!/usr/bin/ksh
#file: pwtest_wrapper.sh
/usr/contrib/bin/pwtest.pl
result=`echo $?`
echo " "
if [ $result -eq 0 ]
then
echo "user validated OK!"
else
echo "user credentials NO GOOD!"
fi
[/home/mortaluser]$ ll /usr/contrib/bin/pwtest_wrapper.sh
-rws--x--x 1 root sys 163 Apr 29 08:38 /usr/contrib/bin/pwtest_wrapper.sh
[/home/mortaluser]$ /usr/contrib/bin/pwtest_wrapper.sh
YOU HAVEN'T DISABLED SET-ID SCRIPTS IN THE KERNEL YET!
FIX YOUR KERNEL, PUT A C WRAPPER AROUND THIS SCRIPT, OR USE -u AND UNDUMP!
I have no clue what this means or how to work around it. Again any help is greatly appreciated in advance.
Also, I will not be able to recompile perl and wreak havoc on already running applications dependent on perl as a side note.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2004 06:52 AM
04-29-2004 06:52 AM
Re: password validation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2004 07:00 AM
04-29-2004 07:00 AM
Re: password validation
I really wish that this feature was not supported in the Shell because it is a glaring security hole.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2004 07:14 AM
04-29-2004 07:14 AM
Re: password validation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2004 07:21 AM
04-29-2004 07:21 AM