Move public key commands to the ssh module

Don't use parentheses around the condition of an `if`.