How to password protect a file in Linux?

David Beroff

Well-known member
Joined
Jun 14, 2016
Messages
802
Best answers
0
Ratings
46
Points
28
#1
I have a file login.php in public_html folder on my hosting but I don't see any option to set password for this file as password protect a folder I created with my hosting panel as following

password-protect-file.png

Is there a way to do this with command lines on Linux or via cPanel control panel?
 

m19

Member
Joined
Jun 16, 2017
Messages
47
Best answers
0
Ratings
5
Points
0
#2

mobin

Well-known member
Joined
Jun 22, 2017
Messages
97
Best answers
0
Ratings
11
Points
8
#4
If you are trying to keep the code in login.php secure and want to "password protect" it, I guess there's no solution or at least nothing I am aware of. There are many option you have to password protect a regular files in Linux [ Refer https://www.cyberciti.biz/tips/linux-or-unix-password-protecting-files.html for eg: ] but serving it via web is more tricky. If you just want to hide your code, use a PHP encoder like Ioncube or Zend..though not yet sure what exactly your requirement is!
 

Similar threads

Latest postsNew threads

Latest Hosting OffersNew Reviews

Web Hosting

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.