Title: #5028: [Backport][ipa-4-8] IPA-EPN: enhance input validation
This PR was opened manually because PR #4991 was pushed to master and backport to ipa-4-8
is required. It is manual because I got distracted and the ssh password input timed out.
They were clean cherry-picks.
To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/5028/head:pr5028
git checkout pr5028