Changing Linux Users Password Through Web Interface.

By | November 15, 2014

‘ChangePassword’ is a web CGI utility that allows users to change their password through a web browser.

As of this writing, the  latest available version of ‘ChangePassword’ is changepassword-0.9. And this installation is tested on CentOS 6.5 minimal.

Please note that I am using apache web server with mod_cgi and mod_ssl enabled.

‘gcc’ and ‘make’ is needed to compile and install ‘ChangePassword’.

Install this with the following command:

[[email protected] ~]# yum -y install gcc make

Download the ‘ChangePassword’ tarball and extract it as follows

[[email protected] ~]#  cd /opt
[[email protected] opt]# wget
[[email protected] ~]# tar -xf changepassword-0.9.tar.gz

Now change into the ‘ChangePassword’ directory and then to ‘smbencrypt’. There is a compilation error with ‘libdes.a’. We will recompile it here.

[[email protected] ~]# cd changepassword-0.9/smbencrypt
[[email protected] smbencrypt]# tar -xzvf libdes-4.04b.tar.gz
[[email protected] smbencrypt]# cd des
[[email protected] des]# make
[[email protected] des]# cp libdes.a .. (Reply with y when it asks to overrite)
[[email protected] des]# cd ../..
[[email protected] changepassword-0.9]#

Please note that we had downloaded the ‘ChangePassword’ tarball and extracted it in /opt. So we have to update the same in the ‘conf.h’ file in the presently working directory. Find the line

'char TMPFILE[]="/tmp/changepassword-shadow-XXXXXX";'

and change it to

'char TMPFILE[]="/opt/changepassword-shadow-XXXXXX";'

using vi editor or any other editor of your choice.

Configure ChangePassword by pointing it to the default CentOS apache cgi directory and disabling samba and squid password change. If samba and squid password change is needed in your environment, the you have to update ‘conf.h’ file like this

'char TMPSMBFILE[]="/opt/changepassword-smb-XXXXXX";' 


 'char TMPSQUIDFILE[]="/opt/changepassword-squid-XXXXXX";'

In this example, i have disabled the samba and squid password change feature by passing the ‘disable’ option to the ‘configure’ script.

[[email protected] changepassword-0.9]#./configure -enable-cgidir=/var/www/cgi-bin/ -disable-smbpasswd -disable-squidpasswd
[[email protected] changepassword-0.9]# make
[[email protected] changepassword-0.9]# make install

Check for errors.

If everything goes fine you should be able to change user passwords with this url


Please replace ‘your-server-ip-address’ with required ip address of your server.

Thats it…!!!

8 thoughts on “Changing Linux Users Password Through Web Interface.

  1. Jagdish Dhongade

    configure but show url folllowing line

    SAMBA password file doesn’t exist!

    Please notify your system administrator.


  2. Jagdish Dhongade

    I want change squid password through web base
    squid password path is

    1. rudraraj Post author

      Hi Jagadish,
      I will have to check this. I had written this post almost one and a half year back. In the meantime if you are looking at a web based service management tool I would suggest looking at webmin.

  3. Jagdish Dhongade

    Thanks for replay me!
    currently I am using Webmin
    — Thanks

  4. praveen

    I tried it on RHEL 7.3 (Maipo). I’m able to build it succesfully though, when i try to change the user password it throws an error stating user not found .


    1. rudraraj Post author

      Hi Praveen,
      I have not tried this in RHEL 7.x. Not very sure though what might have transpired. But based on the error it looks like the username that you are trying to change passowrd for, does not exist. Or maybe there was a typographical error in the username.


Leave a Reply

Your email address will not be published. Required fields are marked *