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:

[root@www ~]# yum -y install gcc make

Download the ‘ChangePassword’ tarball and extract it as follows

[root@www ~]#  cd /opt
[root@www opt]# wget
[root@www ~]# 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.

[root@www ~]# cd changepassword-0.9/smbencrypt
[root@www smbencrypt]# tar -xzvf libdes-4.04b.tar.gz
[root@www smbencrypt]# cd des
[root@www des]# make
[root@www des]# cp libdes.a .. (Reply with y when it asks to overrite)
[root@www des]# cd ../..
[root@www 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.

[root@www changepassword-0.9]#./configure -enable-cgidir=/var/www/cgi-bin/ -disable-smbpasswd -disable-squidpasswd
[root@www changepassword-0.9]# make
[root@www 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…!!!

9 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.

    2. Jürgen Heisel

      i’m using CentOS Linux release 7.5.1804 and got smbuser not found error.
      The solution was :
      ./configure -enable-cgidir=/var/www/cgi-bin/ –enable-smbpasswd=/etc/samba/smbpasswd -disable-squidpasswd



Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.