How to password protect a file in Linux?

David Beroff

Well-known member
Joined
Jun 14, 2016
Messages
853
Best answers
0
Ratings
58
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
6
Points
0
#2

mobin

Well-known member
Joined
Jun 22, 2017
Messages
157
Best answers
0
Ratings
45 1
Points
28
#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!
 
Older Threads
Replies
3
Views
1,500
Replies
4
Views
803
Replies
17
Views
1,030
Replies
4
Views
1,631
Latest Threads
Replies
0
Views
20
  • Awaiting approval
Replies
0
Views
1
Replies
6
Views
59
Similar Threads
Replies
5
Views
80
Replies
6
Views
2,549
Replies
1
Views
1,287

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.