A password with increased complexity is great, but if there is an exploit against the server software (OpenSSH or otherwise) that you're running, it won't help. The idea behind an obscure high port number is that it won't be attacked in the first place, but there are caveats to consider:
High ports introduce an additional security risk. If the SSH server goes down, a local user can stand up a new SSH server on the same port. Only ports 1-1024 are restricted to the root user, so your alternate port should be in that range. (This cuts both ways: port scanners only examine these ports, so you're less hidden.) If you're port-forwarding from a router that has no users, this risk is likely moot.
Serving on an alternate port is security through obscurity. Consider it "extra" but don't consider it when calculating entropy and risk. It's not bad to be obscure, but proper complexity measurement must assume all processes and schemes are known to the attacker. Adapting a quote from @barbecue:
Obscurity is to security as camouflage is to armor.
One makes it harder to find you, the other protects you once you have been found.
You might get fewer attacks on port 2938, but a weak password is a weak password.
I really like your idea of comparing the password entropy of password
to password2938
(assuming you mean a standard random password), which I calculate would add 13 bits (a random dictionary word like whatever
→ whatever6823
increases entropy from 17 to 30). A longer password is certainly more secure, but in order to model this properly, you'd have to get statistics on how many port-22-bound attackers would eventually break that longer password versus how many attackers that would both find the nonstandard port and break the shorter password, and even that analysis would have to assume the same rate of persistence even though attacks are increasing in both frequency and sophistication.
Instead, I'd recommend something like Fail2ban, which can recognize failed logins and ban the IP that attempted them (by default, Fail2ban blocks an IP for ten minutes after ten failed logins within ten minutes, but this is all configurable). This limits persistent attacks to trying an average of one password a minute, so whatever
would take about a week to break and even a more typical (yet still weak) password like Da5id
would take 12+ years (222.6 ÷ 365 ÷ 24 ÷ 60 = 12) of non-stop password checking, which is presumably more time that you'd have this account and password on this server (since you must never recycle passwords between hosts or even installs).
Do not think that this makes weak passwords like Da5idRox!
a good idea. Fail2ban only runs on the SSH server; somebody with shell access would break this in two weeks.
Of course, there's nothing stopping you from doing it all. Add complexity to your password, use an alternate port, and block IPs with too many failures. An additional obfuscation technique you could try is port knocking, which can even be done securely if the knock itself is encrypted end-to-end or uses a one-time password.