How to Access your Raspberry Pi via SSH over the Internet (port forwarding)
HTML-код
- Опубликовано: 2 окт 2024
- Learn how to port forward so you can access your Raspberry Pi via SSH from anywhere in the world over the internet.
Find more at tonyteaches.tech
Check out my vlog channel @TonyFlorida
#raspberrypi #ssh #portforwarding
One friendly suggestion. Please draw network diagrams and corresponding animations to explain how the ports are forwarded or where the ports are open and where it needs to be forwarded.
I know in the video, the file hi.txt was new, so :wq is perfectly fine. Tip: Get in the habit of using :x instead of :q or :wq with vi variants. When just reading/viewing a file, using :x will exit without modifying the file's timestamp (useful with backup solutions that use in part, file timestamps for backups). Where as :q will modify the file's timestamp, regardless if the file was edited or not. Also, :x acts the same as :wq for modified files.
I've always used ZZ with the vi editor. If you've changed anything, it saves and exits, just like :wq. But if you haven't changed anything, it just exits, leaving the original file untouched. For me, as long as it isn't one of those "oh no I made a mistake" moments, it's the same keystrokes whether I changed the time, or it looked okay once I got in and looked at it.
Thanks, great video really clearly explains the solution in only 8 minutes!!
You're welcome Anthony
Well done !
How do you show your phone on the screen ?
Thanks
As a newbie, this video helps me perfect!!!!! Thanks I've subscribed and clicked thumbs up!!!!! Thanks!!!
Thank you so much for your support
Hi Tony
Thanks for the video about port forwarding.
As i have been struggling to get my raspberry pi to work over the internet with port forwarding.
Thanks for your video.
Peter
You're welcome! Thanks for subscribing
I rarely like stuff, but this gets one from me. Very good video, helped a lot. Thanks
You're welcome Ben
This is a great video. Thanks for making it. Could you also cover how to secure this connection, changing the ssh keys etc. TIA
Hi! Just a little heads up. I forwarded port 5900~5910:TCP on my modem (this port is for VNC) and was able to use my 'whatsmyIP' IP-adress as connection adress in VNC viewer. This was sufficient to be able to remotely control my RPi! For me, the SSH port did not work, so this might be a solution for anyone with the same problem! :) Cheers
Nice workaround :)
Weirdly, that worked, but ssh didnt. THANKS M8!
Maybe they blocked port 80 to encourage you to use HTTPS on 443. Did you check if they allow 443?
This video answered my questions perfectly. I just have one quick question. While researching port forwarding I've seen a lot of people online talking about risks to brute force attacks from outside. I just want to be able to SSH into and communicate over TCP with my raspberry pi while I'm in school. My pi is running Ubuntu Server 20.04.5. If I enable the firewall on my pi, do you think everything would be safe?
Edit: nevermind, I found out I could just set the Ubuntu firewall (ufw) to only accept tcp connections (and ssh) over port 22 coming from specific IPs. i have it set to only accept form my router and my laptop's local (home network) ip address. once i get to school i'll add my computer's local ip from their network. i *think* this will be safe.
what happen if you dont have static ip for your router? most isp wont give static ip for cheap internet subscription
don't expose SSH and RDP like this to the internet without hardening!
This is a long time after u posted ur video but I really hope u see and answer my question.
I don't really know and have my ip momorised at all times so I would like to connect to my ssh hosing my domain name, is that possible? And is there extra setup required or no?
man this is really helpful, easy and straightforward
He just gave us his IP adress...... hope nobody DDos' him
can you tell me how to give someone access to your pi using your router
This will only work with static ip not dynanic ip aadress
Do you need a static ip address to do any of this ?
Perfect, this it exactly what I was looking for. Answer to all my questions related to the remote ssh. Thank you kindly!
You are welcome!
Me too!
Don't expose SSH and RDP like this to the internet without hardening!
How to make router ip static without purchasing??
I tried some services like no-ip but when the router reboot or sometimes later the public IP get's changed and if I'm outside I don't know the public IP of my router then how I can ssh cause no ip also not changing the previous ip to new.
Plz help......
bro just revealed his full ip adress💀💀
no mention of security. there's bot farms out there checking all IPs they can find for port 22. Then they gonna brute force your usernames like root, admin, etc. Linux does not recommend changing root username, so you are kind of stuck. You could at least use a random port for ssh instead of 22.
Security by obfuscation is not a good technique
You can disable root login by modifying /etc/ssh/sshd_config and enforce login only with Public Keys which make brute force very expensive. But probably you will also need some firewall protection against floods.
Do you have to use the ports you listed? Thanks
You can technically ssh with any port
can you pls tell me how to give someone access to your pi with your public ip
Is that port number 22 you entered the internal or external port? I have both available for me to edit.
Nice video, I suposse if you have an active NGINX server running in the Raspberrypi, you will access directly to the web service developed?
Not sure I understand your question, but I do have a video about accessing an Nginx site on Pi here ruclips.net/video/AFeye1zLpFo/видео.html
Great video!
Will running a server on this port allow me to connect to it? Or is SSH different in some fundamental way?
I’ve only used it for remote connecting, so the concept isn’t landing for me
you could run a server on port 22 and connect to it through the url ipv4address:22 on your web browser
Would that be a problem if the user plans to setup IPFire on the same network?
I don't know, sorry
Is this safe ? I mean every other tutorial to do this uses a VPN, I don't know why if it's that simple !
thank you. I had my ssh server locally, but now that we can leave our houses again I need to be able to access it from elsewhere.....
on my router it says to input a LAN and WAN port should i just do 22 for both
Hey, thanks for the video.
Is it possible to access multiple local webserver??
You can make a new port number and assign it to http requests. Nothing they can do to stop it.
Not all the tutorials go as smooth as this one, even though I had another internet supplier it still worked fine. Thank you for the help.
hopefully he's using a VPN
if you ISP gave u a NAT'ed IP address to your router then it is impossible to do port forwarding.
Yeah, I faced this problem, at least I think so. Do you know if it's possible to circumvent it by using IPv6? Somehow I failed using IPv6.
if i have a pdf on the raspberry pi how do i view it on the phone?
But what I can do if the raspberry is connected with a 4G modem?
Can you port forward on your modem?
@@TonyTeachesTech I don't know how to do this. It's a USB modem 4 G
Can you also use other ports than 22?
Thanks you solved my problem with a simple explanation
Can we connect VNC as well ?
"St. Ignatius..." you a Jesuit?
Is there any kind of risk for doing this on a RaspberryPi 4, i don't think Raspberry has a firewall, and if it has it, it might not be as safe as the one in windows 10
Use ufw
If I want to ssh to 2 rpi How do I choose which one? 🤔 👍
how to enter wifi password for raspberry through phone using app or webserver??
Sorry I don't know
What to do if you have multiple raspberry pi’s?
u just change the hostname of the each raspberry pi differely
how do i do it with an arris att router
Umm my guy just showed us his public ip witch anyone can us to track him.
No worries, that was a temp IP that I'm no longer associated with :)
Xh
you should blur the IP address to avoid any DDoS
Nah, the IP is changing. When he uploaded the video it wasn't "his" IP anymore.
Bluh
great job. can you also set up two individual server/raspberry pi in your local network and access them both via port 22 or should each use a dedicated port?
Yes you can do that
Thanks Tony!!
Tony, you are incredible!
Hey, will it work if I don't have a real ip? Cause I have a shared ip
As long as you have ssh access (with a username and password) to the server
Thank you, i've been searching for a solution forever
You are welcome!
Is this safe to do? Is a VPN recommended?
A VPN won't help in this case. There is risk anytime you open a port to your local network.
Can you port forwarding proftpd?
I don’t know sorry
Thank you, very helpful!
You're welcome!
Thanks Tony
You're welcome!
Thanks a lot! :-)
You're welcome
How long that address though
What?
@@TonyTeachesTech I guess I didn't fully ask the question. How long does that address last. I really need to learn how to do Dynamic DNS. I still can't understand why we would need dynamic addresses with IPv6.
@@jonny777bike That will depend on the lease time defined by your internet service provider
hehe cox hehehe
😅