![]() Exercise caution, though, as you are opening up your Home network as well.Ĭurrently the tunnel doesn’t stay up for very long – perhaps an hour or so. You can use your Raspberry Pi to create a reverse tunnel tht allows you to access it from anywhere, assuming you have a cooperating hosted server on the Internet as a mutual meeting point for the ssh sessions. You’re potentially exposing your whole home network in creating a reverse tunnel like this so you really have to be careful. Make sure you modify the default passwords to your Pi before attempting this. With these settings my reverse tunnel has been up all day. Make sure you don’t have these mentioned a second time in that file. ![]() This goes into the /etc/ssh/sshd_config file. It didn’t help when I put them on my Amazon server. That same web page I cited above has the necessary settings. *Except that in my experience the reverse tunnel does not stay! It’s staying up less than two hours. > ssh −p 10000 it! You should be logged on after supplying the password to the pi account. Now to access your Pi from “anywhere,” log into your server like usual, then from that session, login to your Pi thusly: > ssh −f −N −R 10000:localhost:22 can even log out of your Pi now – this reverse tunnel will stay*. So I’m not going to talk about that method.įrom that session ssh to your hosted server using syntax like this: I find this easier and probably more secure than opening up ssh (inbound) on your home router and mapping that to the Pi. What you can do is to create a reverse ssh tunnel. My only contribution is in realizing that the Pi makes a good platform to do this sort of thing with if you are running it as a server like I am. ![]() I just copied what I saw in another post. I can’t really take any credit for originality here. This is the same assumption I used in describing the power monitor application. I eventually realized that the Pi could be accessed from anywhere, with one big assumption: that you have your own hosted server somewhere on the Internet that you can ssh to from anywhere. There’s this post on setting it up without a monitor, keyboard or mouse, and this post on using it to monitor power and Internet connection at my home. I’ve done a couple things with my Raspberry Pi. ![]() Reboot the RPi to test and you should be good to go.Editor’s 2017 note: Lots of great alternatives are discussed in the Comments section. This cron entry will open a screen on reboot with “reverse-ssh-tunnel” as the title, and issue the autossh command. While this works fine, there is a potential issue – if the RPi is rebooted/looses power for any reason, the tunnel will be gone so we need to automate the setup so that it will be fired up upon boot – we will use a crontab entry for /usr/bin/screen -S reverse-ssh-tunnel -d -m autossh -M 65500 -i /home/pi/.ssh/id_rsa -o "ServerAliveInterval 20" -o "ServerAliveCountMax 3" -R 11141:localhost:22 $ autossh -M 65500 -o ServerAliveInterval=20 -R 11141:localhost:22 Īutossh will use ports 6551 to send echo data over and back between server and host, and opening an ssh session on the public server to local port 11141 will tunnel back to the SSH port on the RPi Use autossh to open and maintain the tunnel.Ensure that passwordless SSH is working between the RPi and the server – plenty of guides online about how to do this.My solution was to use the RPi to manage the WeMo, and to have a reverse-ssh tunnel between the RPi and my public server. The Belkin cloud-y manager thing doesn’t seem to work (neither does IFTTT).As a pilot I put in a Raspberry Pi and got a Belkin WeMo Switch. I’ve been working to manage my place remotely as I tend to have irregular hours.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |