• AppleMango@lemmy.world
    link
    fedilink
    English
    arrow-up
    16
    arrow-down
    2
    ·
    23 hours ago

    Most ssh ports should be accessed through a VPN anyway, not exposed directly to the internet

      • dan@upvote.au
        link
        fedilink
        English
        arrow-up
        24
        ·
        edit-2
        19 hours ago

        Wireguard and apps based on it (like Tailscale) don’t respond at all unless the data is signed with the key of a configured peer (or with Tailscale, a system on your tailnet that passes the ACL). It’s literally impossible for an outsider/attacker to detect with a port scan since it just ignores unauthenticated packets.

        The Wireguard codebase is also extremely small. The core Wireguard implementation (the version in the Linux kernel) is around 5,000 lines long, so an experienced developer can read through all the code if they dedicate a day or two to it, and understand how it works.

        For comparison, OpenVPN is around 70,000 lines of code and OpenSSH is around 150,000 lines of code. There’s a huge number of features in SSH!

        • Kazumara@discuss.tchncs.de
          link
          fedilink
          English
          arrow-up
          6
          ·
          19 hours ago

          That is a convincing argument. I wasn’t thinking of wireguard, but it makes sense that it’s quite small and focused, being in the kernel.

          I’m dealing more with OpenVPN and that can be very annoying, that had me lean in the opposite direction earlier (and lets not even speak of the Cisco crap).

          • dan@upvote.au
            link
            fedilink
            English
            arrow-up
            1
            ·
            12 hours ago

            There’s Dropbear SSH, which is the most common choice for a minimal SSH server and client, but even that is around 50,000 lines of code.

          • theneverfox@pawb.social
            link
            fedilink
            English
            arrow-up
            4
            ·
            18 hours ago

            Because all those extra features are really useful. You can run all sorts of things over ssh, from sophisticated file transfer to remote development and tunneling

            Ssh is remote code execution. Under any implementation, any authentication methods should be the absolute last line of defense after you’ve properly locked down access

            • MonkderVierte@lemmy.zip
              link
              fedilink
              English
              arrow-up
              1
              ·
              edit-2
              9 hours ago

              Well, yeah but more features in remote code excution = more vulnerabilities. For example sftp: you could also just run ftp over vpn for the same effect. Or just cat the file over ssh. Instead, we have one big monolith.

              • theneverfox@pawb.social
                link
                fedilink
                English
                arrow-up
                1
                ·
                7 hours ago

                SFTP is just FTP over SSH… Also, FTP is essentially one small step away from code execution, even on a secure network it’s better to use SFTP

                SSH isn’t many things, it’s one connection type through which you can do many things. You can’t simply cat a file over without being able to handle the throughput gracefully, otherwise you’d have to design a new layer to do exactly the same thing. The same for reading files, if it can’t gracefully spit out 10k lines in a second you couldn’t handle output

                And if you can do all that, why not allow VIM over the same connection? You’re already going to have to manage the terminal session, why not fully reflect a terminal?

                FTP is absolutely not the answer, but a server that will conditionally serve files as well as conditionally accept uploads is far more secure. The same for everything… If you want to manage users, instead of allowing remote code execution you should use an API to perform predefined tasks

                SSH isn’t meant for security or production use, it’s meant for power and flexibility. It’s generally deactivated by default for a reason, but it’s included for a reason too. It’s just really damn useful