
According to the documentation below, this feature is available for SharePoint Server 2019. The only way to share with a password is to create a share with Anyone with this link. If this option is greyed out, you will need to have a SharePoint administrator change the external user settings.
Share SharePoint files or folders
----------------------------------
If this is helpful please accept answer.