passwd from stdin

Rabbul Nawaz rabbul.nawaz at deeproot.co.in
Wed Nov 26 12:55:59 UTC 2008


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.




More information about the busybox mailing list