How to put a password on a folder on a Windows computer without and with programs. Locking folders with Anvide Lock Folder utility

There are situations when the website you make should not be public, but is used as a kind of service for a limited circle of people. You can, of course, block authentication via PHP, but there is an almost elementary way - close the folder on the site using Apache. For example, using files .htaccess And .htpasswd. This is what we will talk about now.

Create a .htpasswd file with passwords

In order to set a password, first we must generate a file .htpasswd. This is done using the htpasswd utility, which exists in versions for both Linux and Windows.

htpasswd -c .htpasswd admin

Key -With indicates what needs to be created new file with passwords. .htpasswd- name of the generated file. admin– login of the user who will be allowed access to the restricted part of the site. After running the utility with all the necessary parameters, you will be asked to enter your password and repeat it. If you have already created a .htaccess file and you want to add a new user to it, simply run the utility by specifying a file with passwords without a key –c.

The created file is text and contains the user login and password hash, which are separated by a colon. By default, the hashing algorithm is DES. But you can change it and use the MD5 algorithm with a key –m, But the best option using the SHA algorithm( switch -s).

Protecting your site using .htaccess

So, the file is created, then we add to root directory website file.htaccess or add to an existing one following lines:


# Close access to the .htaccess file
Order allow,deny
Deny from all
Satisfy All

# Specify the location of the .htpasswd file, enable authentication
AuthUserFile /etc/apache2/passwd/.htpasswd
AuthName "Password Protected Area"
AuthType Basic
Require valid-user

Parameter AuthUserFile points to absolute path to file .htpasswd. For some reason unknown to me, in many manuals that I have seen, the password file is for some reason stored in the user’s home directory. I would not recommend storing this file in your home directory, much less in the root directory of the site.

After creating the file and placing the file .htaccess in the root of the site, it would be a good idea to restart the apache process.

I would also like to draw your attention to the fact that it would be a good idea to close the site from indexing search engines. To do this, create a file in the root directory of the site robots.txt with the following content:


User-agent: *
Disallow: /

On this I think we can end this post. If you have any other questions on the topic, I’m waiting for them in the comments.

Category,

I've heard rumors that WordPress is far from a security ideal. Although updates come out quite often, they still manage to sneak into the system. But judging by the fact that official plugin"jetpack" from WordPress stated that in 2 days from the moment of its installation they tried to break me 32 times, so I decided to play it safe.

Honestly, I have no idea how WordPress works and in the article " Links and article revisions in WordPress"I already mentioned that I usually work with 1C-Bitrix. Therefore, I chose the most reliable method- set a password on the main management files/folders that can be penetrated. I considered that such particularly vulnerable files include wp-login.php and folder /wp-admin/.

When closing a file/folder with a password, you need to perform two actions: create a file with a login-password, indicate which folders need to be closed. On Linux, to create a password file you need to use the command

htpasswd -c /etc/htpasswd/site/.htpasswd user_name

Explanation in order:

  • The "-c" switch means creating a file if it does not exist. The meaning of all parameters can be found in the htpasswd documentation
  • Pay attention to the directory for storing the file: "/etc/htpasswd/site/.htpasswd". It is located far from the site, so getting the file and guessing the password will be extremely difficult. You should not put the file with the password in root folder site.
  • “user_name” must be replaced with a login (I think you shouldn’t put your login here from logging into the administrative part of WordPress - it’s better to come up with another one).
  • After entering the command you will be asked to set a password and confirm

Now all that remains is to indicate which folders and files we want to protect with this password. We write the following lines at the end of the .htaccess file (in the root of the site):

wp-login.php" >
AuthUserFile /etc/htpasswd/site/.htpasswd
AuthName "Authentication Required"
AuthType Basic
Require valid-user

This file is located separately from the admin panel. Therefore, it must be protected individually, via .htaccess in the root folder of the site. Now in more detail what is written here:

  • Inside ... "> write which file/folder the rule will apply to
  • AuthUserFile - path to the file where the password that was created earlier is stored
  • AuthName "..." - text on the sign that the user will see asking him to log in
  • AuthType Basic - authentication type. For simple authentication the value is: Basic
  • Require valid-user - allows access to all verified users

Try running your browser in incognito mode and loading the site page /wp-login.php. If you see a requirement for authorization, then everything has been done correctly.

The question of how to put a password on a folder in Windows arises at a time when information appears on your computer that is not for everyone. It doesn’t matter what it will be - secret documents that should be hidden from competitors and employees, or materials that should not be shown to children - the methods of concealment are the same.

In the article I will look at six ways to block directories, one of which is based on operating system capabilities that not everyone knows about, the rest work using programs:

How to set a password using Windows

There is a widespread opinion on the Internet that it is impossible to set a password for a directory without programs using the standard capabilities of the operating system - this is a misconception caused by the fact that computer literacy users and many “woe bloggers” are at a low level.

