Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I need to automate some commands in my linux box. Primarily the htpasswd command for mini_httpd. I was wondering if there was a way to pass human interaction aurguments via some command operator....
The command I want to automate is
:#htpasswd .htpasswd (password file) admin (user) New password for admin: Type password here Retype password for admin Type password here
Does the mini_httpd version of htpassswd so anything different from that of apache? You could also write a simple perl script to do the encryption if you have perl installed.
i do have perl installed, but unfortunatly im developing on a system of a different arch than the target, so i only have the main perl binary with nothing else. the perl binary i jacked off of the net and it was all i could find. (its a uclibc system if you're curious) so if you know of way of scripting it with the basic perl installed you would be gold!
So i figured out what to do! if anyone for whatever reason is ever in the same situation as I, then here it is
In the htpasswd.c file of the mini_httpd source there is an if statement telling the session to prompt for a password and then to get the user to retype the password. Comment out the lines pertaining to retyping the password (which is done by puting a // in front of everyline) then recompile the program and issue the command:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.