LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to change password (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-change-password-4175521017/)

cli 10-04-2014 02:05 AM

how to change password
 
Hi All,
We have a sftp server, and both ftp and sftp is working fine. All sftp user's login shell is set to /sbin/nologin by which they can login only through ftp clients/commands(sftp, lftp, filezilla & browsers etc) to only their home directory. Now if we implement password aging poicy to the sftp users then will they be able to reset their password themself during before their password expiry?
For that we don't want to change the user's login shell to /bin/sh or /bin/bash to achieve the same with "passwd username" command instead is it possible to change the system user's password with any perl, python or php scripts. If yes I am requesting to provide the links to download such scripts if any.

pan64 10-04-2014 08:39 AM

if a user is not allowed to login, he/she will not be able to change his/her own password. Are those users local to that sftp server?

cli 10-04-2014 08:54 AM

Yes, all users are system(/etc/passwd) users and all can login only with browser/ftp/sftp clients but not through ssh. So it is much appreciated to introduce such scripts which can change the password via browser to exectute "passwd username" command or similar(chpasswd etc) command.

cli 10-07-2014 10:34 AM

Can anybody please help?

pan64 10-07-2014 11:50 AM

just again, only logged in users can modify password. Therefore you need to allow them to login (either with ssh or ??) to be able to execute the command passwd. The other solution could be to do it as root. But giving root access to the normal users is not safe. Executing such commands via browser is unsafe again, and not recommended.
I would suggest you to use global accounts ...

cli 10-09-2014 10:07 AM

Ok, Thanks for the clarification.


All times are GMT -5. The time now is 09:04 PM.