SSH Tunneling - Local & Remote Port Forwarding (by Example)

Поделиться
HTML-код
  • Опубликовано: 21 ноя 2024

Комментарии • 179

  • @antonimihailov8046
    @antonimihailov8046 4 года назад +78

    It is really, really great that there are still tech channels which actually share tech knowledge and don't just publish videos, such as "top languages to learn in 2025". I really hope you keep up with this great videos and don't become a slave to the algorithm.

    • @hnasr
      @hnasr  4 года назад +10

      Man tell me about it, I made a video last year ranting about videos claiming Top programming languages in 2020 ruclips.net/video/IjOjiF4_cQc/видео.html

    • @hnasr
      @hnasr  4 года назад +5

      Man tell me about it, I made a video last year ranting about videos claiming Top programming languages in 2020 ruclips.net/video/IjOjiF4_cQc/видео.html

  • @anothersonnyday936
    @anothersonnyday936 2 года назад +8

    The only guy on the internet that explains SSH port forwarding and remote port forwarding properly.

  • @ThanhTran-wf2jf
    @ThanhTran-wf2jf 2 года назад +9

    This is BY FAR the best explanation of local & remote port forwarding that I have seen anywhere. It makes it very clear exactly who is requesting what from where at each point in the request, and the separation of resources is most helpful ; most other explanations will have the requested resource and the ssh server be on the same host, not making it clear that the requested resource can actually be running on a different host. Huge thanks to you for sharing such a great video with us!

    • @DavidChandra
      @DavidChandra 8 месяцев назад

      Agree with you. This is the best tutorial video.

    • @Abinashdash17
      @Abinashdash17 4 месяца назад

      Completely agreed.

  • @maxteer2800
    @maxteer2800 2 года назад +4

    This covered in 7 minutes (only needed local) what I've been trying to understand for a couple weeks... I normally don't "research" on youtube, but your practical example was great. Thanks so much!

  • @iamjirho
    @iamjirho 5 дней назад

    Having difficulty to wrapped this concept around my head and you absolutely nailed the explanation!

  • @x7331x
    @x7331x Год назад

    I have read so many articles and I was really struggling understand what happens behind the scenes.
    Brilliant explanation and visuals, thanks you!

  • @callistachang8358
    @callistachang8358 4 года назад +41

    Hey there - I stumbled upon your video when I was looking up reverse proxies and I just wanted to say that you're such an excellent explainer! I see from your profile that you update frequently and consistently. Thank you for doing what you do, I'd definitely recommend this site to my friends when you cover topics they like!

    • @hnasr
      @hnasr  4 года назад +7

      Thank you soo much cal for taking the time to write this 🙏 very happy you like the content ! I try to upload frequently and i talk about topics that i am interested on

  • @abdalla_zaki
    @abdalla_zaki 2 года назад

    Man, you are the guru of back-end engineering

  • @nabeeltahir6013
    @nabeeltahir6013 Месяц назад

    this was such a clear and helpful explanation. I have been struggling with this concept for a while but you broke it down perfectly. Thank you for making it so easy to understand

  • @LukePammant
    @LukePammant Год назад

    Awesome explaination! I read (*skimmed*) 5 articles on local vs remote port forwarding and didn't grok it until I saw your visuals. Thanks for this!

  • @rvoros
    @rvoros 2 года назад +6

    Clear, to the point, no BS explanation.
    Well done!

  • @АртемВовченко-у6е
    @АртемВовченко-у6е 15 дней назад

    Wow, such an amazing explanation! Thank you a lot! Finally, I have understood ssh port forwarding:)

  • @gillfromamritsar
    @gillfromamritsar 4 года назад +4

    Great Video, I am using this technique to create tunnel from my local to server, additionally, I am using "-fNL" params. The -f option tells the ssh command to run in the background and -N not to execute a remote command.

    • @hnasr
      @hnasr  4 года назад

      jatin seth thanks Jatin for sharing! Nice tips 👍

  • @Abinashdash17
    @Abinashdash17 4 месяца назад

    super super helpful. This single video cleared all the confusion I had about local and remote port forwarding. Thanks man!!!

  • @hashithbandara111
    @hashithbandara111 2 года назад

    i can understand this lesson very well because of terminal practice of you

  • @demandelz
    @demandelz 3 года назад +2

    Thank you sir. This was exactly what I needed. I don't know why on Earth I had so much trouble building a remote ssh tunnel, but I did and it was only after viewing your video that I was able to get everything working solidly. Once again thank you for the clear explanation.

  • @noahwilliams8918
    @noahwilliams8918 4 года назад +4

    Thank you for making this video Hussein! I've been trying to wrap my head around remote port forwarding for the longest damn time. I live in an area with shared wifi and I've been looking forever for a way to circumvent the stupid firewall so I can get some of those sweet sweet LetsEncrypt certs for my Raspberry Pi's!
    I've watched so many videos on this and not found a single one that isn't either a) using PuTTY on Windows, which is useless since it doesn't show which command line args to use or b) a purely conceptual explanation with no examples or instructions!

    • @hnasr
      @hnasr  4 года назад +2

      Noah Williams thanks Noah! Glad I could help. This concept is very complex believe me I go back to my videos all the time to remember how I did things. So i try to put the commands .. which reminds me must make sure i put it on this YT description

  • @gangstaberry2496
    @gangstaberry2496 5 месяцев назад

    This is the best explanation I have found so far... Thank you so much ^^

  • @leamon9024
    @leamon9024 2 года назад

    The best ssh tunneling tutorial ever!!! Thanks for your hard work, Hussein.
    Could you also talk about dynamic tunneling if possible?

  • @securiosityy
    @securiosityy Год назад

    This is a really good explanation of SSH tunneling and port forwarding! Unfortunately one can only appreciate the accuracy after seeing so many very confusing and even incorrect explanations on RUclips. It's important to get the terms right and use proper examples (e.g. "local" or "remote" from which machine's perspective) and where the connection is initiated etc. Too often something like "SSH -R 1080:localhost:1080" is used which is the worst way, as students can't see which machine each component is referring to and what's actually happening here. So, thank you for going the extra mile with the diagrams and being careful with how you use the terminology.

  • @anirbandutta1371
    @anirbandutta1371 4 года назад

    Understood very well ..Thank you ... To make things very very clear and less confusing you could have used a cloud VM for public SSH server ...

  • @meryemeaitahmed-brahim3082
    @meryemeaitahmed-brahim3082 Год назад

    Your video helped me understand a lot of things, thank you!

  • @bjornotto98
    @bjornotto98 3 года назад +1

    Thanks, definately had a woah moment when the web interface of process on my aws server popped up
    So usefull!

  • @SkreenGG
    @SkreenGG 4 года назад +1

    Wow, this was a great video, I was able to learn a lot from this. Great examples, and great and clear speech. Thank you very much for this brother.

    • @hnasr
      @hnasr  4 года назад

      Glad you enjoyed it!

  • @varghapayandeh3024
    @varghapayandeh3024 3 года назад +1

    Also a wonderful video with explanation and examples. Thank you!

  • @RM-cv4tl
    @RM-cv4tl 4 года назад +1

    You explained that very well. Thank you

    • @hnasr
      @hnasr  4 года назад

      R M thanks😊 appreciate it!

  • @hugh1a001
    @hugh1a001 3 года назад +1

    This was extremely well explained and easy to understand. You have a calling as a teacher I believe ;)

  • @jorgensenabrahamson6479
    @jorgensenabrahamson6479 4 года назад +2

    I don't have a public dynamic ip. My ISP shares my IP with others, it means I am behind a NAT. I tried to use remote port forwarding to see my DVR and NAS, but the problem is that I can not publish ports in my router. In the example described in the video that tunne it's not needed, you could configure the router to forward the ports of that internal resource with out needing a 3rd party server. However, I am able to see a port of an external database server and see it as a local resource.

    • @hnasr
      @hnasr  4 года назад +1

      Ill make a video on this topic you can use ngrok.io

    • @jorgensenabrahamson6479
      @jorgensenabrahamson6479 4 года назад

      @@hnasr I evaluated that solution but it's limited :( thanks for your really quick answer

    • @hnasr
      @hnasr  4 года назад

      Yes it is very limited and terminates your connection.. best way is to purchase a tiny vm from linod

    • @jorgensenabrahamson6479
      @jorgensenabrahamson6479 4 года назад +1

      @@hnasr what could I do with that? I have my own server in cloud at cost, that's where I tryied to do the tunneling solution , what do you suggest to install to achive my purpose?

    • @jorgensenabrahamson6479
      @jorgensenabrahamson6479 4 года назад

      I'll try this superuser.com/questions/277218/ssh-access-to-office-host-behind-nat-router

  • @dffabryr
    @dffabryr 2 года назад

    Excellent explanation Hussein !! Thank you

  • @amrhussein1677
    @amrhussein1677 2 года назад

    Many thanks man for this simple way 👏🏻

  • @acooper978
    @acooper978 3 года назад +1

    Thanks for this! You have a really good way of explaining things. Appreciate it :)

  • @mostinho7
    @mostinho7 3 года назад +1

    2:00 local vs remote port forwarding
    5:00 Clear example of local port forwarding
    Forwards local traffic originating from my machine to a public ssh server which then forwards it to the private server we’re accessing.

  • @palaniappanrm6277
    @palaniappanrm6277 4 года назад +3

    This was an eye opener for me. This is so powerful actually. But the public SSH servers available will actually block these stuffs right?

    • @hnasr
      @hnasr  4 года назад +1

      Glad its helpful! correct its rare to find a public ssh server that has port 22 open but very easy to spin one up with a $5 droplet from cloudflair even cheaper

  • @yousofebneddin7430
    @yousofebneddin7430 4 года назад +6

    this is exactly what I needed. Thanks.

  • @yogeshbavishi64325
    @yogeshbavishi64325 3 месяца назад

    Thanks for such a greate explanation🎉

  • @vladislavkaras491
    @vladislavkaras491 Год назад

    Really thanks for the explanation!
    It was great!

  • @davidfernandotorres3484
    @davidfernandotorres3484 2 года назад

    Love your video bro! Keep working on them 💪🏼💪🏼

  • @i.i
    @i.i 2 года назад

    thanks alot

  • @TyphoonBeard
    @TyphoonBeard 4 года назад +2

    Thank you very much for the great explanation! I have been wondering, if it is possible to achieve the same thing (hosting a web server) if my router gets a private IP from the ISP... I just cannot find a straight forward tutorial or explanation, how this thing may work. In your use case, if I understood correctly, you use the public IP of the router, but mine is private as it doesn't match with the IP what I see from "outside" ip tracking webpages, and the port forwarding simply doesn't work.

    • @marcelo_luz
      @marcelo_luz 3 года назад

      Im also interesting to know about it, since i dont have a static IP and my ISP blocked the majority of the ports.

    • @TyphoonBeard
      @TyphoonBeard 3 года назад +1

      Marcelo, the only option I found is, to use a service like ngrok or other alternatives with similar functionality. Basically it is a service, which creates a channel between your server and an external hosting service. The mentioned one has some free possibilities, so you can try it out just by creating a free account. For a paid plan you can also create your own domain if you like. I hope this helps a little. Cheers!

    • @marcelo_luz
      @marcelo_luz 3 года назад

      @@TyphoonBeard thank Florián, I'm here breaking my head.. at the moment I'm trying ngrok without success. Actually I just wanna turn on my computer over the lan (Wake on LAN remotely - WOL/WOW).

  • @m3ntas
    @m3ntas 2 года назад

    Very well explained dude. Thnk u so much!😉

  • @noambitions
    @noambitions 3 года назад

    Good video! What's the software that produce the red mouse pointer trailing in your video BTW?

  • @ishanmisra5336
    @ishanmisra5336 3 года назад

    You are a nice person... : Stay awesome...

  • @AshutoshKumardevx
    @AshutoshKumardevx 3 года назад +1

    Super Video, Exactly what I need!

  • @soldadopreciso
    @soldadopreciso 3 года назад

    Thanks pal, greetings from Ecuador.

  • @bionic1039
    @bionic1039 4 года назад

    I think I love you.
    Subscribed, liked, and added to favourites, GOOD JOB BRO, thank you very much!

    • @hnasr
      @hnasr  4 года назад

      Bionic ❤️❤️ *sending love back * enjoy the content

  • @BradMore
    @BradMore 4 года назад

    Thanks for the nudge in the right direction ... helped!

  • @إبراهيمالهلالي-ش7ش

    when i heard RRRRRouter i immediately glanced to the channel name , lol

  • @super3d201
    @super3d201 Год назад

    Thanks for this great video, it helped alot.

  • @breakersun
    @breakersun Год назад

    So clear my man. Thank you

  • @leongszekim1727
    @leongszekim1727 3 года назад

    Very detail explaining, thanks

  • @морс-ф3д
    @морс-ф3д Год назад

    Brilliant tutorial!!!!!!!!!!!!!!!! Thank you Hussein!)

  • @omarjarkas2175
    @omarjarkas2175 3 года назад

    Thanks for the video Hussein

  • @gnanaprakash-ravi
    @gnanaprakash-ravi 3 месяца назад

    Great video, really helped, thanks!!

  • @cipherswami
    @cipherswami 3 года назад

    awesome, got everything in the shot !!!

  • @mohammade.8770
    @mohammade.8770 4 года назад +2

    Been waiting for this.
    Great video by the way

    • @hnasr
      @hnasr  4 года назад

      Enjoy 😊

  • @aerospace_andy
    @aerospace_andy 4 года назад

    Thank you Hussein, I learned a lot ! Can you tell me how to know which ports I have?

    • @hnasr
      @hnasr  4 года назад

      Thanks Andrea! I think you can run netstats -a on windows or mac?

    • @aerospace_andy
      @aerospace_andy 4 года назад +1

      @@hnasr I see, thanks. I got a huge list on Linux now. My question might be not accurate. Like how do I know from that huge list on which I can use?

  • @kudorgyozo
    @kudorgyozo 4 года назад

    Excellent explanation

  • @TechnicalHeavenSM
    @TechnicalHeavenSM 4 года назад

    Nice explained.. But I have a problem.. What do I do if I have access to only one device on the private network (in which my web/game server is running)?

  • @carloscoliver9427
    @carloscoliver9427 4 года назад +1

    Wello Done, bro... Awesome Explanation!!

    • @hnasr
      @hnasr  4 года назад

      Thanks Carlos 😊🙏

  • @cygnemignon5507
    @cygnemignon5507 2 года назад

    Thank you ! fantastic explanation :)

  • @arslanahmedqureshi2964
    @arslanahmedqureshi2964 2 года назад

    i believe the local port forwarding is more confusing to me 😅

  • @clapandslap
    @clapandslap 3 года назад

    Thanks a lot! That's pretty clear and useful.

  • @carsonyuh
    @carsonyuh 3 года назад

    this helped me a lot. thank you.

  • @nansenejames8219
    @nansenejames8219 2 года назад

    Thanks dear it helped me alot

  • @danyvangoch3586
    @danyvangoch3586 3 года назад

    Really good video. Thank you!

  • @codyabel4766
    @codyabel4766 3 года назад

    fantastic video up until 7:45 when you jumped lightyears ahead and explained backwards...

    • @codyabel4766
      @codyabel4766 3 года назад

      yes, far too long of a jump from the beginning of the video to the next portion starting at 7:45

  • @bestcodepractice7898
    @bestcodepractice7898 3 года назад

    Thank you soo much brather i hoop you happy

  • @tushargoel5049
    @tushargoel5049 7 месяцев назад

    Hi Hussein
    Even if we do not use ssh command to access the remote server, we can still access it by making a TCP req on public ssh server on port 22, right?

  • @mo.downhill6760
    @mo.downhill6760 4 года назад

    هلاوالله بحسين، لهجتك فله 👌

    • @hnasr
      @hnasr  4 года назад

      ❤️ هلا ولله

  • @NoONE-bk7ud
    @NoONE-bk7ud 6 месяцев назад

    Apr 28 2024, good video

  • @michaelcastanaro3760
    @michaelcastanaro3760 3 года назад

    Great explanation, Hussein. Thank you!

  • @mohamedirfan2816
    @mohamedirfan2816 2 года назад

    Thankyou so much!

  • @decoder6878
    @decoder6878 3 года назад +1

    Great video👌🏻

  • @aymanpatel5862
    @aymanpatel5862 3 года назад

    Can you do a video on Dynamic port forwarding using SOCKS5 protocol?

  • @mahdibouguerzi
    @mahdibouguerzi 6 месяцев назад

    Thank you!

  • @sharkdavid
    @sharkdavid 2 года назад

    This was great Thanks ✌

  • @suzieq8379
    @suzieq8379 9 месяцев назад

    this man worked on my pc he has connected to my local network , he thought I didn't know but I figured it out he is in control of my MacBook, I don't really understand all this but this is what I have on my network I also have 3 utun,. I figured out he made a tunnel like using a vpn to bypass my firewall how in the world am I ever going to get him out of my network..

  • @founderofisis6627
    @founderofisis6627 4 года назад

    Hey you got some cool stuff. Thanks!!

  • @ganges6661
    @ganges6661 3 года назад +1

    Yah habibi. I love the accent. Thank you for the video!

  • @waiphyotun7633
    @waiphyotun7633 2 года назад

    thank you sir

  • @pdamiano
    @pdamiano 4 года назад +1

    amazin video, TY !!!!

  • @nixexd
    @nixexd 2 года назад

    Hi Mr. Hussein. I like to ask some Question. How to fix Connection refused when run the ssh command and fix bad local forwarding specification 'ip adress'?

  • @yasirmaqsood9260
    @yasirmaqsood9260 3 года назад

    do we have to install frontier communications or what. I am completely new. Kindly guide

  • @sohamroy6004
    @sohamroy6004 4 года назад

    thank you for making such a great content

  • @lands1459
    @lands1459 3 месяца назад

    i'm trying to forward something from my NAS on port 8080 and i'm doing ssh -R 8080:localhost:8080 user@ip and i can't seem to connect to it from ym vps when i connect to the VPS IP address. do i have the wrong IP? if i do this on my PC, i can forward anything on the PC to my VPS as long as i'm connected to wireguard and if that user connects to my internal wireguard IP (10.190.x.x)

  • @BaoTran-jo8lj
    @BaoTran-jo8lj Год назад

    Hi I am new to this field. May I ask if I open GateWay publically, will there be some hackers have an ability to access my server? Thanks.

  • @TanuKart
    @TanuKart 4 года назад +1

    How to set up Remove Port Forwarding if your ISP also blocks SSH access remotely?

    • @hnasr
      @hnasr  4 года назад

      Interested to know how do they block it.. wonder if it is on the port.. can you change port 22 and run openssh on a custom pprt?

    • @TanuKart
      @TanuKart 4 года назад

      @@hnasr Looks like they block all ports for incoming traffic. Even ports such as 80, 21,22, 23. I've tried them all

  • @varghapayandeh3024
    @varghapayandeh3024 3 года назад

    What is "raspberry2" pointing to. I mean, do you have that in your hosts file to be something like 127.0.0.1?

  • @deepak.rocks.
    @deepak.rocks. 3 года назад

    Do video about reverse ssh

  • @DaRKeN58
    @DaRKeN58 4 года назад

    How do I do this with nginx in WinNMP, a step by step please, thank you very much.

  • @supa1954
    @supa1954 3 года назад

    So i setup Pi-Hole on my Raspberry pi, with Pi-Vpn to install openvpn alongside my Pi-hole then i logged into my router made it a static ip, now im trying to setup port forwarding to the raspberry pi on port 1194 that openvpn uses
    What confuses me is my router asks for a internal host ip which i set to my Raspberry Pi's ip, and external host ip, i ended up leaving the external host ip blank, im trying to access my Pi-Hole Adserver while im at work does that require me to put a ip for the external host? I made my internal port, and external port 1194

  • @diegoc8083
    @diegoc8083 3 года назад

    Awesome! Thanks

  • @syedhannan546
    @syedhannan546 Год назад

    is the same possible to do using putty settings?

  • @mohamedshahrul1750
    @mohamedshahrul1750 5 месяцев назад

    for remote port forwading why are using two machines 10.0.0.3:8080 and 10.0.0.4? by the way 10.0.0.4 is not even used in the SSH command. can u please clarify?

  • @foxmulder9240
    @foxmulder9240 4 года назад

    Can I use port forwarding to bypass my router to use a VPN without unplugging everything? I think I would have to restart my modem every time to connect to my computer every time as well. A hassle. I have an Archer A6, I got from a friend, because it wouldn't work with Nord. Would a network switch work? Thanks.

  • @Eagle-md6ku
    @Eagle-md6ku 4 года назад

    Why did you have to create a name for your machine's IP on the public DNS server? (The noIP website @ 8:33) Is this a required step or can I just use the SSH server's IP?

    • @hnasr
      @hnasr  4 года назад

      No reason you may use the public IP address just wanted an easy way to write it down

  • @jasperzanjani
    @jasperzanjani 3 года назад

    1:07 "temperally"

  • @ritwickdey97
    @ritwickdey97 4 года назад +1

    Next VPN Tunnel please..!!

    • @hnasr
      @hnasr  4 года назад

      🙏🙏

  • @HOOHA333
    @HOOHA333 2 года назад

    On @9:05 I did not get one thing, when someone login using user ID pi on your machine, not on raspberry pi, how after logging in we reached to raspberry pi ?

  • @jivanmainali1742
    @jivanmainali1742 4 года назад

    So remote port forwarding only in case of when we want world to access our local server.