public inbox for gentoo-embedded@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-embedded] script that changes password for busybox
@ 2006-06-04 18:32 Natanael Copa
  2006-06-04 23:54 ` Kelly Price
  2006-06-05 14:28 ` Ned Ludd
  0 siblings, 2 replies; 8+ messages in thread
From: Natanael Copa @ 2006-06-04 18:32 UTC (permalink / raw
  To: gentoo-embedded

Hi!

I'm trying to port a LEAF bering based project to gentoo-embedded. There
is a web based UI (using haserl.sourceforge.net) to change password. The
code to change the root password looks something like this:

          newrootpw=$(crypt sN "$root1")
                awk '
                   BEGIN{
                        FS=":";
                        OFS=":";
                        }
                   /^root:/{
                        $2="'"$newrootpw"'";
                        }
                   {print;}
                ' /etc/shadow > /tmp/shadow

                mv /tmp/shadow /etc/shadow


The problem I have now is that I cannot find the crypt(1) command, nor a
replacement in portage tree. I wonder if anyone has a suggestion how to
change passwords from a (web) script? I'm using busybox/uclibc.

Thanks!

/natanael

-- 
gentoo-embedded@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-embedded] script that changes password for busybox
  2006-06-04 18:32 Natanael Copa
@ 2006-06-04 23:54 ` Kelly Price
  2006-06-05  7:41   ` Natanael Copa
  2006-06-05 14:28 ` Ned Ludd
  1 sibling, 1 reply; 8+ messages in thread
From: Kelly Price @ 2006-06-04 23:54 UTC (permalink / raw
  To: gentoo-embedded

Other than SSHing into the system, what programs need /etc/password?

On 6/4/06, Natanael Copa <natanael.copa@gmail.com> wrote:
> Hi!
>
> I'm trying to port a LEAF bering based project to gentoo-embedded. There
> is a web based UI (using haserl.sourceforge.net) to change password. The
> code to change the root password looks something like this:
>
>           newrootpw=$(crypt sN "$root1")
>                 awk '
>                    BEGIN{
>                         FS=":";
>                         OFS=":";
>                         }
>                    /^root:/{
>                         $2="'"$newrootpw"'";
>                         }
>                    {print;}
>                 ' /etc/shadow > /tmp/shadow
>
>                 mv /tmp/shadow /etc/shadow
>
>
> The problem I have now is that I cannot find the crypt(1) command, nor a
> replacement in portage tree. I wonder if anyone has a suggestion how to
> change passwords from a (web) script? I'm using busybox/uclibc.
>
> Thanks!
>
> /natanael
>
> --
> gentoo-embedded@gentoo.org mailing list
>
>


-- 
Kelly "STrRedWolf" Price
http://strredwolf.furrynet.com
-- 
gentoo-embedded@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-embedded] script that changes password for busybox
  2006-06-04 23:54 ` Kelly Price
@ 2006-06-05  7:41   ` Natanael Copa
  0 siblings, 0 replies; 8+ messages in thread
From: Natanael Copa @ 2006-06-05  7:41 UTC (permalink / raw
  To: gentoo-embedded

On Sun, 2006-06-04 at 19:54 -0400, Kelly Price wrote:
> On 6/4/06, Natanael Copa <natanael.copa@gmail.com> wrote:
> > The problem I have now is that I cannot find the crypt(1) command, nor a
> > replacement in portage tree. I wonder if anyone has a suggestion how to
> > change passwords from a (web) script? I'm using busybox/uclibc.

> Other than SSHing into the system, what programs need /etc/password?

login? In case you lose the network for some reason (a bad shorewall
change for example)

PS. I reformatted so its easier use the archives later.
http://en.wikipedia.org/wiki/Top-post

--
Natanael Copa

-- 
gentoo-embedded@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [gentoo-embedded] script that changes password for busybox
@ 2006-06-05 13:38 Morgan, Austin D.
  2006-06-05 14:26 ` Natanael Copa
  0 siblings, 1 reply; 8+ messages in thread
