Germ8mm
Posts: 12
Joined: Mon Dec 30, 2013 8:53 pm

Access RPi anywhere

Mon Jan 20, 2014 3:33 am

I must be wording something wrong but I cant find anything for accessing your RPi from anywhere over the internet. Basically making the RPi a "Dropbox" connected to a external HHD. I want it for a storage data base or have the ability to stream from it, I know the RPi probably cant perform well like that but understanding the concept is what is good for me. I have already done the tutorial for home networks http://www.youtube.com/watch?v=WgcNBjIJNYs which was fun but not really what I wanted. Any terms or old post you guys could show me?

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: Access RPi anywhere

Mon Jan 20, 2014 4:30 am

1. Set up an ssh server on your Pi (it's probably there already)
2. Set up your home router to forward port 22 to the Pi's IP address on your home network
3. Use ssh client software on your PC out in the world to connect to your ISP-provided WAN IP address

This is particularly easy if you use Linux on your PC, since it has a lot of ssh tools integrated. But you can use something like PuTTY on Windows to get a terminal login to the Pi, and other ssh capable programs for file transfers.

peewee2
Posts: 57
Joined: Sun Apr 14, 2013 7:04 pm

Re: Access RPi anywhere

Tue Jan 21, 2014 10:42 pm

I can see why you would want to do this, you can't store much in a free Dropbox account.

There are several issues with doing what you intend.

As a general rule, broadband networks are asymmetrical, the download speed may be 8Mbit, but the upload speed is probably only 350Kbit, that's 40KBytes/sec, so streaming will be pretty limited, you certainly won't stream video, a 100meg file is going to take 40 minutes to download.

To do a "dropbox" you need to develop a client app for each of your clients as well as a server app. The best I think you can do is configure the pi as a svn server, there are off the shelf svn clients for most types of computer

How are you going to stop others getting access to your stuff, to use svn or anything else, you need to open up a port on your router (carefully), but if you want to access your stuff from anywhere, things become difficult, you then need to use certificates or similar....

Pete

HiroProtagonist
Posts: 211
Joined: Sat Jun 29, 2013 9:45 am

Re: Access RPi anywhere

Wed Jan 22, 2014 11:29 pm

ame wrote: 2. Set up your home router to forward port 22 to the Pi's IP address on your home network
If you open up port 22, you'll get hit by endless attempts to log in as 'root'. If you get your router to forward a different port to port 22 on your pi, things will be quieter - you'll need to specify the port number when you use ssh outside your network.

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: Access RPi anywhere

Thu Jan 23, 2014 12:44 am

HiroProtagonist wrote:
ame wrote: 2. Set up your home router to forward port 22 to the Pi's IP address on your home network
If you open up port 22, you'll get hit by endless attempts to log in as 'root'. If you get your router to forward a different port to port 22 on your pi, things will be quieter - you'll need to specify the port number when you use ssh outside your network.
If you open *any* port you will be hit by endless attempts to log in as root. As long as your ssh server is secure then it won't actually matter.

User avatar
DougieLawson
Posts: 30431
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Access RPi anywhere

Thu Jan 23, 2014 12:49 am

HiroProtagonist wrote:
ame wrote: 2. Set up your home router to forward port 22 to the Pi's IP address on your home network
If you open up port 22, you'll get hit by endless attempts to log in as 'root'. If you get your router to forward a different port to port 22 on your pi, things will be quieter - you'll need to specify the port number when you use ssh outside your network.
It doesn't matter what port you open. The hackers will try ALL protocols on ALL open ports ALL day every day. They don't care how it affects your machine, they're looking for insecure systems that can be exploited as part of the botnet, so what if your RPi/Ubuntu/Mac/Windows machine crashes - they'll move on and come back next week to try again.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

writerbenjamin
Posts: 4
Joined: Fri Jun 15, 2012 5:53 am

Re: Access RPi anywhere

Thu Jan 23, 2014 5:42 pm

You also should probably make it so root can't logon to the pi. I did it and I can always ssh as a user (not pi) and sudo any root item. If I really need to be root, I can su to root, but sudo is safer.

Here are some instructions on how to disallow root to log on via ssh: http://www.howtogeek.com/howto/linux/se ... -on-linux/

I'd also add a new user with the same groups and permissions as the pi user and remove the pi user or at least change the password to something other than raspberry.

keithellis
Posts: 140
Joined: Thu Dec 12, 2013 10:39 pm
Location: Suffolk, UK
Contact: Website

Re: Access RPi anywhere

Thu Feb 06, 2014 2:23 pm

writerbenjamin wrote:You also should probably make it so root can't logon to the pi. I did it and I can always ssh as a user (not pi) and sudo any root item. If I really need to be root, I can su to root, but sudo is safer.

Here are some instructions on how to disallow root to log on via ssh: http://www.howtogeek.com/howto/linux/se ... -on-linux/

I'd also add a new user with the same groups and permissions as the pi user and remove the pi user or at least change the password to something other than raspberry.
I've already done what you mentioned, i.e. disabled root login on SSH, disabled login on pi user account and I've created a new user account which I use and given myself sudo access by editing /etc/sudoers.

Are there any other permissions the standard Pi users gets which I should give to my new user?

User avatar
Richard-TX
Posts: 1545
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: Access RPi anywhere

Thu Feb 06, 2014 2:40 pm

Yes, assign a password to the root account and take out your ability to use sudo and use su.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

User avatar
RaTTuS
Posts: 9588
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Access RPi anywhere

Thu Feb 06, 2014 2:42 pm

login via ssh keys and not username | password
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

achrn
Posts: 233
Joined: Wed Feb 13, 2013 1:22 pm

Re: Access RPi anywhere

Thu Feb 06, 2014 3:27 pm

At the moment 95% of the probes I'm seeing to port 22 on my exposed IP addresses are from port 6000. So you could set your router to forward connections to port 22 but not ones that have a source port of 6000. It probably doesn't actually make the pi more secure, but it reduces the guff in the logs.

(If you can't do it at the router, you could still do it in iptables at the pi as a discrete rule before any logging, again for purposes of reducing log volume.)

keithellis
Posts: 140
Joined: Thu Dec 12, 2013 10:39 pm
Location: Suffolk, UK
Contact: Website

Re: Access RPi anywhere

Thu Feb 06, 2014 3:37 pm

Richard-TX wrote:Yes, assign a password to the root account and take out your ability to use sudo and use su.
Yes I have assigned root a password, but I want to use sudo with the new account so have enabled this.

The question I asked was if I needed to assign any other permissions to my new user account to replicate the default permissions given to the standard Pi account.

stefanopi
Posts: 3
Joined: Fri Nov 03, 2017 1:51 pm

Re: Access RPi anywhere

Fri Nov 24, 2017 9:20 am

Hello,

check out this link:

http://www.raspberryanywhere.com/

Perhaps it can be of some help. I'v been using the service from several weeks and it works great!

The link provide a simple software teamviewer like to access your raspberry board anywhere you are. Furthermore, you can use your usual SSH client; they just provide a virtual address to connect to your board via SSH or HTTP . It worths a try for sure!

sora03
Posts: 118
Joined: Mon Dec 29, 2014 4:11 pm

Re: Access RPi anywhere

Fri Nov 24, 2017 10:32 am

if you are going to open ssh port to the world you should install a firewall (ufw) and Intrusion Detection/Prevention System like Fail2ban (don't mind the name its a hack) to block brute forcers be careful to not ban yourself

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 18199
Joined: Sat Jul 30, 2011 7:41 pm

Re: Access RPi anywhere

Fri Nov 24, 2017 10:58 am

stefanopi wrote:
Fri Nov 24, 2017 9:20 am
Hello,

check out this link:

http://www.raspberryanywhere.com/

Perhaps it can be of some help. I'v been using the service from several weeks and it works great!

The link provide a simple software teamviewer like to access your raspberry board anywhere you are. Furthermore, you can use your usual SSH client; they just provide a virtual address to connect to your board via SSH or HTTP . It worths a try for sure!
Necro'd an old post, and your two other posts posts advertise the same servce.

Spammer. Goodbye.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

Return to “Networking and servers”

Who is online

Users browsing this forum: No registered users and 20 guests