In terms of safety, each a new version Windows is better than the previous one, you need to learn how to use these features.

Folder password protection is based on user accounts. In order to close a directory with a secret key, you must do the following:

  1. Create separate accounts for yourself and for other users. By default, only your administrator account, created when installing the operating system, is valid.
  2. Set a password for your account.
  3. Indicate which documents and directories are shared and which are only accessible certain users. To access such objects, everyone except you will need a password.

As a result, access to your personal data will require access to account administrator. The rest of the information on the computer (general) will be available to everyone.

Now let's look at how to install and configure all this in detail.

Create a shared account

  1. Go to “Start” -> “Control Panel” ->

  1. Select the “Create an account” item. Come up with a name there, if there are any specific users, then you can make them by name (wife/husband, children), or something general, like “Regular User”.

From now on, you will have an administrator - this is you, and everyone else is other accounts.

Put an access code on your account

To begin with, select yourself from the list of users. After you have created an additional account, you will have several users (minimum 2). If you forgot how to get to this choice, then again “Start” -> “Control Panel” -> “Adding and removing user accounts”

Then click on the “Create a password” link and set it. There will be an opportunity to add a hint; if your password is complex, I recommend doing it so as not to forget and not block your access to your own computer.

From this moment on, the administrator functions will be available only to you, everyone else will lose them, but they can use the machine, including all its folders and files, except for those that we will prohibit later.

Lock the folder with a password

User accounts belong to different groups, you are the administrator, the rest are users. In order to put limited access To certain folders It is enough to remove the read permission for these folders for all users and leave it to the administrator (you).

This is done as follows:

  1. Click the edit button on the desired folder and select “Properties”;
  2. Open the “Security” tab (this tab contains the rights of all groups and users in relation to this folder);
  3. Under the list of groups, click the “Change” button;
  4. Selecting groups and users one by one (usually these are the “Users” and “Verified Users” groups), check the prohibited boxes next to changing, reading, reading and executing, the list of folder contents (total).

Application changes made will automatically deny access to this folder to all unauthorized persons. To gain access, they will need the password of the account that is allowed access.

Closing an archive with a folder with a password

The second way to put a password on a folder is based on packaging the desired directory in an archive using special program archiver and setting an access code for the archive. It is not entirely correct to call this method setting a password on a folder, since it ceases to be a folder and turns into a RAR or ZIP file.

But, nevertheless, in terms of the ease of use of this method of protection, the method is excellent, since the WinRAR program, necessary for working with archives, allows you to work with files and folders inside the archive directly, without reverse unpacking. That is, you added data to a password-protected archive. In the future, you will have access to them only when you enter the key. And all changes inside the archive are automatically added inside by the archiver himself.

I described in detail how to use WinRAR and how to archive a file in . The instructions there are very detailed, there is even a video tutorial, but here I will summarize everything briefly:

  1. Install the WinRAR archiver
  2. Select the folder you want to put a password on and click right click mice
  3. In the context menu, select “Add to archive”
  4. In the archive settings window, click the “Set password” button
  5. Enter your password
  6. Create an archive by clicking the “OK” button

I’ll add just one nuance - if the folder is large and there is no goal of compressing it, but you just need to protect it with a password, then when setting up the archive, set the “no compression” option - this will significantly save time.

Programs for setting a password for a folder

The disadvantage of this method is that it requires the installation of an additional special software (third party programs), which are no longer used for any purpose. Overall, I recommend using special utilities only when absolutely necessary when other methods are not available.

DirLock password setting program

There is no need to study multi-page instructions in order to use the DirLock utility, since it is intuitive even for an inexperienced beginner. Using it to set an access restriction will take 10 seconds.

Download the program here, you need to install it on your computer.

After installing and configuring the program, the “Lock/UnLock” item will appear in the context menu that appears when you right-click on a folder - this is the option to set a password.

If such an item does not appear automatically for you, then run the utility and select “File” in the menu, then “Options” in it. A window will open where such a menu is added using the “Add ‘Lock/Unlock’ context menu” button.

After this, you can put a password on any folder and when you try to open it, a message will appear stating that access is denied.

It will be possible to open the folder again only if the ban is lifted through the same context menu"Lock/UnLock".

Unfortunately, you won’t be able to gain permanent access to a folder locked in this way and you will have to set and remove the password every time.

Locking folders with Anvide Lock Folder utility

Another program designed to password-protect folders on a computer. It is no more difficult to handle than the previous one, just with a slightly different approach.

Download Anvide program Lock Folder Here we install it.

In this utility, closing folders is done through the interface of the program itself.

  1. Launch the program
  2. Using the built-in explorer (+ button), find the desired folder,
  3. Press the closed lock in the panel,
  4. Enter your password twice and click the “Close access” button
  5. You can enter a password hint (if you wish)
  6. The folder will become invisible.

