A user may generate a link to share a file. The link can be used by the recipient or shared with someone else:
The links can require the user to be authenticated or not. For anonymous guest links, you can limit the permissions of the guest using the FileAnonymousLinkType and FolderAnonymousLinkType parameters:
Set-SPOTenant -FolderAnonymousLinkType <None|View|Edit> `
-FileAnonymousLinkType <None|View|Edit>
Additionally, you may want to limit the lifetime of guest links to a certain number of days:
Set-SPOTenant -RequireAnonymousLinksExpireInDays <int>
When using the Get a link feature, you can set the default type using the DefaultSharingLinkType parameter:
Set-SPOTenant -DefaultSharingLinkType <None|Internal|Direct|AnonymousAccess>