passwd from stdin

Cathey, Jim jcathey at ciena.com
Wed Nov 26 16:54:06 UTC 2008


It is also not uncommon for a rescue disk to
only allow the removal of passwords.  You then
get in with the system running normally and
recreate them.  That can be done with sed,
etc.  Once you're in as root, that is.

-- Jim



-----Original Message-----
From: busybox-bounces at busybox.net [mailto:busybox-bounces at busybox.net]
On Behalf Of Rabbul Nawaz
Sent: Wednesday, November 26, 2008 4:56 AM
To: Michael Abbott
Cc: busybox at busybox.net; Bernhard Reutner-Fischer
Subject: Re: passwd from stdin

On Wednesday 26 November 2008 17:35:17 Michael Abbott wrote:
> On Wed, 26 Nov 2008, Hinko Kocevar wrote:
> > Another approach would be to generate /etc/passwd for desired
> > username:password on your local host and deploy them on already
running
> > devices.
>
> I've had to do exactly this, and in case it's useful I attach the two
> scripts I created to do this:
> 	./useradd $rootfs -p $new-password $new-user
> adds the right entries to $rootfs/etc/passwd and $rootfs/etc/shadow,
> using the python script ./crypt as necessary to encode the password.
>
> (Sorry about the long CC list, the thread seems to be growing CCs!)

Thanks for the reply, but this is not going to help me, and I am still 
searching for the solution. I will explain You my exact requirement, so
that 
You can understand it better.
I am creating a Rescue mode option for "DeepOfix Mail Server" 
http://code.deeproot.in/deepofix . Now, when the user enters rescue
mode, I 
want to create a ncurses/dialog screen in which he can change the
password of 
that system. Now since the system is in Rescue mode, It lands in the
rootfs 
environment, which is the below link 
http://code.deeproot.in/deepofix/browser/trunk/var/rootfs
 It has a very minimal environment, and It runs only busy box commands.
Now, I 
cannot use the crypt file, which You have attached, as python is not 
installed in that. Even, the useradd script cannot be used as it will
not 
create the encrypted password to save them in the /etc/passwd file. 

I tried my best to explain my requirement. Can some one please suggest
the 
solution for this.

-Rabbul Nawaz KS.

_______________________________________________
busybox mailing list
busybox at busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox




More information about the busybox mailing list