Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Block SCP but allow SSH

    Scheduled Pinned Locked Moved Firewalling
    4 Posts 2 Posters 557 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      Linu
      last edited by

      Hi Team,
      I have a private network and I am able to SSH and SCP from this Private network to My corporate network. Dude to security issues, I want to Block the scp function alone from my private network to corporate network. Can you please help me to add the correct block rule for this scenario?Below is the NAT rule for SSH, respective WAN rule also created automatically for this NAT rule.
      4bf39495-b134-4f04-a1d8-0fb2d94d8a4b-image.png

      Thanks,
      Linu

      V 1 Reply Last reply Reply Quote 0
      • V
        viragomann @Linu
        last edited by

        @linu
        SCP is based on SSH. Blocking it separatly cannot be done by packet filter at all.

        You have to do this on the destination device if it's even possible.

        L 1 Reply Last reply Reply Quote 1
        • L
          Linu @viragomann
          last edited by

          @viragomann Can we achieve this by blocking FTP traffic?

          V 1 Reply Last reply Reply Quote 0
          • V
            viragomann @Linu
            last edited by

            @linu said in Block SCP but allow SSH:

            @viragomann Can we achieve this by blocking FTP traffic?

            No, FTP uses a different port.

            You cannot do this on pfSense with filter rules. Possibly it is doable with the HAproxy package.
            The PF filter works based on protocol, source and destionation IPs and ports. But SCP uses port 22 likewise as SSH. So there is no possibility to distinguish the connection type for the packet filter.

            1 Reply Last reply Reply Quote 1
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.