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 http://prdownloads.sourceforge.net/changepassword/changepassword-0.9.tar.gz
[[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";' 

and

 '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

https://your-server-ip-address/cgi-bin/changepassword.cgi

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

    Thanks
    configure but show url folllowing line

    SAMBA password file doesn’t exist!

    Please notify your system administrator.

    changepassword-0.9

    Reply
  2. Jagdish Dhongade

    I want change squid password through web base
    squid password path is
    /etc/squid3/password

    Reply
    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. http://www.webmin.com/index.html

      Reply
  3. Jagdish Dhongade

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

    Reply
  4. praveen

    Hi,
    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 .

    Praveen

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

      Reply

Leave a Reply

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