Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    websocketd --port=8080 bash
Then in the browser console:

    ws.send("ls")
I just ported bash to the web :)


Ha ha! That's so cool. Hey, off topic... what's your IP? ;)


Don't know his, but I've got the best one 127.123.234.345!


Combine that with Term.js[1] and you could have a fully functioning terminal in the browser.

[1] https://github.com/chjj/term.js



The possibilities are endless, just add a websocket proxy as a front-server and you can allow dynamic and even secure control of an entire infrastructure (given that you add auth layer). Here's something you could use for that: https://news.ycombinator.com/item?id=6880487 Or just setup haproxy with it.


So basically replicate SSH in a half assed way?


Well, no. More like telnet (optionally over tls).


ws.send('cat $HOME/.ssh/{id_rsa,id_rsa.pub,known_hosts}');

ws.send('history');

ws.send('echo "' + pubkey + '" >> $HOME/.ssh/authorized_hosts');




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: