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

SSH Login Attempts

Scheduled Pinned Locked Moved General pfSense Questions
20 Posts 3 Posters 3.1k 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.
  • A
    ahking19
    last edited by Aug 2, 2018, 5:29 PM

    I am seeing ssh login attempts in the System Log like the following:

    Aug 1 11:13:26	sshd	72971	Disconnected from 94.23.195.112 port 37754 [preauth]
    Aug 1 11:13:26	sshd	72971	Received disconnect from 94.23.195.112 port 37754:11: Normal Shutdown, Thank you for playing [preauth]
    Aug 1 11:13:26	sshd	72971	input_userauth_request: invalid user mattes [preauth]
    Aug 1 11:13:26	sshd	72971	Invalid user mattes from 94.23.195.112
    Aug 1 11:10:19	sshd	79359	Disconnected from 185.113.240.93 port 45598
    

    In System | Advanced I did have "Enable Secure Shell" checked and also "Disable password login for Secure Shell (RSA/DSA key only)". But I assumed that without adding a WAN or floating firewall rule to accept SSH (22) traffic it would be blocked by default. I was thinking it would work like the webGUI and only accept logins from the local traffic.

    What is the default behavior? Does checking "Enable Secure Shell" allow outside ssh access?

    Thanks
    -Andrew

    1 Reply Last reply Reply Quote 0
    • N
      NogBadTheBad
      last edited by NogBadTheBad Aug 2, 2018, 6:11 PM Aug 2, 2018, 6:03 PM

      @ahking19 said in SSH Login Attempts:

      n System | Advanced I did have "Enable Secure Shell" checked and also "Disable

      "Does checking "Enable Secure Shell" allow outside ssh access?" No.

      Do you have a firewall rule on your WAN enabling SSH, SSH inbound to the WAN interface would be blocked by default ?

      Looks like brute force SSH to me.

      https://www.abuseipdb.com/check/94.23.195.112

      https://www.abuseipdb.com/check/185.113.240.93

      Andy

      1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

      1 Reply Last reply Reply Quote 0
      • A
        ahking19
        last edited by Aug 2, 2018, 6:12 PM

        I don't currently have an active WAN firewall rule to allow inbound port 22.

        I did have a rule that was port forwarding 22 to an SFTP server but that rule is disabled, although it exists. Haven't used the SFTP server in 10-12 months so I could delete the rule.

        -Andrew

        1 Reply Last reply Reply Quote 0
        • J
          johnpoz LAYER 8 Global Moderator
          last edited by johnpoz Aug 2, 2018, 6:21 PM Aug 2, 2018, 6:13 PM

          post up your wan rules.. NO turning on enable ssh does not auto create wan rule to allow traffic.

          Do you have any floating rules?

          An intelligent man is sometimes forced to be drunk to spend time with his fools
          If you get confused: Listen to the Music Play
          Please don't Chat/PM me for help, unless mod related
          SG-4860 24.11 | Lab VMs 2.7.2, 24.11

          A 1 Reply Last reply Aug 2, 2018, 6:24 PM Reply Quote 0
          • N
            NogBadTheBad
            last edited by Aug 2, 2018, 6:21 PM

            I used this on my Pi running FreeBSD if ever you need to block SSH brute force attacks:-

            https://www.cyberciti.biz/faq/freebsd-openbsd-pf-stop-ftp-bruteforce-attacks/

            Andy

            1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

            1 Reply Last reply Reply Quote 0
            • J
              johnpoz LAYER 8 Global Moderator
              last edited by Aug 2, 2018, 6:23 PM

              pfsense has built in lockout of failed attempts

              https://www.netgate.com/docs/pfsense/firewall/sshlockout.html

              Sure there is a way to adjust the number of fails - but I do not think its in the gui anywhere.

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.7.2, 24.11

              1 Reply Last reply Reply Quote 2
              • A
                ahking19 @johnpoz
                last edited by Aug 2, 2018, 6:24 PM

                @johnpoz Here are the rules
                0_1533234265878_Screen Shot 2018-08-02 at 11.19.04 AM.png

                N 1 Reply Last reply Aug 2, 2018, 6:27 PM Reply Quote 0
                • N
                  NogBadTheBad @ahking19
                  last edited by Aug 2, 2018, 6:27 PM

                  @ahking19

                  How about the floating rules ?

                  Andy

                  1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

                  A 1 Reply Last reply Aug 2, 2018, 6:28 PM Reply Quote 0
                  • J
                    johnpoz LAYER 8 Global Moderator
                    last edited by Aug 2, 2018, 6:27 PM

                    Dude your rule right there on top allows ANY Ip in that pfb_europe_v4 to anything... Why in the world would you have such a rule???

                    An intelligent man is sometimes forced to be drunk to spend time with his fools
                    If you get confused: Listen to the Music Play
                    Please don't Chat/PM me for help, unless mod related
                    SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                    N 1 Reply Last reply Aug 2, 2018, 6:30 PM Reply Quote 0
                    • A
                      ahking19 @NogBadTheBad
                      last edited by Aug 2, 2018, 6:28 PM

                      @nogbadthebad

                      No floating rules

                      1 Reply Last reply Reply Quote 0
                      • J
                        johnpoz LAYER 8 Global Moderator
                        last edited by Aug 2, 2018, 6:29 PM

                        That first rule allows access to anything.. Coming from anything in that alias.. So no shit getting brute force on ssh, and your gui to as well.

                        Why do you think you need such a rule?

                        An intelligent man is sometimes forced to be drunk to spend time with his fools
                        If you get confused: Listen to the Music Play
                        Please don't Chat/PM me for help, unless mod related
                        SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                        A 1 Reply Last reply Aug 2, 2018, 6:37 PM Reply Quote 0
                        • N
                          NogBadTheBad @johnpoz
                          last edited by Aug 2, 2018, 6:30 PM

                          @johnpoz said in SSH Login Attempts:

                          Dude your rule right there on top allows ANY Ip in that pfb_europe_v4 to anything... Why in the world would you have such a rule???

                          What John said, if you look in the firewall logs, you'll see it as its logging it.

                          Andy

                          1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

                          1 Reply Last reply Reply Quote 0
                          • A
                            ahking19 @johnpoz
                            last edited by Aug 2, 2018, 6:37 PM

                            @johnpoz

                            Damn, was temp rule for team working in France. Updated rule to only allow OpenVPN.0_1533234938408_Screen Shot 2018-08-02 at 11.33.16 AM.png

                            1 Reply Last reply Reply Quote 0
                            • J
                              johnpoz LAYER 8 Global Moderator
                              last edited by Aug 2, 2018, 6:38 PM

                              That rule is pointless since you have a rule just below it that allows vpn any source. Unless you just want to log those from that alias?

                              An intelligent man is sometimes forced to be drunk to spend time with his fools
                              If you get confused: Listen to the Music Play
                              Please don't Chat/PM me for help, unless mod related
                              SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                              1 Reply Last reply Reply Quote 0
                              • A
                                ahking19
                                last edited by Aug 2, 2018, 6:41 PM

                                There is a block rule in between if NOT North America.

                                N 1 Reply Last reply Aug 2, 2018, 6:46 PM Reply Quote 0
                                • N
                                  NogBadTheBad @ahking19
                                  last edited by Aug 2, 2018, 6:46 PM

                                  @ahking19 said in SSH Login Attempts:

                                  North America.

                                  Wouldn't it be better to change the block rule in between if NOT North America to a pass North America, then the rule beneath block any OpenVPN and log?

                                  Andy

                                  1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

                                  A 1 Reply Last reply Aug 2, 2018, 7:16 PM Reply Quote 0
                                  • J
                                    johnpoz LAYER 8 Global Moderator
                                    last edited by johnpoz Aug 2, 2018, 6:49 PM Aug 2, 2018, 6:46 PM

                                    True.. on the ! NA rule.

                                    But you could for sure write those rules a bit more clear.. But without knowing EXACTLY what your wanting to do its just guessing, etc.

                                    An intelligent man is sometimes forced to be drunk to spend time with his fools
                                    If you get confused: Listen to the Music Play
                                    Please don't Chat/PM me for help, unless mod related
                                    SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                                    1 Reply Last reply Reply Quote 0
                                    • A
                                      ahking19 @NogBadTheBad
                                      last edited by Aug 2, 2018, 7:16 PM

                                      @nogbadthebad

                                      That would be fine for OpenVPN. But also don't need HTTP & HTTPS sites available outside North America. Not sure how/if I can combine pfBlocker rule with NAT rule. if that makes sense...

                                      -Andrew

                                      1 Reply Last reply Reply Quote 0
                                      • J
                                        johnpoz LAYER 8 Global Moderator
                                        last edited by Aug 2, 2018, 7:23 PM

                                        Sure you can if you just use its aliases - they can be used anywhere you want.. Rule, Nat, etc.

                                        An intelligent man is sometimes forced to be drunk to spend time with his fools
                                        If you get confused: Listen to the Music Play
                                        Please don't Chat/PM me for help, unless mod related
                                        SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                                        1 Reply Last reply Reply Quote 0
                                        • A
                                          ahking19
                                          last edited by Aug 2, 2018, 8:24 PM

                                          Thanks. I'll take a look at using the pfBlocker aliases.

                                          1 Reply Last reply Reply Quote 0
                                          20 out of 20
                                          • First post
                                            20/20
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                            This community forum collects and processes your personal information.
                                            consent.not_received