4 ms·
the code for the VPN is better because...?
by munin 11y ago
the code for the VPN is better because...?
- tjohns 11y agoIt's not necessarily better. But now you have two layers of security (VPN + SSH), rather than just one. And as others have mentioned, either way it's still good practice to disable password auth, so that you can only connect to SSH using a public/private keypair.
- baldfat 11y agoEven better don't use default ports. Or have a second ssh that doesn't except any IP address at port 22 and than have your non-standard port with keys and limited user names and if possible a white list of your IP addresses.
- eropple 11y agoNot using default ports will mildly confuse automated scans and do absolutely nothing to a determined attacker. Or somebody with nmap, which is not the same thing. If you're whitelisting IPs, you may as well run it on port 22.
- baldfat 11y agoNo it makes it harder and more of a pain. Trust me I have a friend who loves breaking into my personal server. That one trick two ssh running on different ports screwed with him for a long, long time. He is a genius of a hacker and has been doing it for a living for years. When he finally got in he was so pissed that threw him.
- eropple 11y agoYou are describing an anecdotal instance of a person whose capabilities are not established being thrown by something that nmap will catch on a normal scan. Color me skeptical. I shall decline to "trust you."
- DrPizza 11y ago> Trust me I have a friend who loves breaking into my personal server. Sterling work establishing your own competence there.
- baldfat 11y agoNot my competence it his competence I trust and I got him good with that one since it never occurred to him that one stupid trick messed with him for so long. Lie 5 minutes a month.
- mortenlarsen 11y agoOne small benefit of using a non default port is that it keeps down the noise from automated scans. So any "real" suspicious activity will now stand out as it is not drowned out by the noise anymore.
- tpio 11y agoIf you do this, keep it in the privileged range (< 1024) or you run the risk of your ssh server crashing and some malicious normal user binds to your unprivileged port with a fake sshd and grabs your root password.
- mattstreet 11y agoIf there is a defect with VPN and you gain arbitrary execution then you'd have access on the system as whatever user the VPN was running as. You don't necessarily have to break VPN and SSH.
- dpark 11y agoThe machines running your VPN are presumably not the same machines you're trying to access via SSH. A compromise in your VPN should't give anyone execution access to anything interesting.
- jarman 11y agoIf VPN is broken, you still need to break SSH
- CHY872 11y agoThe reason that no one has given yet is that you can monitor more carefully when you have a VPN. With a VPN, you can follow the bastion model; the VPN server runs only the VPN code and nothing else (with as much crap removed as possible), with a really restrictive SELinux policy, every tiny error logged and forwarded. So now, since any attack has to be through the bastion, and all bastion errors are looked at by a human (because there should be only a few of them), then you're more likely to notice a breach more quickly because it won't become caught up in your general logs. It should be noted that it's as easily possible to have the bastion server run an SSH server, and allow SSH access to other servers on your network.