How to add xRDP and XFCE4 o UFW rules?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I'm new here and I've just installed and configured xRDP and XFCE4 on my Ubuntu 16 server so I can Remote Desktop from my Windows PC. Faizan Akram Dar's answer worked perfectly!
Then I installed an open VPN server and followed the recommendations to activate the UFW firewall. And so the Remote Desktop no longer worked. I solved it by adding to the the UFW rules the whole IP range of my router's DHCP service and the 3389 port.



sudo ufw allow from 192.168.1.1 to 192.168.1.100
sudo ufw allow 3389


However, I was wondering if there is a way to set up a more restrictive rule for this purpose.



Thank you!










share|improve this question

























    up vote
    0
    down vote

    favorite












    I'm new here and I've just installed and configured xRDP and XFCE4 on my Ubuntu 16 server so I can Remote Desktop from my Windows PC. Faizan Akram Dar's answer worked perfectly!
    Then I installed an open VPN server and followed the recommendations to activate the UFW firewall. And so the Remote Desktop no longer worked. I solved it by adding to the the UFW rules the whole IP range of my router's DHCP service and the 3389 port.



    sudo ufw allow from 192.168.1.1 to 192.168.1.100
    sudo ufw allow 3389


    However, I was wondering if there is a way to set up a more restrictive rule for this purpose.



    Thank you!










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm new here and I've just installed and configured xRDP and XFCE4 on my Ubuntu 16 server so I can Remote Desktop from my Windows PC. Faizan Akram Dar's answer worked perfectly!
      Then I installed an open VPN server and followed the recommendations to activate the UFW firewall. And so the Remote Desktop no longer worked. I solved it by adding to the the UFW rules the whole IP range of my router's DHCP service and the 3389 port.



      sudo ufw allow from 192.168.1.1 to 192.168.1.100
      sudo ufw allow 3389


      However, I was wondering if there is a way to set up a more restrictive rule for this purpose.



      Thank you!










      share|improve this question













      I'm new here and I've just installed and configured xRDP and XFCE4 on my Ubuntu 16 server so I can Remote Desktop from my Windows PC. Faizan Akram Dar's answer worked perfectly!
      Then I installed an open VPN server and followed the recommendations to activate the UFW firewall. And so the Remote Desktop no longer worked. I solved it by adding to the the UFW rules the whole IP range of my router's DHCP service and the 3389 port.



      sudo ufw allow from 192.168.1.1 to 192.168.1.100
      sudo ufw allow 3389


      However, I was wondering if there is a way to set up a more restrictive rule for this purpose.



      Thank you!







      xfce remote-desktop ufw xrdp






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 29 at 23:06









      Tudor

      1




      1




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          I don't think those rules do what you think they do.



          sudo ufw allow from 192.168.1.1 to 192.168.1.100


          allows connections to ANY port with ANY protocol FROM the single address 192.168.1.1 TO the single address 192.168.1.100 - unless your interface is actually configured on 192.168.1.100 and you have a client at 192.168.1.1 this will have no effect.



          On the other hand,



          sudo ufw allow 3389


          will allow connections to port 3389 with ANY protocol from ANY remote address to ANY local interface.



          Probably what you want is either



          sudo ufw allow from 192.168.1.0/24 to any port 3389


          or (slightly more restrictive)



          sudo ufw allow from 192.168.1.0/24 to any port 3389 proto tcp


          which will allow any clients on the local CIDR subnet 192.168.1.1 to 192.168.1.254 to connect to the RDP port using TCP:



          $ sudo ufw status numbered
          Status: active

          To Action From
          -- ------ ----
          [ 1] 22/tcp ALLOW IN 192.168.1.0/24
          [ 2] 3389/tcp ALLOW IN 192.168.1.0/24





          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1001154%2fhow-to-add-xrdp-and-xfce4-o-ufw-rules%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            I don't think those rules do what you think they do.



            sudo ufw allow from 192.168.1.1 to 192.168.1.100


            allows connections to ANY port with ANY protocol FROM the single address 192.168.1.1 TO the single address 192.168.1.100 - unless your interface is actually configured on 192.168.1.100 and you have a client at 192.168.1.1 this will have no effect.



            On the other hand,



            sudo ufw allow 3389


            will allow connections to port 3389 with ANY protocol from ANY remote address to ANY local interface.



            Probably what you want is either



            sudo ufw allow from 192.168.1.0/24 to any port 3389


            or (slightly more restrictive)



            sudo ufw allow from 192.168.1.0/24 to any port 3389 proto tcp


            which will allow any clients on the local CIDR subnet 192.168.1.1 to 192.168.1.254 to connect to the RDP port using TCP:



            $ sudo ufw status numbered
            Status: active

            To Action From
            -- ------ ----
            [ 1] 22/tcp ALLOW IN 192.168.1.0/24
            [ 2] 3389/tcp ALLOW IN 192.168.1.0/24





            share|improve this answer
























              up vote
              0
              down vote













              I don't think those rules do what you think they do.



              sudo ufw allow from 192.168.1.1 to 192.168.1.100


              allows connections to ANY port with ANY protocol FROM the single address 192.168.1.1 TO the single address 192.168.1.100 - unless your interface is actually configured on 192.168.1.100 and you have a client at 192.168.1.1 this will have no effect.



              On the other hand,



              sudo ufw allow 3389


              will allow connections to port 3389 with ANY protocol from ANY remote address to ANY local interface.



              Probably what you want is either



              sudo ufw allow from 192.168.1.0/24 to any port 3389


              or (slightly more restrictive)



              sudo ufw allow from 192.168.1.0/24 to any port 3389 proto tcp


              which will allow any clients on the local CIDR subnet 192.168.1.1 to 192.168.1.254 to connect to the RDP port using TCP:



              $ sudo ufw status numbered
              Status: active

              To Action From
              -- ------ ----
              [ 1] 22/tcp ALLOW IN 192.168.1.0/24
              [ 2] 3389/tcp ALLOW IN 192.168.1.0/24





              share|improve this answer






















                up vote
                0
                down vote










                up vote
                0
                down vote









                I don't think those rules do what you think they do.



                sudo ufw allow from 192.168.1.1 to 192.168.1.100


                allows connections to ANY port with ANY protocol FROM the single address 192.168.1.1 TO the single address 192.168.1.100 - unless your interface is actually configured on 192.168.1.100 and you have a client at 192.168.1.1 this will have no effect.



                On the other hand,



                sudo ufw allow 3389


                will allow connections to port 3389 with ANY protocol from ANY remote address to ANY local interface.



                Probably what you want is either



                sudo ufw allow from 192.168.1.0/24 to any port 3389


                or (slightly more restrictive)



                sudo ufw allow from 192.168.1.0/24 to any port 3389 proto tcp


                which will allow any clients on the local CIDR subnet 192.168.1.1 to 192.168.1.254 to connect to the RDP port using TCP:



                $ sudo ufw status numbered
                Status: active

                To Action From
                -- ------ ----
                [ 1] 22/tcp ALLOW IN 192.168.1.0/24
                [ 2] 3389/tcp ALLOW IN 192.168.1.0/24





                share|improve this answer












                I don't think those rules do what you think they do.



                sudo ufw allow from 192.168.1.1 to 192.168.1.100


                allows connections to ANY port with ANY protocol FROM the single address 192.168.1.1 TO the single address 192.168.1.100 - unless your interface is actually configured on 192.168.1.100 and you have a client at 192.168.1.1 this will have no effect.



                On the other hand,



                sudo ufw allow 3389


                will allow connections to port 3389 with ANY protocol from ANY remote address to ANY local interface.



                Probably what you want is either



                sudo ufw allow from 192.168.1.0/24 to any port 3389


                or (slightly more restrictive)



                sudo ufw allow from 192.168.1.0/24 to any port 3389 proto tcp


                which will allow any clients on the local CIDR subnet 192.168.1.1 to 192.168.1.254 to connect to the RDP port using TCP:



                $ sudo ufw status numbered
                Status: active

                To Action From
                -- ------ ----
                [ 1] 22/tcp ALLOW IN 192.168.1.0/24
                [ 2] 3389/tcp ALLOW IN 192.168.1.0/24






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 29 at 23:56









                steeldriver

                63.6k1199168




                63.6k1199168



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1001154%2fhow-to-add-xrdp-and-xfce4-o-ufw-rules%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Trouble downloading packages list due to a “Hash sum mismatch” error

                    How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

                    Cutting all the characters after the last /