passwd from stdin
Rabbul Nawaz
rabbul.nawaz at deeproot.co.in
Wed Nov 26 14:38:57 UTC 2008
On Wednesday 26 November 2008 19:04:07 Matthew Hiles wrote:
> Rabbul Nawaz wrote:
> > 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
>
> Perhaps I am missing something, but why can't you recompile busybox and
> just replace the busybox binary? The only thing you would have to do
> then is add a symlink to chpasswd.
>
> Sorry if I missed the requirement, I realize how frustrating it can be
> when people keep giving you solutions that are not for you problem.
>
> ~Matthew Hiles
Thank You, Your suggestion really worked. I copied the busybox binary after
the "make" and created the soft-link, and it worked perfectly.
More information about the busybox
mailing list