how to get SSH access over the internet without SSH access? - docker

ok that sounds weird I know. however, my Raspberry Pi server was connected to Tailscale and I was able to do everything, however I installed and removed Pi hole and when i removed something called "iproute2" I lost connection to tailscale. however I still can access stuff such as portainer and any docker app through Cloudflare. now is there anyway to access my ssh again? is there any docker app that allows me send commands or so? all I need is either to send "sudo ngrok tcp 22" or "tailscale up",, thanks

Related

Connecting to localhost via iPhone while connected to a hotspot

I need some help accessing a server that I have running on my mac. So basically my setup consists of mac on which I'm running my server and also using XCode to run the app on an iPhone connected via USB. And then both this iPhone and the mac are on the same wiFi network which is a personal hotspot that I have running on a different iPhone. I'm trying to access localhost from the iPhone by basically using my mac's IP address and the right port: http://IPADDRESS:PORT/, however this doesn't seem to work. Any ideas as to what may be going on here and potential workarounds or solutions. Connecting to a non hotspot, traditional wifi network is not an option at the moment.
Thanks!
This will work if you have it set up correctly; I am doing it right now. Remember that you have to bind the server to 0.0.0.0 — not 127.0.0.1 — if you want to connect from non-localhost IPs. Also check your system firewall.
If you're still having trouble, Tailscale is another solution that may help — https://tailscale.com
I suggest you take a look at using ngrok as a solution, this will create a secure tunnel and expose the service running on your Mac through a url.
You'll need to create an account and retrieve your auth token.
You can then install it using Homebrew by running in Terminal: brew cask install ngrok
Once installed, connect your account by typing into Terminal: ngrok authtoken [auth_token]
To start a tunnel, type into Terminal: ngrok [protocol] [port number]
For example, to start a tunnel to a HTTP server running on your mac: ngrok http 80 (or ngrok http 443 for HTTPS)
If its a custom TCP protocol use: ngrok tcp [port] (or ngrok tls [port] if using TLS)
This will then give you a URL to use in your app. On free accounts, the URL will change on each restart, paid accounts get a static URL option.
If you don't have Homebrew, download it from and follow instructions on: https://ngrok.com/download

How to run Grails application so that other computers on network can access it?

I've developed a Grails application and I want my coworkers to be able to test it. They are on my network so I figure they can access it by using my IP address and the port number (8080). I've tried running it according to the steps laid out here and here to no avail.
I noticed that whenever I run the program, even when I follow those instructions, it says:
Grails application running at http://localhost:8080 in environment: development
Basic networking stuff here.
When something starts on interface 127.0.0.1 port something
Usually that port is then available for all the interfaces on the machine
if you run netstat -plant you will see running ports open on the machine.
Basically what ever ipconfig or ifconfig tells under Linux as your internal interface something like 192.168.1.x
The app is then available on http://192.168.1.x:8080
If you can't access it from other machines on network start by trying to ping {your machine ip}
It sounds like network security stopping local access from 1 machine accessing another.
Or even better still your good old MS firewall try stopping your security stuff on your desktop
It's not clear if you can access the app yourself on your own machine? It should be available at:
http://localhost:8080/appname
Your co-workers should be able to access the app by changing localhost to your computer name:
http://mycomputername:8080/appname

Connect to rails server remotely from raspberry pi

I have ssh'd into my rasberry pi and built a rails application.
Now how do I load the rails app from another machine?
I have tried IP:port in a web browser, but this fails.
Can I use ssh from a web browser to load the rails server process?
Are there gems I need to install to do this?
Is there any good documentation that I have missed?
SOLUTION
use ngrok to tunnel https://medium.com/#karimbutt/using-ngrok-to-create-a-publicly-accessible-web-facing-raspberry-pi-server-35deef8c816a#.sraso7zar
Maybe the problem is with the IP address you're trying to use. Servers don't necessarily forward their public IP traffic to localhost automatically.
Perhaps you could configure the IP address somehow, I don't know (others might?). Alternatively, you have a use a "local tunnel" service like ngrok or localtunnel. What these do is create a public URL for your localhost (i.e. your "loopback" address), so anyone can access it.
I spoke with a Ngrok author via email. He ensured me that I shouldn't need to expect any downtime from the service or to have to manually restart it. Although keep in mind that if you're on the free plan, whenever you restart Ngrok you're going to get a different URL. He also described it as kind of like a "souped up SSH -R"

How to administer computer when no inbound connection is possible?

I have to periodically administer my parent's Linux computer, because they are too old to understand how to do this themselves. Computer is in the remote location. I always used ssh through the port forwarding on the router. However, their provider recently removed the ability to make any inbound connection and my ssh doesn't connect any more.
My question is: what is the next best way to administer it?
I know that VPN can possibly be used. I can (maybe) set up VPN network with this computer.
Also I can make it try to connect with ssh to my home computer on a particular port for ex. every 15 minutes, establishing the port forwarding back to it. Custom shell script should be used for this.
But what are the alternatives?
Any other, nicer way to be able to connect to this Linux machine from outside?
Similar to your suggestion: get your parents to run a script (all they would have to do is double click something) which ssh's to your computer, and then run back on that?

What is the safest way to test a local rails server?

I am not very experienced, but I have played around with rails a little in the past. When I did it was easy to test the app without actually exposing anything to the internet, since I could just point my browser to localhost. But this app will be getting input from a cellphone so I think it needs to be exposed. What I did so far was to push it to heroku and test there, but that does not seem like a good solution at all since every time I make a change i have push it. I am thinking I have to open a port on my router so and expose the server, which I think I can figure out how to do fairly quickly. Any suggestions on how to try to keep this as safe as possible? Or is there a better solution that I am missing?
The way you could test it if your server and your cell phone are on the same network is just find the local IP address on your machine running the server. You would then go into the browser of the cell phone and type the IP of your browser 'colon' the port the server is listening to (most likely 3000 if a rails server).
So for example if the servers IP was 192.168.0.1 it would be 192.168.0.1:3000
Since you are doing this on an app just put in 192.168.0.1 for the IP of the connection and 3000 for the port. Or if using a url 192.168.0.1:3000 (just like the browser)
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost("https://192.168.0.1:3000");
A very simple way is to use Pow in combination with xip.io.
The former is a local webserver that will run any Rack application behind the scenes for you.
Installing is as simple as:
$ curl get.pow.cx | sh
and linking your app in:
$ ln -s <path-to-app> ~/.pow/myapp
Your app is now accessible at http://myapp.dev/ locally.
Assuming your computer's IP is 10.0.1.1 and your cell phone is on the same Wifi network, your app will be accessible on the phone from http://myapp.10.0.1.1.xip.io.
Caveat: you'll be getting Wifi performance, not cellular performance.

Resources