From: Morgan, Austin D. @ 2006-06-05 13:38 UTC (permalink / raw
  To: gentoo-embedded

have you looked into mcrypt?

Austin

-----Original Message-----
From: gentoo-embedded+bounces-871-AUSTIN.D.MORGAN=saic.com@gentoo.org on
behalf of Natanael Copa
Sent: Sun 6/4/2006 1:32 PM
To: gentoo-embedded@lists.gentoo.org
Subject: [gentoo-embedded] script that changes password for busybox
 
Hi!

I'm trying to port a LEAF bering based project to gentoo-embedded. There
is a web based UI (using haserl.sourceforge.net) to change password. The
code to change the root password looks something like this:

          newrootpw=$(crypt sN "$root1")
                awk '
                   BEGIN{
                        FS=":";
                        OFS=":";
                        }
                   /^root:/{
                        $2="'"$newrootpw"'";
                        }
                   {print;}
                ' /etc/shadow > /tmp/shadow

                mv /tmp/shadow /etc/shadow


The problem I have now is that I cannot find the crypt(1) command, nor a
replacement in portage tree. I wonder if anyone has a suggestion how to
change passwords from a (web) script? I'm using busybox/uclibc.

Thanks!

/natanael

-- 
gentoo-embedded@gentoo.org mailing list

-- 
gentoo-embedded@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [gentoo-embedded] script that changes password for busybox
  2006-06-05 13:38 [gentoo-embedded] script that changes password for busybox Morgan, Austin D.
@ 2006-06-05 14:26 ` Natanael Copa
  0 siblings, 0 replies; 8+ messages in thread
From: Natanael Copa @ 2006-06-05 14:26 UTC (permalink / raw
  To: gentoo-embedded

On Mon, 2006-06-05 at 06:38 -0700, Morgan, Austin D. wrote:
> have you looked into mcrypt?

yes but I cannot find out how to do this with mcrypt:

>           newrootpw=$(crypt sN "$root1")

--
Natanael Copa

-- 
gentoo-embedded@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-embedded] script that changes password for busybox
  2006-06-04 18:32 Natanael Copa
  2006-06-04 23:54 ` Kelly Price
@ 2006-06-05 14:28 ` Ned Ludd
  2006-06-05 14:45   ` Natanael Copa
  1 sibling, 1 reply; 8+ messages in thread
From: Ned Ludd @ 2006-06-05 14:28 UTC (permalink / raw
  To: gentoo-embedded

On Sun, 2006-06-04 at 20:32 +0200, Natanael Copa wrote:
> Hi!
> 
> I'm trying to port a LEAF bering based project to gentoo-embedded. There
> is a web based UI (using haserl.sourceforge.net) to change password. The
> code to change the root password looks something like this:
> 
>           newrootpw=$(crypt sN "$root1")
>                 awk '
>                    BEGIN{
>                         FS=":";
>                         OFS=":";
>                         }
>                    /^root:/{
>                         $2="'"$newrootpw"'";
>                         }
>                    {print;}
>                 ' /etc/shadow > /tmp/shadow
> 
>                 mv /tmp/shadow /etc/shadow


Despite all of the security problems with the above I think 
a ~20 line custom c program for this would be ideal.


-- 
Ned Ludd <solar@gentoo.org>
Gentoo Linux

-- 
gentoo-embedded@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-embedded] script that changes password for busybox
  2006-06-05 14:28 ` Ned Ludd
@ 2006-06-05 14:45   ` Natanael Copa
  2006-06-05 16:17     ` Ned Ludd
  0 siblings, 1 reply; 8+ messages in thread
From: Natanael Copa @ 2006-06-05 14:45 UTC (permalink / raw
  To: gentoo-embedded

On Mon, 2006-06-05 at 10:28 -0400, Ned Ludd wrote:
> On Sun, 2006-06-04 at 20:32 +0200, Natanael Copa wrote:
> > Hi!
> >
> > I'm trying to port a LEAF bering based project to gentoo-embedded. There
> > is a web based UI (using haserl.sourceforge.net) to change password. The
> > code to change the root password looks something like this:
> >
> >           newrootpw=$(crypt sN "$root1")
> >                 awk '
> >                    BEGIN{
> >                         FS=":";
> >                         OFS=":";
> >                         }
> >                    /^root:/{
> >                         $2="'"$newrootpw"'";
> >                         }
> >                    {print;}
> >                 ' /etc/shadow > /tmp/shadow
> >
> >                 mv /tmp/shadow /etc/shadow
> 
> 
> Despite all of the security problems with the above I think
> a ~20 line custom c program for this would be ideal.

I was hoping for a solution without any coding, but yes, I'll probably
end up with a custom c program. (I think somebody already did actually -
just to get going)

about the security problems, any suggestion how to change passwords
securely from web interface? (https)

--
Natanael Copa

-- 
gentoo-embedded@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-embedded] script that changes password for busybox
  2006-06-05 14:45   ` Natanael Copa
@ 2006-06-05 16:17     ` Ned Ludd
  0 siblings, 0 replies; 8+ messages in thread
From: Ned Ludd @ 2006-06-05 16:17 UTC (permalink / raw
  To: gentoo-embedded

On Mon, 2006-06-05 at 16:45 +0200, Natanael Copa wrote:
> On Mon, 2006-06-05 at 10:28 -0400, Ned Ludd wrote:
> > On Sun, 2006-06-04 at 20:32 +0200, Natanael Copa wrote:
> > > Hi!
> > >
> > > I'm trying to port a LEAF bering based project to gentoo-embedded. There
> > > is a web based UI (using haserl.sourceforge.net) to change password. The
> > > code to change the root password looks something like this:
> > >
> > >           newrootpw=$(crypt sN "$root1")
> > >                 awk '
> > >                    BEGIN{
> > >                         FS=":";
> > >                         OFS=":";
> > >                         }
> > >                    /^root:/{
> > >                         $2="'"$newrootpw"'";
> > >                         }
> > >                    {print;}
> > >                 ' /etc/shadow > /tmp/shadow
> > >
> > >                 mv /tmp/shadow /etc/shadow
> > 
> > 
> > Despite all of the security problems with the above I think
> > a ~20 line custom c program for this would be ideal.
> 
> I was hoping for a solution without any coding, but yes, I'll probably
> end up with a custom c program. (I think somebody already did actually -
> just to get going)

the vchangepw util might be able to work on system auth.

> about the security problems, any suggestion how to change passwords
> securely from web interface? (https)

I have no idea what auth system you are using so it's hard to say.

But clearly the problem with the above awk script other than the
obvious /tmp race condition is that it would leave the shadow 
file as mode 644 vs 600

> --
> Natanael Copa
> 
-- 
Ned Ludd <solar@gentoo.org>
Gentoo Linux

-- 
gentoo-embedded@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-06-05 16:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-05 13:38 [gentoo-embedded] script that changes password for busybox Morgan, Austin D.
2006-06-05 14:26 ` Natanael Copa
  -- strict thread matches above, loose matches on Subject: below --
2006-06-04 18:32 Natanael Copa
2006-06-04 23:54 ` Kelly Price
2006-06-05  7:41   ` Natanael Copa
2006-06-05 14:28 ` Ned Ludd
2006-06-05 14:45   ` Natanael Copa
2006-06-05 16:17     ` Ned Ludd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox