How to create/recreate default SharePoint groups for a site

After a query on the internet, it seems that it is not so easy to find this information, unless you receive an error like: "The groups required to manage users for your site are missing" (this was observed in the SharePoint Online - the version on the servers is 2010, moving to 2013 now – when trying to share the site with external users). If you will look for the error, you will find the best way of doing it - using the direct URL: <siteURL>/_layouts/permsetup.aspx (in the KB article: https://support.microsoft.com/kb/2632494 - Error when you invite external users to your site: "The groups required to manage users for your site are missing" ).

Some other solutions can be used too:

The above recommendations can be used for: SharePoint Online, SharePoint 2010, SharePoint 2013 (Foundation or Server, I did not test in 2013)