SSH through shadowsocks?












1














How could I route my SSH traffic through shadowsocks?



I am connecting from behind the Great Fire Wall to a server using shadowsocks. I would like to make outgoing SSH connections but I am concerned that SSH traffic could be identified and so result in my connection getting shutdown. Hence, I would like to be able to route the SSH traffic through the SOCKS5 proxy that I already have working.



Where do I start to achieve this? I assume I need to create a virtual network adaptor that can present a range of ports from which the output is routed over the SOCKS5 proxy somehow?










share|improve this question





























    1














    How could I route my SSH traffic through shadowsocks?



    I am connecting from behind the Great Fire Wall to a server using shadowsocks. I would like to make outgoing SSH connections but I am concerned that SSH traffic could be identified and so result in my connection getting shutdown. Hence, I would like to be able to route the SSH traffic through the SOCKS5 proxy that I already have working.



    Where do I start to achieve this? I assume I need to create a virtual network adaptor that can present a range of ports from which the output is routed over the SOCKS5 proxy somehow?










    share|improve this question



























      1












      1








      1


      1





      How could I route my SSH traffic through shadowsocks?



      I am connecting from behind the Great Fire Wall to a server using shadowsocks. I would like to make outgoing SSH connections but I am concerned that SSH traffic could be identified and so result in my connection getting shutdown. Hence, I would like to be able to route the SSH traffic through the SOCKS5 proxy that I already have working.



      Where do I start to achieve this? I assume I need to create a virtual network adaptor that can present a range of ports from which the output is routed over the SOCKS5 proxy somehow?










      share|improve this question















      How could I route my SSH traffic through shadowsocks?



      I am connecting from behind the Great Fire Wall to a server using shadowsocks. I would like to make outgoing SSH connections but I am concerned that SSH traffic could be identified and so result in my connection getting shutdown. Hence, I would like to be able to route the SSH traffic through the SOCKS5 proxy that I already have working.



      Where do I start to achieve this? I assume I need to create a virtual network adaptor that can present a range of ports from which the output is routed over the SOCKS5 proxy somehow?







      ssh shadowsocks






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 10 '18 at 9:05

























      asked Jan 10 '18 at 8:58









      Hefaestion

      65




      65






















          1 Answer
          1






          active

          oldest

          votes


















          4














          If your configuration of shadowsocks is:




          • local address : 127.0.0.1

          • local port : 1080

          • server ip 42.42.42.42


          change for your own configuration



          sudo apt install connect-proxy


          Edit your ~/.ssh/config



          # Outside of the firewall, with HTTPS proxy
          Host 42.42.42.42
          ProxyCommand connect -H 127.0.0.1:1080 %h 22
          ## Inside the firewall (do not use proxy)
          Host *
          ProxyCommand connect %h %p


          Now you can try:



          ssh username@ipserver


          check ip connection



          netstat -tn 2>/dev/null


          normally you can see something like that



          Connexions Internet actives (sans serveurs)

          Proto Recv-Q Send-Q Adresse locale Adresse distante Etat
          tcp 0 68 69.69.69.69:22 42.42.42.42:42800 ESTABLISHED


          More skills



          Add this script to your ~/.bash_profile.



          SOCKS5



          export http_proxy=socks5://127.0.0.1:1080
          export https_proxy=socks5://127.0.0.1:1080


          OR



          HTTP(S)



          export http_proxy=http://127.0.0.1:1080
          export https_proxy=https://127.0.0.1:1080


          if you want setup webconnection for your Web browser



          Gui way (gnome)




          1. setting

          2. network

          3. proxy server

          4. enter your configuration

          5. don't forget to disable proxy for localhost


          enter image description here



          or just add all proxy redirection to your env



          env | grep -i proxy



          must be return



          HTTP_PROXY=http://127.0.0.1:1080/
          FTP_PROXY=http://127.0.0.1:1080/
          ALL_PROXY=socks://127.0.0.1:1080/
          NO_PROXY=127.0.0.1,localhost
          HTTPS_PROXY=http://127.0.0.1:1080/
          https_proxy=http://127.0.0.1:1080/
          http_proxy=http://127.0.0.1:1080/
          no_proxy=127.0.0.1,localhost
          all_proxy=socks://127.0.0.1:1080/
          ftp_proxy=http://127.0.0.1:1080/


          if you just want config curl through shadowsocks



          export socks5=socks5://127.0.0.1:1080


          and



          curl api.ipify.org


          For Git



          git config --global http.proxy 'socks5://127.0.0.1:1080'
          git config --global https.proxy 'socks5://127.0.0.1:1080'





          share|improve this answer























          • I'd like to add a note - if you are doing SSH for a user@my-server ( like when connecting to EC2 in the default way) then replace the server IP with the part at my-server
            – tt_Gantz
            Oct 17 '18 at 3:01











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          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',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f416010%2fssh-through-shadowsocks%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4














          If your configuration of shadowsocks is:




          • local address : 127.0.0.1

          • local port : 1080

          • server ip 42.42.42.42


          change for your own configuration



          sudo apt install connect-proxy


          Edit your ~/.ssh/config



          # Outside of the firewall, with HTTPS proxy
          Host 42.42.42.42
          ProxyCommand connect -H 127.0.0.1:1080 %h 22
          ## Inside the firewall (do not use proxy)
          Host *
          ProxyCommand connect %h %p


          Now you can try:



          ssh username@ipserver


          check ip connection



          netstat -tn 2>/dev/null


          normally you can see something like that



          Connexions Internet actives (sans serveurs)

          Proto Recv-Q Send-Q Adresse locale Adresse distante Etat
          tcp 0 68 69.69.69.69:22 42.42.42.42:42800 ESTABLISHED


          More skills



          Add this script to your ~/.bash_profile.



          SOCKS5



          export http_proxy=socks5://127.0.0.1:1080
          export https_proxy=socks5://127.0.0.1:1080


          OR



          HTTP(S)



          export http_proxy=http://127.0.0.1:1080
          export https_proxy=https://127.0.0.1:1080


          if you want setup webconnection for your Web browser



          Gui way (gnome)




          1. setting

          2. network

          3. proxy server

          4. enter your configuration

          5. don't forget to disable proxy for localhost


          enter image description here



          or just add all proxy redirection to your env



          env | grep -i proxy



          must be return



          HTTP_PROXY=http://127.0.0.1:1080/
          FTP_PROXY=http://127.0.0.1:1080/
          ALL_PROXY=socks://127.0.0.1:1080/
          NO_PROXY=127.0.0.1,localhost
          HTTPS_PROXY=http://127.0.0.1:1080/
          https_proxy=http://127.0.0.1:1080/
          http_proxy=http://127.0.0.1:1080/
          no_proxy=127.0.0.1,localhost
          all_proxy=socks://127.0.0.1:1080/
          ftp_proxy=http://127.0.0.1:1080/


          if you just want config curl through shadowsocks



          export socks5=socks5://127.0.0.1:1080


          and



          curl api.ipify.org


          For Git



          git config --global http.proxy 'socks5://127.0.0.1:1080'
          git config --global https.proxy 'socks5://127.0.0.1:1080'





          share|improve this answer























          • I'd like to add a note - if you are doing SSH for a user@my-server ( like when connecting to EC2 in the default way) then replace the server IP with the part at my-server
            – tt_Gantz
            Oct 17 '18 at 3:01
















          4














          If your configuration of shadowsocks is:




          • local address : 127.0.0.1

          • local port : 1080

          • server ip 42.42.42.42


          change for your own configuration



          sudo apt install connect-proxy


          Edit your ~/.ssh/config



          # Outside of the firewall, with HTTPS proxy
          Host 42.42.42.42
          ProxyCommand connect -H 127.0.0.1:1080 %h 22
          ## Inside the firewall (do not use proxy)
          Host *
          ProxyCommand connect %h %p


          Now you can try:



          ssh username@ipserver


          check ip connection



          netstat -tn 2>/dev/null


          normally you can see something like that



          Connexions Internet actives (sans serveurs)

          Proto Recv-Q Send-Q Adresse locale Adresse distante Etat
          tcp 0 68 69.69.69.69:22 42.42.42.42:42800 ESTABLISHED


          More skills



          Add this script to your ~/.bash_profile.



          SOCKS5



          export http_proxy=socks5://127.0.0.1:1080
          export https_proxy=socks5://127.0.0.1:1080


          OR



          HTTP(S)



          export http_proxy=http://127.0.0.1:1080
          export https_proxy=https://127.0.0.1:1080


          if you want setup webconnection for your Web browser



          Gui way (gnome)




          1. setting

          2. network

          3. proxy server

          4. enter your configuration

          5. don't forget to disable proxy for localhost


          enter image description here



          or just add all proxy redirection to your env



          env | grep -i proxy



          must be return



          HTTP_PROXY=http://127.0.0.1:1080/
          FTP_PROXY=http://127.0.0.1:1080/
          ALL_PROXY=socks://127.0.0.1:1080/
          NO_PROXY=127.0.0.1,localhost
          HTTPS_PROXY=http://127.0.0.1:1080/
          https_proxy=http://127.0.0.1:1080/
          http_proxy=http://127.0.0.1:1080/
          no_proxy=127.0.0.1,localhost
          all_proxy=socks://127.0.0.1:1080/
          ftp_proxy=http://127.0.0.1:1080/


          if you just want config curl through shadowsocks



          export socks5=socks5://127.0.0.1:1080


          and



          curl api.ipify.org


          For Git



          git config --global http.proxy 'socks5://127.0.0.1:1080'
          git config --global https.proxy 'socks5://127.0.0.1:1080'





          share|improve this answer























          • I'd like to add a note - if you are doing SSH for a user@my-server ( like when connecting to EC2 in the default way) then replace the server IP with the part at my-server
            – tt_Gantz
            Oct 17 '18 at 3:01














          4












          4








          4






          If your configuration of shadowsocks is:




          • local address : 127.0.0.1

          • local port : 1080

          • server ip 42.42.42.42


          change for your own configuration



          sudo apt install connect-proxy


          Edit your ~/.ssh/config



          # Outside of the firewall, with HTTPS proxy
          Host 42.42.42.42
          ProxyCommand connect -H 127.0.0.1:1080 %h 22
          ## Inside the firewall (do not use proxy)
          Host *
          ProxyCommand connect %h %p


          Now you can try:



          ssh username@ipserver


          check ip connection



          netstat -tn 2>/dev/null


          normally you can see something like that



          Connexions Internet actives (sans serveurs)

          Proto Recv-Q Send-Q Adresse locale Adresse distante Etat
          tcp 0 68 69.69.69.69:22 42.42.42.42:42800 ESTABLISHED


          More skills



          Add this script to your ~/.bash_profile.



          SOCKS5



          export http_proxy=socks5://127.0.0.1:1080
          export https_proxy=socks5://127.0.0.1:1080


          OR



          HTTP(S)



          export http_proxy=http://127.0.0.1:1080
          export https_proxy=https://127.0.0.1:1080


          if you want setup webconnection for your Web browser



          Gui way (gnome)




          1. setting

          2. network

          3. proxy server

          4. enter your configuration

          5. don't forget to disable proxy for localhost


          enter image description here



          or just add all proxy redirection to your env



          env | grep -i proxy



          must be return



          HTTP_PROXY=http://127.0.0.1:1080/
          FTP_PROXY=http://127.0.0.1:1080/
          ALL_PROXY=socks://127.0.0.1:1080/
          NO_PROXY=127.0.0.1,localhost
          HTTPS_PROXY=http://127.0.0.1:1080/
          https_proxy=http://127.0.0.1:1080/
          http_proxy=http://127.0.0.1:1080/
          no_proxy=127.0.0.1,localhost
          all_proxy=socks://127.0.0.1:1080/
          ftp_proxy=http://127.0.0.1:1080/


          if you just want config curl through shadowsocks



          export socks5=socks5://127.0.0.1:1080


          and



          curl api.ipify.org


          For Git



          git config --global http.proxy 'socks5://127.0.0.1:1080'
          git config --global https.proxy 'socks5://127.0.0.1:1080'





          share|improve this answer














          If your configuration of shadowsocks is:




          • local address : 127.0.0.1

          • local port : 1080

          • server ip 42.42.42.42


          change for your own configuration



          sudo apt install connect-proxy


          Edit your ~/.ssh/config



          # Outside of the firewall, with HTTPS proxy
          Host 42.42.42.42
          ProxyCommand connect -H 127.0.0.1:1080 %h 22
          ## Inside the firewall (do not use proxy)
          Host *
          ProxyCommand connect %h %p


          Now you can try:



          ssh username@ipserver


          check ip connection



          netstat -tn 2>/dev/null


          normally you can see something like that



          Connexions Internet actives (sans serveurs)

          Proto Recv-Q Send-Q Adresse locale Adresse distante Etat
          tcp 0 68 69.69.69.69:22 42.42.42.42:42800 ESTABLISHED


          More skills



          Add this script to your ~/.bash_profile.



          SOCKS5



          export http_proxy=socks5://127.0.0.1:1080
          export https_proxy=socks5://127.0.0.1:1080


          OR



          HTTP(S)



          export http_proxy=http://127.0.0.1:1080
          export https_proxy=https://127.0.0.1:1080


          if you want setup webconnection for your Web browser



          Gui way (gnome)




          1. setting

          2. network

          3. proxy server

          4. enter your configuration

          5. don't forget to disable proxy for localhost


          enter image description here



          or just add all proxy redirection to your env



          env | grep -i proxy



          must be return



          HTTP_PROXY=http://127.0.0.1:1080/
          FTP_PROXY=http://127.0.0.1:1080/
          ALL_PROXY=socks://127.0.0.1:1080/
          NO_PROXY=127.0.0.1,localhost
          HTTPS_PROXY=http://127.0.0.1:1080/
          https_proxy=http://127.0.0.1:1080/
          http_proxy=http://127.0.0.1:1080/
          no_proxy=127.0.0.1,localhost
          all_proxy=socks://127.0.0.1:1080/
          ftp_proxy=http://127.0.0.1:1080/


          if you just want config curl through shadowsocks



          export socks5=socks5://127.0.0.1:1080


          and



          curl api.ipify.org


          For Git



          git config --global http.proxy 'socks5://127.0.0.1:1080'
          git config --global https.proxy 'socks5://127.0.0.1:1080'






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 5 '18 at 19:20

























          answered Apr 5 '18 at 16:50









          Barre_k

          413




          413












          • I'd like to add a note - if you are doing SSH for a user@my-server ( like when connecting to EC2 in the default way) then replace the server IP with the part at my-server
            – tt_Gantz
            Oct 17 '18 at 3:01


















          • I'd like to add a note - if you are doing SSH for a user@my-server ( like when connecting to EC2 in the default way) then replace the server IP with the part at my-server
            – tt_Gantz
            Oct 17 '18 at 3:01
















          I'd like to add a note - if you are doing SSH for a user@my-server ( like when connecting to EC2 in the default way) then replace the server IP with the part at my-server
          – tt_Gantz
          Oct 17 '18 at 3:01




          I'd like to add a note - if you are doing SSH for a user@my-server ( like when connecting to EC2 in the default way) then replace the server IP with the part at my-server
          – tt_Gantz
          Oct 17 '18 at 3:01


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f416010%2fssh-through-shadowsocks%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Morgemoulin

          Scott Moir

          Souastre