Earlier quoted context omitted.
Exploiting a single user's account and opening a high port is not the same as getting root on a system.
So you're operating with a compromised user account capable of killing your sshd on port 1234 but there's no other local escalation exploits? Seems like something a little script or patch could fix up really easily - make sure your daemon is running on port 1234. If it's not, take whatever defensive measures you think would be effective.
Why Putting SSH On Another Port is a Good Idea
81–90 of 192 posts
Re: Why Putting SSH On Another Port is a Good Idea
#82In moving sshd to an alternate port, I've noticed two things: a greatly decreased amount of log noise from dictionary attacks, and a moderately increased amount of portscans. It's reasonably clear to your average net malfeasant that any host running recognizable services is going to be running sshd. So why not do both? Put a dummy sshd on 22/tcp, deny all auth attempts, log whatever keeps you swimming in interesting…
I can't deny, it is a cool technique though. PortSentry is a good tool to use for just this. Anytime someone came to :22 and the machine just disappears.
Re: Why Putting SSH On Another Port is a Good Idea
#832. Next he talks about this non-root listener issue. He claims that you shouldn’t run your SSH daemon on a non-privileged port because anyone can spin up a daemon up there. Great point, except you can still do that even if you run your main one on 22. I don't think I understand this point at all. What is it that you're trying to say? Are you sure you understood the original post's point? djc@capelis.dj:~$ nc -l -p 14…
Re: Why Putting SSH On Another Port is a Good Idea
#84Here is something to think about, the author is right, but if you follow many ssh setup tutorials that say to move to say port 25000, you are less likely to be port scanned than the default, but still more likely than if you had used something totally random like say port 42 or 818. By me even writing this clever hackers will start scanning those ports too, just to be sure they are hitting everyone. That being said,…
Port scanning is generally automated (edit: and scans all ports, not just the handful you listed), so it doesn't actually matter which port you pick as long as it's not 22. Port scanners like nmap are widely available, so the time to actually figure out which port is running SSH is quite short in practice. Basically, there are two classes of people: 1. Those who use port scanners. 2. Those who do not. If you are bein…
Re: Why Putting SSH On Another Port is a Good Idea
#85How about: Why it doesn't matter what port you run SSH on * Because anything but the IP address of your office or VPN connection should be blocked at the firewall level for that port
Why would I use a VPN when I have SSH? IE, why do you think that a VPN is somehow more secure than an SSH connection?
Re: Why Putting SSH On Another Port is a Good Idea
#862. Next he talks about this non-root listener issue. He claims that you shouldn’t run your SSH daemon on a non-privileged port because anyone can spin up a daemon up there. Great point, except you can still do that even if you run your main one on 22. I don't think I understand this point at all. What is it that you're trying to say? Are you sure you understood the original post's point? djc@capelis.dj:~$ nc -l -p 14…
His argument is that we can't be sure whether we're talking to the real SSH running or some rogue SSH run by an unprivileged user. That's why SSH servers have their server host keys with fingerprints you're supposed to verify using a different channel when first connecting: if someone managed to spin up a rogue SSH server, it would have a different host key and you would get a big fat warning from your SSH client tha…
Re: Why Putting SSH On Another Port is a Good Idea
#871. In the real world, security resources aren't free.
2. Security decisions are made by users.
3. Humans will engage in risk compensation [1]
4. Setting policy doesn't change people's brains, it just tells them what to do.
5. It doesn't matter what you intend, it matters what users actually do.
The upshot of this is that any security policy that is highly visible and highly inconvenient will reduce your security, and has to have a substantial benefit to justify its cost. You can say "I'll do stupid port reassignment tricks, and I'll also mandate that passwords are forbidden, and require that private keys be managed properly" but at three in the morning when the whatever is overdue and not working what you're gonna get is:
I'll just do password auth with root:root, nobody ever hits port 24601 anyway. Besides, look at this page [2], using a strange port makes me invisible like the Predator and makes me four thousand times more secure! I really want to believe this so I do.
Also, subverting scanners is an anti-security move, not a pro-security one. Scanners are a helpful tool to identify what the hell is running on your network. Your security efforts have to find every hole, the bad guys only have to find one. Don't put yourself at an even bigger disadvantage by making your systems harder to analyze.
[1] http://en.wikipedia.org/wiki/Risk_compensation
[2] http://www.danielmiessler.com/blog/security-and-obscurity-do...
Re: Why Putting SSH On Another Port is a Good Idea
#88Earlier quoted context omitted.
His argument is that we can't be sure whether we're talking to the real SSH running or some rogue SSH run by an unprivileged user. That's why SSH servers have their server host keys with fingerprints you're supposed to verify using a different channel when first connecting: if someone managed to spin up a rogue SSH server, it would have a different host key and you would get a big fat warning from your SSH client tha…
Could a non root user just read the host keys from sshd, then kill it and serve them? Or could it even just MITM it?
(I might be wrong about this, but...) I've seen quite a few instances where SSH refuses to let people even try to log in if there's a chance that a private key has the wrong permissions applied, so as to minimize the risk of someone accidentally letting others read it -- as you suggested.
You'll find the default SSH config on the more noteworthy Linux distributions to do this 90% of the time time without even asking :)
Re: Why Putting SSH On Another Port is a Good Idea
#89Earlier quoted context omitted.
If you have random people spinning up daemons on your servers then you don't have an SSH problem.
Something as simple as an exploit against a php script could lead to unprivileged code execution & something as minimal as memory exhaustion could kill off your sshd process. If the sshd process is killed, and the attacker knows what port it was on (netstat -na | grep LISTEN), the attacker could spawn their own daemon on the unprivileged port that was previously being used for sshd, and that daemon could be used to c…
Re: Why Putting SSH On Another Port is a Good Idea
#90Earlier quoted context omitted.
His argument is that we can't be sure whether we're talking to the real SSH running or some rogue SSH run by an unprivileged user. That's why SSH servers have their server host keys with fingerprints you're supposed to verify using a different channel when first connecting: if someone managed to spin up a rogue SSH server, it would have a different host key and you would get a big fat warning from your SSH client tha…
Could a non root user just read the host keys from sshd, then kill it and serve them? Or could it even just MITM it?
* Note, I guess you could run an sshd that only allows logging in to a single user and runs as that user but both points above still stand even in that case.