Web Hosting Forum Login
Not a member yet? Sign up

How to password protect a file in Linux?

  • FORUMS
  • WEB DESIGN
  • WEB HOSTING OFFERS
  • ADVERTISING
  • WEB HOSTING
  • REQUEST A HOST
  • BEST WEB HOSTING
  • QUICK MENU
  • REGISTER HERE - Join us for FREE
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2016
    Posts
    696
    Thanks
    118
    Thanked 30 Times in 30 Posts
    Thumbs Up/Down
    Received: 103/1
    Given: 947/1

    How to password protect a file in Linux?

    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

    Name:  password-protect-file.png
Views: 89
Size:  44.0 KB

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

  2. #2
    Join Date
    Jun 2017
    Location
    Mars
    Posts
    47
    Thanks
    0
    Thanked 5 Times in 3 Posts
    Thumbs Up/Down
    Received: 19/0
    Given: 6/0
    If you are using cPanel, this article might be useful: https://documentation.cpanel.net/display/1152Docs/Password+Protect+Directories

  3. #3
    Join Date
    Jun 2016
    Posts
    696
    Thanks
    118
    Thanked 30 Times in 30 Posts
    Thumbs Up/Down
    Received: 103/1
    Given: 947/1
    Quote Originally Posted by m19 View Post
    If you are using cPanel, this article might be useful
    Already known about this and I am needing a fast tip to secure a file by password using htacess, not a folder in Linux.

  4. #4
    Join Date
    Jun 2017
    Posts
    64
    Thanks
    0
    Thanked 6 Times in 6 Posts
    Thumbs Up/Down
    Received: 22/0
    Given: 0/0
    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!

Newer Threads

  1. DaRecordon
    vinvill
    Replies: 5 | Views: 2103
    Last post by vinvill, 11-14-2017, 01:08 PM
  2. djsmiley2k
    igiboy
    Replies: 9 | Views: 450
    Last post by igiboy, 10-12-2017, 04:46 AM
  3. Mujkanovic
    portuguesedude
    Replies: 12 | Views: 1448
    Last post by portuguesedude, 11-05-2017, 09:25 PM
  4. radwebhosting
    radwebhosting
    Replies: 0 | Views: 232
    Last post by radwebhosting, 06-18-2017, 04:17 AM
  5. Dr. McKay
    HostBastic
    Replies: 6 | Views: 938
    Last post by HostBastic, 06-19-2017, 07:08 PM

Older Threads

  1. djsmiley2k
    VirtuBox
    Replies: 3 | Views: 1365
    Last post by VirtuBox, 06-21-2017, 07:46 PM
  2. djsmiley2k
    VirtuBox
    Replies: 8 | Views: 1926
    Last post by VirtuBox, 06-25-2017, 10:01 AM
  3. Cheerag Nundlall
    What is a hosting experience?
    By Cheerag Nundlall in forum Web Hosting
    hostproton
    Replies: 4 | Views: 677
    Last post by hostproton, 06-22-2017, 05:58 PM
  4. LeatherCrafting
    WebHostingUK
    Replies: 15 | Views: 723
    Last post by WebHostingUK, 12-08-2017, 04:38 PM
  5. Maxoq
    cyberpersons
    Replies: 2 | Views: 1423
    Last post by cyberpersons, 06-17-2017, 09:56 AM

Latest Threads

  1. mobin
    mobin
    Replies: 0 | Views: 19
    Last post by mobin, Today, 02:50 PM
  2. marblank1313
    24x7serverman
    Replies: 2 | Views: 26
    Last post by 24x7serverman, Today, 12:55 PM
  3. JFSG
    JFSG
    Replies: 0 | Views: 39
    Last post by JFSG, Yesterday, 04:32 PM
  4. JFSG
    JFSG
    Replies: 0 | Views: 40
    Last post by JFSG, Yesterday, 04:31 PM
  5. JFSG
    JFSG
    Replies: 0 | Views: 42
    Last post by JFSG, Yesterday, 04:29 PM

Similar Threads

  1. Kaz Wolfe
    kevinhng86
    Replies: 3 | Views: 1162
    Last post by kevinhng86, 01-12-2017, 05:00 AM
  2. Gmeister4
    LJSHost
    Replies: 2 | Views: 725
    Last post by LJSHost, 08-26-2016, 08:59 AM
  3. Maxoq
    Luxin Host
    Replies: 2 | Views: 611
    Last post by Luxin Host, 07-01-2016, 12:31 PM
  4. Faaiza
    webdesign
    Replies: 5 | Views: 1850
    Last post by webdesign, 01-30-2015, 03:24 AM
  5. giulio_74
    Protect a folder
    By giulio_74 in forum Web Programming
    Matt
    Replies: 9 | Views: 3024
    Last post by Matt, 10-06-2013, 01:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Web Hosting Forum

ForumWeb.Hosting is a web hosting forum where you’ll find in-depth discussions and resources to help you find the best hosting providers for your websites or how to manage your hosting whether you are new or experienced. You’ll find it all here. With topics ranging from web hosting, internet marketing, search engine optimization, social networking, make money online, affiliate marketing as well as hands-on technical support for web design, programming and more. We are a growing community of like-minded people that is keen to help and support each other with ambitions and online endeavors. Learn and grow, make friends and contacts for life.

Community

The world's smartest hosting providers come here to discuss & share what's trending in the web hosting world!
Copyright ©2017, ForumWeb.Hosting. All rights reserved. Web Hosting Forum for webmasters, web hosting providers, designers and web developers.

Welcome to Forum Web Hosting

The World's Number 1 Web Hosting Community, Reviews & Services

Log in!

Continue with Facebook
Continue With Email. By signing up you indicate that you have read and agree to the Terms of Service and Privacy Policy.

Sign in Manually

Need an account? Sign up now!