Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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 created a password file for use with ncsa_auth in squid.
Firstly, is there a way to view the passwords in the file or are they all encrypted?
Secondly, is there a way to get squid to reauthenticate the user after 24 hours?
I can't speak for your particular password file. But the passwords in pwfiles are usually hashed. It's a one way encryption. You can't get the password by knowing the hash, you can only get the hash by knowing the password.
I can't speak for your particular password file. But the passwords in pwfiles are usually hashed. It's a one way encryption. You can't get the password by knowing the hash, you can only get the hash by knowing the password.
So, if you forget the password in that file for a login, what can you do? Only reset it? You can never view it?
How can you delete users from password files? Is it a simple case of using the vi editor? This is a htpasswd file for use with squid and ncsa_authentication.
So, if you forget the password in that file for a login, what can you do? Only reset it? You can never view it?
Yes, if you forget the password you can only reset it. If you REALLY want to retrieve the password if you forget it, you can write a wrapper for htpasswd (I think that's the name of the command, for apache at least). The wrapper will read the password from STDIN, pass it to htpasswd as normal, but also store it somewhere else - in plain text or some sort of encrypted format of your choosing.
Quote:
Originally Posted by qwertyjjj
How can you delete users from password files? Is it a simple case of using the vi editor? This is a htpasswd file for use with squid and ncsa_authentication.
I think there are some commands for this, but you can also remove users from the file manually.
Quote:
Originally Posted by repo
userdel or deluser
These are for system users. I don't think they are the are the commands to do what he wants.
Can htpasswd be issued by php?
ie users can reset their passwords if needed through a php script changing the value in a passwd file currently edited by:
So long as its running as the owner of the file, probably apache. Note that you may have privileges issues as apache drops privs on the child processes that do all the work.
Have a good read of the Apache site I referenced.
So long as its running as the owner of the file, probably apache. Note that you may have privileges issues as apache drops privs on the child processes that do all the work.
Have a good read of the Apache site I referenced.
ok - will do.
But does it have to be issued through php using the system command or can you just edit using other methods?
Well, you can get Apache to call a prog in any lang if you set up the cfg correctly ... and most lngs will have more than one way of calling an external prog like htpasswd.
eg in Perl you have
system()
`xxx` (backquotes)
qx(blah) (similar to back quotes)
and so on. I'm fairly sure php has more than one method, but I'm not a php guy.
PHP manual: http://www.php.net/manual/en/
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.