How to remove a password

  1. Let's launch Anvid Lock Folder
  2. Select a password-protected folder from the list,
  3. Click on the open lock icon
  4. Enter the password and click “Open access”.

As in the previous utility, to work with the content you will have to install and uninstall the code each time.

Set the password using Lim LockFolder

This utility is 100% the same as the previous version. All buttons and operating algorithms are the same, the only difference is appearance buttons (design). It won't be difficult to figure it out.

Download Lim LockFolder here you start the installation.

You launch the program, select the desired folders through Explorer, set passwords, then remove them using the open lock button - everything is the same as in Anvide Lock Folder.

Password Protect program

The last option discussed in the article is the Password Protect program. It differs from previous utilities in that it does not require installation on a computer.

The second plus is that it is in Russian.

You can download the program here.

To put a password on a folder:

  1. Open Password Protect
  2. Click the “Lock folders” button
  3. Select in Explorer required element and click “OK”
  4. Enter the access code twice and, if necessary, a hint
  5. We see a message about successful closing - the folder becomes invisible.

To work with the contents of this directory, you will need to remove the password by launching the utility and the “Unlock folders” button.

Similar to all previous options, you will have to constantly remove and set passwords - this is the main drawback of all programs, which is why I advise you to use standard features Windows.

Often users find themselves in a situation where they need to hide the contents of a folder or file from prying eyes, so the question arises about how to put a password on the folder.

Unfortunately, the developers of the Windows operating system did not provide for such a function as setting a password for individual user files and directories.

The OS can only be configured to prohibit certain users from using or viewing a specific type of directory, file or program.

Setting a password for a folder is necessary if:

  • you want to hide your files from unauthorized access by others;
  • want to protect your personal data from illegal copying or distribution.

Set a password for the archive

Using this method, you can password-protect a folder with any type of file, while it is possible to hide the very fact that the archive contains files of a certain format.

The window for entering the code will pop up even before the archive opens, so it is impossible to find out about its contents if the user does not know the combination. A password for an archive without programs is the easiest way to protect folders.

Advice! The function of setting a password for the archive does not require pre-installation additional software, you just need to have pre-installed free WinRAR programs or 7-ZIP.

To add the desired folder to the archive and password protect it, follow the instructions below:

  • Right-click on the folder you are interested in and add it to the archive, as shown in the figure;
  • Immediately after you have selected the “add to archive” action, a window will appear with various settings parameters of the created archive. Go to the tab with additional parameters and find the button to set a password, it is shown in the figure;
  • Click on the button that allows you to set a password.

After this action, a small input window will immediately appear. New code must be entered twice (to verify correct insertion). You can also check the box next to the option to encrypt file names.

Thus, third-party users will not be able to find out anything about the type of files being hidden.

The process of setting a password for an archive

After trying to open the archive, we see that you first need to enter the code and only then can you view and edit its contents.

This method Installing the code is the simplest and quite effective. However, to implement it you will need to have one of the archivers on your computer.

Also, if the code is forgotten or lost, restoring the contents of the archive will be enough challenging task for the user. This is why you should keep backup copy protected files, for example, on cloud storage.

Using the above method, you can also password-protect an archive on a flash drive.

Using PasswordProtect USB

You can find it on the Internet great amount third-party software that can handle the task of installing code on the system object you need.

A large proportion of such programs, unfortunately, can harm your files rather than protect them from unauthorized access by other users.

This article presents the most popular and common types of software that have been tested big amount users, so these programs will not harm your computer and files that need to be password protected or hidden.

This program is available for download and installation on PC and is compatible with Windows 10.

PasswordProtect USB allows you to password-protect folders and remove the previously installed encryption. The application has an intuitive user interface, so working with this utility will not be a difficult task for the user.

You can start the code installation process not only using the main program window, but also using the computer desktop.

After you have installed this software on your operating system, the installation function will be displayed in the menu of each folder, you just need to right-click on it, as shown in the figure:

  • The next step is to enter the code in the window that opens. Enter it twice to eliminate the possibility of error.
  • After installing the code, a sign will be displayed on the folder icon, indicating that the folder is protected. When you try to open a password-protected folder, the following dialog box will appear. This is the most common way to put a code on photo folders.

Folder Lock Software

This program can protect a folder on a laptop or PC. Supported OS: Windows 7, Windows 8, Windows 10. The utility encrypts the folder itself, without an archive.

You can put the code on a folder with absolutely any content: files, photos and documents.

To install it on a folder using this program, follow the instructions:

  • Download and install Folder Lock;
  • Enter a password in the text field, which will be the folder password;
  • Click OK;
  • Drag the desired folder to the main program window or use the “add” icon;
  • After the folder has been added, it immediately becomes locked and can only be opened by a person who knows the password.

Set a password for a network folder

You can also password protect network folder. For this you can also download individual programs, For example:

You can also use the program Folder Guard(