Keeping a connection with remote computers - ssh

I have a series of RPi's running Raspian which need to deployed in various location around the world.
They will have internet access, but will all be behind a router. Is there an off-the-shelf solution to keep the possibility to create a SSH connection to them? I am thinking about solving problems, upgrading etc.
I am thinking of a 'server' solution where a 'client' on the RPi keep an active connection so a SSH connection can be established when required. Any suggestions will be much appreciated!

I have experimented with several services including LogMeIn Hamachi and Weaved among others. I would highly recommend using Weaved because it allows you to meet your goal (SSH to pi behind a router), and the setup is painless. You may even find some other uses that are quite handy.
See the installation details at https://developer.weaved.com/portal/members/betapi.php
Steps to be up and running:
Go to http://www.weaved.com and sign up.
Install weaved on your pi, and follow the prompts for SSH (Instructions at https://developer.weaved.com/portal/members/betapi.php).
Go to "My Devices" at weaved.com and get the new internet accessible proxy address for your pi.
Enjoy!

Related

Jetbrains Gateway settings for frequent disconnects

I’m using Jetbrains Gateway to use IntelliJ to work on the code in a remote Linux machine.
I connect via SSH. I connect and work fine initially, the latency is around 150 ms but it keeps disconnecting. I realized it disconnects when I stop coding and spend some time on other things (browser etc.). When I want to re-connect it asks for SSH key passphrase, I need to enter it multiple times and the 'Save Permanently' option won't work.
Is there a setting I can do to keep it connected?
Could this be related to my company's network, in which case again can I increase timeout or retry on fail by some settings?
This is Max from the remote development team at JetBrains.
I'm sorry to hear you are having trouble with Gateway. Please create a ticket here https://youtrack.jetbrains.com/newIssue?project=GTW describing your issue and attaching your logs. This will help us understand whats going on and resolve your issue.
Thanks!
I started using Remote Development feature of IntelliJ connecting to the same remote machine as described here https://www.jetbrains.com/help/idea/remote-development-starting-page.html
It does not disconnect, I can work whole day (tested 12+ hours) without any connection issues.

Basic question about pinning / getting a file

I've read a bit about IPFS and even added a feature to my comic book reader [1], but I am having trouble getting the basic flow to work:
I created a VM running on Google Cloud that has go-ipfs installed
ipfs daemon is running
on the VM, I added a file (which I believe pins it): hash Qma8Ru1qrJjeVcw5NpY8nXrCWnRhwZpKx617vV3atTYA9t
I can see lots of peers connecting via "ipfs swarm peers"
on my local computer, I installed go-ipfs
When I try on my local computer:
$ ipfs get Qma8Ru1qrJjeVcw5NpY8nXrCWnRhwZpKx617vV3atTYA9t
it just sits there...
Is there a good way to monitor what's going on here (like is the IPFS node in the VM set up correctly)?
Am I doing something wrong?
[1] https://github.com/codedread/kthoom
For the readers, the answer was that it was needed for the peer behind the NAT to dial to the peer in the public IP.
For folks wanting to learn more about how to deal with this automatically, check our tutorials on:
Circuit Relay https://github.com/ipfs/js-ipfs/tree/master/examples/circuit-relaying
Using multiple transports (including WebRTC that supports NAT Holepunching) https://github.com/libp2p/js-libp2p/tree/master/examples/transports

how I can connect remotely to a machine and use the console, without knowing its IP address?

I need to remotely access to the linux console of some machine, but i dont have that IP (and looks like it will be a dinamyc ip)
I have my PC "A", and other PC "B". I have local access to both to install and configure whatever is required, but the PC "B" will be located elsewhere.
Is ssh the best way to go? how?
Thanks!
Since Yogipriyo offered a visual solution, here is how you can access SSH without the need of a GUI. Really, it depends on what you are comfortable with; I would personally recommend it.
There are plenty of ways to utilize SSH depending on your OS (that is, "computer A's OS"):
Windows: MobaXTerm, Cygwin, and Putty are the popular ones that I've heard about. I like MobaXTerm simply because you can have multiple tabs.
Mac: Most have the ability to SSH built in via the X11 terminal. You might need to install XQuartz to enable X11 port forwarding though if this isn't working for you.
*Nix: Just get to command line; you probably know that.
Once you are there, Vim is a great editor to know. This again is a "text-based" editor and thus lends itself well to use over SSH.
Keep in mind a lot of this is personal opinion, so explore and find what makes you most productive.
For visual solution, you can use Team Viewer.
It uses it's machine ID (which assigned by the team viewer application once you install it) to connect to the machine. I used it for 2 years at my previous job as remote support and it didn't have any trouble with dynamic IP as long as you have the target's team viewer ID.
For text based, as far as I know you need the target's IP or domain, but alas it still needs static IP.

Setting up a server at home for Android app

I'm currently developing a simple multiplayer game app for Android and I need to have a server to which the users connect to.I'd like to set up this server at home. I have a dynamic IP address,so someone told me I'd have to set up a local DNS server or something like that. I'm not even sure where to start with setting up a DNS server, everything I found was for windows 2003 and linux. Nothing for XP? If any one can shed some light on this matter, explain a bit how setting a DNS works or supply a link with "setting up local DNS for dummies" I'd be grateful.
Also, besides setting up a DNS so I can find the server every time, how about the communication with it? I'd like for it to be as secure as possible. Another friend told me something about communicating via SSH, which is again something I am not accustomed to.
So if someone could explain some of these concepts or offer some GOOD link for that that would be great. I'm very confused :)
Thanks
EDIT
Btw, the server is in Java and currently i'm communicating from Android emulator to the server (which is localhost) via sockets.
That's not a simple thing you're trying to achive. First you have to create your own server on your machine (maybe you're done with this step), then you have to make this server available for everyone. At this point, I suggest the DynDNS service:
http://lifehacker.com/124804/geek-to-live--how-to-assign-a-domain-name-to-your-home-web-server
A local DNS by default help you to find your own servers by name instead of IP address, but if you have a usual internet service with dynamic IP, you need an external DNS provider to route your clients to your server. (read the link above for the full explanation)
About the SSH security: Yes, you will need some security settings indeed, but that could be a very hard problem sometimes. You can set your server to work with SSL sockets, which is a part of the core J2SE release. It will work against some sort of attack, but none against others. Running your own server will raise unexpected numbers of problems, prepare for that.
As already stated in the comment to your post, something like http://www.no-ip.com or http://www.dnsdynamic.org would solve the issue with your dynamic ip - You do not need a local DNS server.
With regards to communication, i believe that SSH is linux/unix only. Since you wish to use Windows for the server, FTP or Remote Desktop would be best. Choose FTP if all you want to do is manage your files, choose remote desktop if you wish to manage your entire computer. I've had good results with the FileZilla FTP server on windows (http://filezilla-project.org/)
With that said, i think you would be better off buying a simple and cheap hosted service instead of using your own computer - you can get something that can run your java app for $5/month some places, and compared with the annoyance of having a local server running in your house, it might be worth it.

How can I set up a "remote pair-coding" environment linux to linux?

I did some research on how to enable a pair-coding environment remotely so someone else on their MacOx/Linux box could view my screen (I code using vim + the rails plugin).
I read Evan Light's blog on his set up here, but I don't have an open source router:
http://evan.tiggerpalace.com/articles/2011/10/17/some-people-call-me-the-remote-pairing-guy-/
So the SSH is tricky since I don't have a sticky IP.
What is an easy way to do it?
So the SSH is tricky since I don't have a sticky IP.
There's a bunch of tools to get you a DNS name to point towards a dynamic IP (some of them are even free). I've used No-IP.com, but not for several years (and have no affiliation). You don't necessarily need to have an open-source router - you can run the daemon on your computer, and then use port-forwarding to get incoming SSH connections to your computer.
You should take this over to SuperUser.com - it's probably more on-topic there.
Not for pair-programming so far, but I usually do my screen-sharing through TeamViewer. It is extremely easy to set up, and passes through routers like hot knife through butter. However, it transfers the GUI, so it can be somewhat slow (depending on your connection).