Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
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 have a question for anyone out there who might be familiar with the command line.
I am designing a web application (in PHP) which will get a user's name and password, then change to a new password that the user requests.
However, I've run into a few small snags.
At first, I was going to just attempt to open an ssh session from php using the shell_exec() command (which lets a command line program to be run) and see if the session opens properly. But, as many will be quick to realize, there's no actual way to pass the user's password in a command line statement with ssh.
Then, my next thought was to log in to the local machine through ssh as root, and have a shell script automatically run that would confirm the user really gave me the right password. (I can log into root using a pub/priv key setup) However, I can't seem to find a method for checking whether or not the user gave me the correct password, seems like the applications passwd and chpasswd only let me change the password.
I looked into writing a script that would use "expect", but I don't have access to Tcl on this system, so expect isn't a possibilty.
I was just wandering how a program that is running as nobody is going to read /etc/shadow. It would need to use something like PAM, right? There is a binary that does that. It is somewhere in /usr/local/bin or /usr/bin. It's the same route that screensaver take to verify the passwords.
PAM is a good thought, but I managed to come up with a way for 'nobody' to ssh to localhost through a pub/priv key scheme, then run the chpasswd command from there. It's made so that only the php process can have access to the private key.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.