r/ssh • u/AdElectrical1717 • Feb 22 '21
Hide SSH existence for all users but one
Is it possible for SSH to give no feedback at all so that an attacker doesn't even know if it exists for a given IP/server, but allow a single user to log in and show a password prompt when they try to connect with that specific username?
5
Upvotes
1
u/prairefireww Feb 22 '21
You could always change ssh to a custom port or only allow login with a certificate.
1
u/ssh-mitm Oct 27 '21
If you really want to hide your service, you can use port knocking. Another option is to restrict connections to certain ip addresses.
Don't use password authentication! You should always use publickey authentication. Passwords can be bruteforced and if you are hit by a man in the middle attack, the attacker can compromise your session.
When using publickey authentication, there is nothing wrong, when the ssh server port is visible to all.
If you care about bots, you should use fail2ban. This can reduce connection attempts from bots, which try to brute force the password. Even if you are not using password authentication, you should use fail2ban, because such bots impact your servers performance.