TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Ondevice SSH – Terminal emulator for devices without public IP address

152 pointsby BrandiATMuhkuhover 7 years ago

21 comments

irq-1over 7 years ago
AutoSSH + GatewayPorts on a public server has been solid for me. Setup is a service file on the private machine and &quot;GatewayPorts yes&quot; in sshd_config of the public computer. Plus there&#x27;s no keep alive traffic. Combine it with dynamic DNS, a web proxy and Lets Encrypt for access to a website running on the remote computer.<p>from the systemd service file:<p><pre><code> Environment=AUTOSSH_GATETIME=0 ExecStart=&#x2F;usr&#x2F;bin&#x2F;autossh -M 0 -N -q -o &quot;ServerAliveInterval 60&quot; -o &quot;ServerAliveCountMax 3&quot; -o &quot;ExitOnForwardFailure yes&quot; -p 3004 -l pi exampmle.org -R 3006:127.0.0.1:3006 -R 8080:127.0.0.1:8080 -i &#x2F;home&#x2F;pi&#x2F;.ssh&#x2F;id_rsa</code></pre>
Faaakover 7 years ago
Quite neat, and solves a big problem I had (devices at customers sites). However for me it would be very hard to trust you (security and availability wise).<p>I opted (some months ago when the problem arose), to simply set up a private VPN server, and every device I have at customers connects to it. That way, I can simply `ssh device.cust.vpn.mycompany.tld` and I&#x27;m in.
评论 #15785623 未加载
评论 #15786336 未加载
评论 #15786139 未加载
评论 #15785833 未加载
评论 #15786161 未加载
评论 #15786144 未加载
jamiesonbeckerover 7 years ago
Very neat, but SSH already has capabilities built-in to handle this scenario without harming security or increasing complexity.<p>To add to <i>irq-1</i>&#x27;s excellent response, another autossh method is to autossh from the device into a remote relay server (ie jumpbox) that forwards the local port back to the local ssh server running on the device, which can now be listening on localhost.<p>You can try this out in literally ONE COMMAND LINE (below) and automate it quickly without installing any additional software (except perhaps autossh, which is usually in your distribution&#x27;s repositories).<p><pre><code> device (autossh) -&gt; jumpbox &lt;- you </code></pre> You can also use Userify (<a href="https:&#x2F;&#x2F;userify.com" rel="nofollow">https:&#x2F;&#x2F;userify.com</a>) or similar to keep keys synchronized on the device and jumpbox in this scenario. (Userify only needs outbound https.)<p>Use RemoteForward (-R) on the autossh command line for this. See man page for ssh(1) and especially the RemoteForward section under ssh_config(5) for details.<p>Example:<p><pre><code> # on the device: $ ssh jumpbox -R 22001:localhost:22 </code></pre> Now you can just log into the jumpbox on port 22001 using SSH&#x27;s built-in tun support (-w) in your SSH client (or forward your agent by passing -A when logging into the jumpbox, but this could be hijacked by an attacker who&#x27;d compromised the jumpbox, so do -w instead.)<p>That&#x27;s all. You can automate this with ssh_config, autossh, etc, and also lock down the remote host authorized_keys file and use a restricted shell.
评论 #15807292 未加载
dspillettover 7 years ago
You don&#x27;t seem to mention pricing at all beyond the &quot;5 devices and 5Gb&#x2F;mo free&quot;. That would be useful to what I expect your main audience to be (people for whom the other obvious alternative is a cheap VPS and either OpenVPN or more manually setup SSH tunnelling).
评论 #15787095 未加载
neurotech1over 7 years ago
Using curl piped to sudo bash can be a security risk, as used to install the demo.<p># curl -sSL <a href="https:&#x2F;&#x2F;get.ondevice.io&#x2F;|sudo" rel="nofollow">https:&#x2F;&#x2F;get.ondevice.io&#x2F;|sudo</a> - bash<p>A fairly balanced post and mitigation options:<p><a href="https:&#x2F;&#x2F;sandstorm.io&#x2F;news&#x2F;2015-09-24-is-curl-bash-insecure-pgp-verified-install" rel="nofollow">https:&#x2F;&#x2F;sandstorm.io&#x2F;news&#x2F;2015-09-24-is-curl-bash-insecure-p...</a>
评论 #15791446 未加载
0x0over 7 years ago
On a side-note, I was (pleasantly) surprised to recently learn that if you have macs set up with Back To My Mac, you&#x27;ll get an &quot;iCloud BTMM&quot; IPv6 encrypted tunnel where all your devices appear via dns-sd, even across the internet: <a href="https:&#x2F;&#x2F;apple.stackexchange.com&#x2F;a&#x2F;53776" rel="nofollow">https:&#x2F;&#x2F;apple.stackexchange.com&#x2F;a&#x2F;53776</a>
Ficeover 7 years ago
The Teredo protocol (implemented by miredo-client on GNU&#x2F;Linux) provides a simple way to get a public dynamic IPv6 address on a host behind NAT. Combined with dynamic DNS this solves the problem of accessing my devices from anywhere I need to.
fimdomeioover 7 years ago
a while ago I found out that you could do this by running a tor hidden service on the device. If I needed it, I think I&#x27;d rather use that, or a reverse tunnel than going through a third party.
评论 #15789553 未加载
评论 #15785480 未加载
vbernatover 7 years ago
Instead of wrapping SSH calls with an additional command, would it be possible to use a ProxyCommand? This way, anything working with &quot;ssh&quot; would work out of the box.
评论 #15785518 未加载
jbverschoorover 7 years ago
Why not use zerotier and have a super simple vlan?
评论 #15794601 未加载
sorosoover 7 years ago
Similar to StrongDM, except it does less. SDM implements the SSH protocol which allow both session logging (for audit and training purposes) and on-prem deployment. It supports all SSH services such shell (for interactive operation) exec (for remote scripting, like ansible and scp) and subsystems (like sftp). And on top of that it supports DB connections through the same tunnel (again with query logging for audit purposes).<p>The on-prem part is really neat.<p>Disclaimer: I work at StrongDM.<p>Edit: fixed typo
评论 #15786351 未加载
crubierover 7 years ago
I wonder what is the difference with ngrok, if any?
评论 #15785734 未加载
kevinsimperover 7 years ago
Looks really neat, however it works make sense to explain how it works to be exactly like ssh :)
评论 #15785492 未加载
评论 #15785414 未加载
zAy0LfpBZLC8mACover 7 years ago
The tor option has already been mentioned. The other useful option if you don&#x27;t have your own server with static addresses is dynamic DNS and then simply set up a VPN or reverse SSH connections to the dyndns hostname on your DSL or whatever. Certainly more sensible than a cloud service with a hilarious 5GB traffic limit that also unavoidably adds unnecessary latency to the connection.
kodablahover 7 years ago
I&#x27;ve contemplated doing something similar. Except the way I&#x27;d do it is statically link OpenSSH and Tor into a single portable binary. Then create an onion service to a local sshd. Then just provide the onion address (still would use traditional auth). Of course lots of configurability. This has lots of benefits of course and can be completely self contained and ephemeral.
mfrwover 7 years ago
I used to go via the ngrok way, but thanks for a better-targeted solution.<p>BTW, just curious is there any other alternative apart from this ?
评论 #15787635 未加载
评论 #15787471 未加载
评论 #15788341 未加载
rollulusover 7 years ago
At a previous job we had the same setup to SSH to our customer&#x27;s embedded devices for diagnostics. Incredibly useful. I&#x27;ve been playing with the idea to provide this as a service since then, interesting to see if this is viable.
jefuriiover 7 years ago
Seems kinda similar to Pagekite ( <a href="http:&#x2F;&#x2F;pagekite.net" rel="nofollow">http:&#x2F;&#x2F;pagekite.net</a>).
0xdeadbeefbabeover 7 years ago
I wonder if they have the TCP inside TCP problem?
i_have_to_speakover 7 years ago
Check out ZeroTier [1]. You can place all your devices on a virtual LAN. Not affiliated.<p>[1] <a href="https:&#x2F;&#x2F;zerotier.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;zerotier.com&#x2F;</a>
评论 #15786050 未加载
评论 #15785926 未加载
amscottiover 7 years ago
Seems very much like Gravitational Teleport - <a href="https:&#x2F;&#x2F;gravitational.com&#x2F;teleport&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gravitational.com&#x2F;teleport&#x2F;</a>