Accessing RPi2 remotely


I wonder if there is any kind soul who could help with remote access?

I have very basic Linux knowledge, but I’d like to access my RPi2 from abroad (using Mac OS) and effectively use it as a ‘dropbox’ with a USB stick/HDD attached to the RPi.

What is the best/easiest way to do this? How secure would it be?

Many thanks,

Hi Rich,

I don’t have a clue myself but here is a good place to start!:

Hope it helps!. :smiley:

1 Like

Thanks, that’s a handy resource…I’ll start digging.

I’d not considered a remote desktop instead of an ftp-type setup.

Has anyone successfully set something like this up?

I came across I wonder if anyone rates this software?

Thanks again.

It depends what you're aiming to do with your Raspberry Pi remotely. Accessing files or control it just like you was sat in front of it?

File Server

  • FTP would be the least secure, since it authenticates in plain text.
  • SSH (Secure Shell) would be a good option, and it's enabled by default.
  • While it can be used for accessing a terminal remotely, it can also be used to explore your file system (SFTP) - I do this all the time over the LAN!
  • While Mac does not support this protocol in Finder out of the box, there are a few ways to mount the remote folder.

Web Server

  • You can configure a HTTP (web) server that runs a service for you - OwnCloud is great for this (like your own Dropbox that's under your control).

Remote Desktop

  • VNC on its own is not actually very secure, but there are ways to do that by using it over SSH for instance.
  • RDP is Microsoft's protocol as used on Windows, but it negotiates its security so it should be pretty secure. As you use OS X you can install a client (stand alone / App Store)
  • All you need is to install xrdp on the Pi, and then connect to it's IP address using the client. Note that this spawns a session in the background, so someone could be still using the Pi physically at the same time.
  • X2GO is avaliable in the Software Boutique, this uses SSH and the X protocol to run a remote session.
    • X is the display server that also produces your physical screen.

Over the Internet: Port Forwarding

You say you'd like to access from aboard, whichever protocol you use, the ports need to be forwarded on the router to the IP of the Pi. There's plenty of documentation out there, and will mean setting up rules in your router's configuration page. Remember to set a static IP for the Pi too, otherwise it may redirect to a completely different device.

:earth_africa: :computer: :smile: → 123.456.789.10 : 22:house: → : 22:computer:

Here's the ports used:

  • 21 = FTP (File Transfer Protocol)
  • 22 = SSH (Secure Shell)
  • 80 = HTTP
  • 3389 = RDP
  • 5900 = VNC

For a bit of extra protection, use a different port for the outside world, it stops hackers from easily trying random IP addresses and brute force their way in.

To connect, you just need your public IP address and connect via your chosen port. :thumbsup:


Wow, thanks for that in-depth reply…much appreciated.

To answer your question, I don’t think I need to see the desktop but it’s an interesting add-on if it’s not too difficult.

I actually have a synology NAS, which I can access remotely but I have some misgivings about having all my data (albeit not very interesting, photos etc) connected to the www. So I was thinking about just having that on an internal LAN, separate from the LAN which is connected to the web? Hence, I’d want something quite simple (RPi+USB stick?) if I needed to access some files from abroad.

I don’t think I need a traditional ‘Cloud’ server (i.e. one that synchronises files across devices), but I do like the sound of open source alternatives like Syncthing that use bit torrent.

Maybe something like Owncloud would be the best option, as I don’t really need to use the RPi as a ‘desktop’ computer at home anyway.

Again, thanks so much for sharing your expertise!


1 Like

@RichT Since you mentioned ownCloud, you might find the following useful - Western Digital And ownCloud Team Up To Bring ownCloud to Home Users.

1 Like

Next to the Raspberry Pi Remote Access recomendations, and in the case you want to access UbuntuMATE’s desktop environment with a VNC client, follow the additional steps:

  1. On the shell prompt, type: sudo apt-get install tightvncserver

  2. With you favorite text editor,create a text file “/etc/lightdm/lightdm.conf” with the following contents:


The value of width and height describes the window resolution when connecting with a VNC client. Other width x height working resolutions are possible with: 800x600, 1024x768, 1152x854, 1280x768, 1280x800, 1280x960, 1280x1024, 1400x1050, 1440x900, 1600x1200, 1680x1050, 1792x1344, 1856x1392, 1920x1200, 1920x1220, 2560x1600.

  1. On the shell prompt, type: sudo /etc/init.d/lightdm restart

  2. Then use your favourite VNC client, and type as target host i.e. “mypi.local” without precising any port number

Hope this helps :wink:


That’s just the type of thing I need, plug and play!

I wish I could code…

Thanks rohithmadhavan!

Thanks Carriba,

You’ll have to forgive my ignorance… when you say ‘additional steps’, do you mean on top of setting something else up?

Or are those 4 steps all I need to do to access remotely? Would that work when not connected to the LAN?

Many thanks,

Yes, if you want to have access to the UbuntuMATE desktop with a VNC client, than you need to install and setup the Tight VNC Server application. (Mac OS has a built-in VNC client, so you’re fine here.)

The VNC server application is not installed by default on the RPi 2 B device and is required if you want to gain GUI access.

By default, UbuntuMATE, assumes that you have hooked up a physical monitor on your RPi 2 B device, which is, of course, mandatory during the 1st run when you setup the UbuntuMATE OS.

HI when attempting to create lightdm.conf I get ‘permission denied’, even using sudo, any tips? Thanks

Try “sudo su -” to change to the superuser account, and then edit the file with your favourite editor. This ought to be working…

A post was split to a new topic: Locked out of Ubuntu MATE after installing tightvncserver