RE: [PHP] Interactive Commands

From: Date: Thu, 26 Oct 2000 03:13:27 +0000
Subject: RE: [PHP] Interactive Commands
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-22027@lists.php.net to get a copy of this message
1. build a new php binary, have root and only root own it. 2. if you want, setup a new extension in apache to parse php documents using the new binary 3. write a few test scripts, make sure it works 4. to change your password: <?php system("echo '$new_passwd' | passwd $username --stdin"); ?> works here marco -----Original Message----- From: Mukul Sabharwal [mailto:mukulsabharwal@yahoo.com] Sent: Monday, October 23, 2000 7:26 PM To: szii@sziisoft.com; pour@mieterra.com; joe@conway-family.com; php-general@lists.php.net Subject: Re: [PHP] Interactive Commands Hi, Well... I telnet(ed) into my account.... as per replies.... i tried chpasswd... not a valid function.. passwd oldpass newpass verify also doesn't work, for the simple reason that \n needs to be there.... but i can't seem to get it right..... what's a TTY ? http://www.plesk.com ... Plesk does almost what I want to do .. changing passwords, etc. though you need to have control over the server in that case...but what if i am the root.... how do i change the password... which is just an example... how do i make it more interactive ? thanks. > You may need to use special tricks to change > passwords. Many password > programs do not work if stdin is not a TTY (so you > can't "echo" or pipe > data into the program). This is considered a > security feature. --- Szii <szii@sziisoft.com> wrote: > Because the first is a separate process, you're > going to have a > difficult time with this. > > Under Un*x, you can "echo oldpass\nnewpass\n | > passwd" > and it'll work. =) Whatever happens, once you > launch your > new process, then you're not using passthru anymore, > but > need something more "inter-process." The Un*x > "pipe" > works well for this. For more complex things, I'd > write a > quick shell script/C program to do the passwd call > and > put parameters off of it. > > ie, passthru(chpasswd old new verify) > > 'Luck! > > -Szii > > At 10:22 PM 10/22/00 -0700, Mukul Sabharwal wrote: > >Hi, > > > >I was recently doing useless stuff with System(), > >Exec(), Passthru, etc... and was wondering if i > could > >change my password using this : > > > >I tried : > > > >echo "<pre>"; > > > >passthru("whois devhome.net"); > > > >echo </pre>"; > > > >this works fine, but i can't seem to get this right > : > > > >echo "<pre>"; > > > >passthru("passwd\noldpass\nnewpass\nnewspass"); > > > >echo "</pre>"; > > > >why doesn't this work, i'm not very familiar with > how > >to do interactive stuff... and how can i read the > >output and on that basis make my decision.... maybe > if > >it says password too easy... but still i'll keep on > >doing that... > > > >thanks. > > > >===== > >To Find Out More About Me : http://mukul.tsx.org/ > > > >__________________________________________________ > >Do You Yahoo!? > >Yahoo! Messenger - Talk while you surf! It's FREE. > >http://im.yahoo.com/ > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: > php-general-unsubscribe@lists.php.net > >For additional commands, e-mail: > php-general-help@lists.php.net > >To contact the list administrators, e-mail: > php-list-admin@lists.php.net > > ===== To Find Out More About Me : http://mukul.tsx.org/ __________________________________________________ Do You Yahoo!? Yahoo! Messenger - Talk while you surf! It's FREE. http://im.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#22027) next »