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.
    • ahking19A
      ahking19
      last edited by

      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
      • NogBadTheBadN
        NogBadTheBad
        last edited by NogBadTheBad

        @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
        • ahking19A
          ahking19
          last edited by

          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
          • johnpozJ
            johnpoz LAYER 8 Global Moderator
            last edited by johnpoz

            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.8, 24.11

            ahking19A 1 Reply Last reply Reply Quote 0
            • NogBadTheBadN
              NogBadTheBad
              last edited by

              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
              • johnpozJ
                johnpoz LAYER 8 Global Moderator
                last edited by

                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.8, 24.11

                1 Reply Last reply Reply Quote 2
                • ahking19A
                  ahking19 @johnpoz
                  last edited by

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

                  NogBadTheBadN 1 Reply Last reply Reply Quote 0
                  • NogBadTheBadN
                    NogBadTheBad @ahking19
                    last edited by

                    @ahking19

                    How about the floating rules ?

                    Andy

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

                    ahking19A 1 Reply Last reply Reply Quote 0
                    • johnpozJ
                      johnpoz LAYER 8 Global Moderator
                      last edited by

                      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.8, 24.11

                      NogBadTheBadN 1 Reply Last reply Reply Quote 0
                      • ahking19A
                        ahking19 @NogBadTheBad
                        last edited by

                        @nogbadthebad

                        No floating rules

                        1 Reply Last reply Reply Quote 0
                        • johnpozJ
                          johnpoz LAYER 8 Global Moderator
                          last edited by

                          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.8, 24.11

                          ahking19A 1 Reply Last reply Reply Quote 0
                          • NogBadTheBadN
                            NogBadTheBad @johnpoz
                            last edited by

                            @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
                            • ahking19A
                              ahking19 @johnpoz
                              last edited by

                              @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
                              • johnpozJ
                                johnpoz LAYER 8 Global Moderator
                                last edited by

                                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.8, 24.11

                                1 Reply Last reply Reply Quote 0
                                • ahking19A
                                  ahking19
                                  last edited by

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

                                  NogBadTheBadN 1 Reply Last reply Reply Quote 0
                                  • NogBadTheBadN
                                    NogBadTheBad @ahking19
                                    last edited by

                                    @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

                                    ahking19A 1 Reply Last reply Reply Quote 0
                                    • johnpozJ
                                      johnpoz LAYER 8 Global Moderator
                                      last edited by johnpoz

                                      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.8, 24.11

                                      1 Reply Last reply Reply Quote 0
                                      • ahking19A
                                        ahking19 @NogBadTheBad
                                        last edited by

                                        @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
                                        • johnpozJ
                                          johnpoz LAYER 8 Global Moderator
                                          last edited by

                                          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.8, 24.11

                                          1 Reply Last reply Reply Quote 0
                                          • ahking19A
                                            ahking19
                                            last edited by

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

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