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
    667
    Thanks
    116
    Thanked 29 Times in 29 Posts
    Thumbs Up/Down
    Received: 100/1
    Given: 919/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: 75
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
    667
    Thanks
    116
    Thanked 29 Times in 29 Posts
    Thumbs Up/Down
    Received: 100/1
    Given: 919/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
    19
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Thumbs Up/Down
    Received: 10/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
    Dr. McKay
    Replies: 4 | Views: 712
    Last post by Dr. McKay, 06-19-2017, 06:20 AM
  2. djsmiley2k
    rad-jason
    Replies: 8 | Views: 290
    Last post by rad-jason, 06-24-2017, 03:25 AM
  3. Mujkanovic
    WHGBTom
    Replies: 10 | Views: 956
    Last post by WHGBTom, 07-23-2017, 07:34 AM
  4. radwebhosting
    radwebhosting
    Replies: 0 | Views: 154
    Last post by radwebhosting, 06-18-2017, 04:17 AM
  5. Dr. McKay
    HostBastic
    Replies: 6 | Views: 745
    Last post by HostBastic, 06-19-2017, 07:08 PM

Older Threads

  1. djsmiley2k
    VirtuBox
    Replies: 3 | Views: 766
    Last post by VirtuBox, 06-21-2017, 07:46 PM
  2. djsmiley2k
    VirtuBox
    Replies: 8 | Views: 790
    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: 605
    Last post by hostproton, 06-22-2017, 05:58 PM
  4. LeatherCrafting
    rankmyhub
    Replies: 14 | Views: 493
    Last post by rankmyhub, 07-28-2017, 10:42 AM
  5. Maxoq
    cyberpersons
    Replies: 2 | Views: 687
    Last post by cyberpersons, 06-17-2017, 09:56 AM

Latest Threads

  1. HostBastic
    HostBastic
    Replies: 0 | Views: 34
    Last post by HostBastic, Yesterday, 08:45 PM
  2. Server_Wala
    Server_Wala
    Replies: 0 | Views: 13
    Last post by Server_Wala, Yesterday, 12:12 PM
  3. David Beroff
    HostBastic
    Replies: 3 | Views: 51
    Last post by HostBastic, Yesterday, 10:01 PM
  4. exa-edward
    exa-edward
    Replies: 4 | Views: 162
    Last post by exa-edward, 08-21-2017, 09:55 AM
  5. JFSG
    JFSG
    Replies: 0 | Views: 39
    Last post by JFSG, 08-20-2017, 07:43 PM

Similar Threads

  1. Kaz Wolfe
    kevinhng86
    Replies: 3 | Views: 1010
    Last post by kevinhng86, 01-12-2017, 05:00 AM
  2. Gmeister4
    LJSHost
    Replies: 2 | Views: 672
    Last post by LJSHost, 08-26-2016, 08:59 AM
  3. Maxoq
    Luxin Host
    Replies: 2 | Views: 562
    Last post by Luxin Host, 07-01-2016, 12:31 PM
  4. Faaiza
    webdesign
    Replies: 5 | Views: 1781
    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: 2962
    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!