This article is about how to share site pages in SharePoint. Here, I am showing for SharePoint 2016 and online. The steps, which I am doing here, are the similar steps which will be followed for other versions of SharePoint as well, so we will have a small description of the steps that are used to share the site pages for SharePoint.
For example, as per customer requirement, we have created a site and this site is default, which can be only accessed for the admin or user who has created the same. For other user's access, we need to give them permission and we need to share the site.
If we are not sharing and the user will try to access it, the site will get an error saying “you don’t have permission to access this site. Please contact administrator” or “Sorry this site hasn’t been shared with you”.
Thus, here we go step by step to configure the same
Note

We can share the site outside of the organization as well. We will be writing about the same in the next article.
Here, we can see it shared with the users list by clicking Shared with option from the left side of the screen.
For SharePoint Online, we need to have user account on the users and groups as well.
Thanks.