How to password protect a file in Linux?

David Beroff

Well-known member
Registered
Joined
Jun 14, 2016
Messages
1,488
Points
63
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
Hosting Provider
Registered
Joined
Jun 16, 2017
Messages
47
Points
8

mobin

Well-known member
Registered
Joined
Jun 22, 2017
Messages
234
Points
28
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!
 
Older Threads
Replies
3
Views
4,215
Replies
4
Views
3,554
Replies
17
Views
5,280
Replies
4
Views
4,036

Latest Hosting OffersNew Reviews

Sponsors

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.

Top