![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| "find command" to find the files in the current directories but not in the "subdir" | swamymns | Shell Programming and Scripting | 9 | 07-22-2008 11:23 AM |
| sendmail "root... User address required." error | csgonan | SUN Solaris | 10 | 04-03-2008 09:57 AM |
| Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" | Lokesha | UNIX for Dummies Questions & Answers | 4 | 12-20-2007 01:52 AM |
| bash: cd command to access "strange" directories | robotronic | Shell Programming and Scripting | 3 | 07-06-2007 04:35 PM |
| how to access computer behind cable modem, from outside,across "the Internet" | R00tSc0rpi0n | Security | 2 | 10-27-2006 02:27 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||||
|
Hmm, not sure if this will help or not. Basically, yes, you can 'request' the username and password and compare with what is on the system. Can you then change files owned by root? Probably. More difficult than I would want to think about.
Unless you are doing this for your own interest (or your company doesn't allow 3rd party software) might one suggest some software: CFengine If that isn't what you are looking for, then maybe Webmin I'm sure other will have other software they use and prefer. I've seen both of these but don't use them. The following can take the input of a password and check it against info in the shadow file by sending the userid in the first parameter and the password in the second. Code:
#!/usr/bin/perl
#
# Grab the user's old password from /etc/shadow and compare to sent
# old password from web page - send back error if not the same
#
# HOG 04/25/02 Another wonderful product from the warped mind of me
# ====================================================================
# Set up variables ------------
$user = "$ARGV[0]";
$oldpass = "$ARGV[1]";
$datenow = "`date '+%h %d %T'`";
#
$userinfo = `/usr/bin/grep $user /etc/shadow`;
($user1, $passwd1, $passextra) = split(/:/, $userinfo, 3);
$salt = substr($passwd1,0,2);
#
# Put testing junk here (print variables)
#
if (crypt($oldpass, $salt) ne $passwd1) {
# =========== FAILED - write to messages file - return error =========
system("/usr/bin/echo \"$datenow progserver chgpwd: ERROR changing $user
password on check\" >> /var/adm/messages");
die "";
}
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|