core: guard against SSH to localhost:22 [GH-4070]