September 27

0 comments

how to add additional admin users in oscommerce with htpasswd

By Christopher Mendla

September 27, 2007

Cpanel

Last Updated on December 4, 2019 by Christopher G Mendla

NOTE – there is some risk to the procedure outlined here. Use at your own risk….

We needed to allow access to an oscommerce site so that a vendor could install a contribution. The FTP part was easy, just set up an FTP user for them and then delete the user when the job is done. The hard part was allowing access to the oscommerce admin panel. The user id and password for that wass the same as the cpanel access. Changing the cpanel user id would block access to the oscommerce admin panel. We didn’t want to give the vendor the cpanel and oscommerce access permanently.

The solution turned out to be a file called .htpasswd. The idea is that you can add users to that file which will then allow them access to protected areas such as the admin panel for oscommerce.

  1. find and edit your passwd file. You will have to look above your public_html folder or it’s equivalent. it will be in a folder such as .htpasswds/admin (make a copy if possible. Note you may revoke your own access if you are not careful. Be sure EVERYTHING is backed up)
  2. Find an online hpassword generator . This will take the user id and password you are setting and create a hashed password. It appears that different sites create different hashes but they seem to work even with the differences
  3. Copy the resulting line from the htpassword generator and add it to the passwd file
    Be VERY careful editing that file.
  4. Test the access to the password protected area such as the oscommerce admin panel. Be sure that the new password is actually working and not your old password (ie close your browsers and start a new browser window.
  5. Test the user id and password with a totally bogus combo just to make sure you are still protected.

When you want to revoke access for that user, you can just go in and edit the passwd file and delete the appropriate line.

We investigated this due to our needs for an oscommerce site. This will probably work for control panels other than cpanel and should work on most linux/unix hosting.

Christopher Mendla

About the author

Leave a Reply

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

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}