How to Lock a File in SharePoint Document Library?

SharePoint document library allows us to set the password while sharing files. As a result, we can secure our files. In this SharePoint Online tutorial, I will show you step-by-step instructions on how to lock a file in a SharePoint document library by password.

Locking a file or folder is possible, when we share a document library files or folders with external users. Even though we can set a password for SharePoint Online document library files or folders with internal users, it won’t work for internal users.

Also, if anyone wants to unlock a file, only that user can open a file and view it by entering the password.

Lock a File in SharePoint Document Library

Lock a File in a SharePoint Online Document Library

To lock a file within a SharePoint document library and share it with users, Follow the below-mentioned steps:

  • Enable Sharing Settings to Anyone for the User Site
  • Deactivate the Limited-access user permission lockdown mode
  • Share a file by locking in a SharePoint Online document library

Enable Sharing Settings to Anyone at Site Level

In this section, I will show you how to enable sharing settings to Anyone at a site level through a SharePoint admin center.

By default, external sharing will be enabled for anyone at a SharePoint Tenant level.

  • Open a SharePoint admin center, Expand Sites, and click on Active sites.
SharePoint online document library file locking
  • Search and select a site for which we need to enable sharing settings to anyone.
How to lock a file in SharePoint document library
  • In the Settings tab, Choose Anyone in External file sharing and click on Save.
How to lock files in modern SharePoint document library

This is how to enable external sharing to anyone at a site level in a SharePoint Online document library.

How to Deactivate Limited-access User Permission in Lockdown Mode

Now, I will show you the next step i.e.: deactivating limited access user permissions lockdown mode in a SharePoint Online site.

When the Limited-access user permission lockdown mode is enabled, permissions for users in “limited access” permissions level (such as Anonymous Users) are reduced, preventing access to Application Pages.

  • Open a SharePoint Online site, Select Site information under Settings, and Click on View all site settings.
How to lock a SharePoint document library file
  • Select Site collection features under Site Collection Administration on the Settings page.
Locking a SharePoint document Library file
  • Go to Limited-access user permission lockdown mode, Click on the Deactivate button.
SharePoint Online document library File locking with an examples
  • It will redirect to the next page to confirm deactivation; click on the Deactivate this feature.
SharePoint document library File locking with an examples

This is how to deactivate the limited-access user permission lockdown mode under site collection administration.

Share a File by Locking in a SharePoint Online Document Library

Now, I will explain how to share a file with file locking in a SharePoint Online document library.

  • Open a SharePoint Online document library; select a file you want to share bylock.
Share a file by locking in SharePoint document library
  • Click on the Share option, that is present next to the selected item or else in the command bar.
Locking a file in SharePoint Online document library
  • Then, a Share dialogue box will appear; click on Sharing settings.
SharePoint document library lock a file by password
  • In Sharing settings, set a strong password for a file that needs to be shared with the users and Click on Apply.
how to set a password for SharePoint online document library file
  • Then, it will again open a Share dialogue box, here I was giving an email id of external users.
Create a password for a file in SharePoint
  • Whenever a user tries to open a SharePoint document library file, it will ask to Enter a password to unlock it, as shown below figure:
How to create a Password in SharePoint document library

This is how to Share a file by locking it in a SharePoint Online document library.

Conclusion

Through this SharePoint tutorial, I have demonstrated how to lock a document library file in a SharePoint site. And also I have shown you the steps to lock a file within a SharePoint document library such as:

Steps:

  • Enable Sharing Settings to Anyone for the User Site
  • Deactivate Limited-access user permission lockdown mode
  • Share a file by locking in a SharePoint Online document library

You may also like: