DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Set Up Network Parental Controls on a Raspberry Pi
  • Endpoint Security Controls: Designing a Secure Endpoint Architecture, Part 2
  • Building Resilient Networks: Limiting the Risk and Scope of Cyber Attacks
  • Detection and Mitigation of Lateral Movement in Cloud Networks

Trending

  • AI-Driven Test Automation Techniques for Multimodal Systems
  • Next Evolution in Integration: Architecting With Intent Using Model Context Protocol
  • Building an AI/ML Data Lake With Apache Iceberg
  • Is Agile Right for Every Project? When To Use It and When To Avoid It
  1. DZone
  2. Data Engineering
  3. IoT
  4. Accessing Raspberry Pi SSH and VNC From Outside of the Local Network

Accessing Raspberry Pi SSH and VNC From Outside of the Local Network

This article goes over the best methods to access Raspberry Pi or any embedded Linux-based device terminal and desktop remotely.

By 
Amit Ezer user avatar
Amit Ezer
·
Mar. 09, 21 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
21.4K Views

Join the DZone community and get the full member experience.

Join For Free

Raspberry Pi Single Board Computers are becoming more popular among both hobbyists and industrial IoT device vendors. Since its first announcement on February 29th, 2012, Raspberry Pi has made its way into hobby gaming consoles, industrial automation plants, smart avionics, and more.

Talking about IoT (both hobby and industrial/commercial level), the reason for integrating such a powerful microprocessor-based computer into a project or a product is the sheer processing power and expandability it brings to the table. What better way is there to let your Pi ‘talk to the world’ than to let it have a good, fast internet connection? Therefore, in this post, we will be discussing the options you have at hand on how to SSH into your Raspberry Pi from outside of your local network such as WiFi or LAN.

What’s SSH on Raspberry Pi?

*nix (Linux-based and Unix-based operating systems) have a fundamental feature to grant you access to your Linux server without having to physically visit the server or computer through the network. SSH stands for Secure Shell and is a secure communication protocol for executing commands remotely on a *nix based computer (i.e. system update commands, shutdown/reboot commands, etc.).

Why Would I Need to Access my Raspberry Pi Terminal and Desktop From the Internet?

There may be some situations in which you would like to connect to your Raspberry Pi (or any other Linux machine, for that matter) in order to do maintenance routing, such as updating or configuration, through SSH. From a local network perspective, this is as easy as typing ssh <username>@<ip address of Raspberry Pi> in a client such as Putty (i.e. ssh pi@192.168.1.16).

However, when it comes to accessing your Raspberry Pi device outside of your network, this becomes a hassle since the device might not have a public IP address. Therefore, there are multiple methods that solve the case and help us access the Raspberry Pi terminal and desktop outside of the local network.

3 Methods to Access a Raspberry Pi Remotely

1. Router Port Forwarding

If your router allows port forwarding, you may expose the port 22 (default port for SSH connections) to the internet and using your network’s IP address, create an SSH connection with the Raspberry Pi. Note that if your IP is dynamic (which most of the networks today are), you’ll not be able to connect when the IP of your network changes.

2. Using a Remote Desktop Tool to Remotely Log Into Your Raspberry Pi and Open a Terminal

There are tools such as Teamviewer and Anydesk that can be installed onto Raspberry Pis that provide remote desktop access to your Raspberry Pi desktop. You may connect to your Raspberry Pi through such a method and open a terminal window on your Pi and execute shell commands there. (Note that this method only applies to Raspberry Pis that have a desktop environment running, and is not possible with ‘lite’ versions of Raspberry OS.)

3. Going With a Ready-to-Use Plug-and-Play Solution

Upswift.io provides a ready-to-use free platform to remotely access the terminal or the screen of Raspberry Pi, or any Linux-based device – Beaglebone, Nvidia Jetson Nano, etc. After registration to the platform, and connecting the Raspberry Pi, you will have the option to access it remotely, without any need to open router ports, or being in the same network.

raspberry pi Network

Opinions expressed by DZone contributors are their own.

Related

  • Set Up Network Parental Controls on a Raspberry Pi
  • Endpoint Security Controls: Designing a Secure Endpoint Architecture, Part 2
  • Building Resilient Networks: Limiting the Risk and Scope of Cyber Attacks
  • Detection and Mitigation of Lateral Movement in Cloud Networks

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!