4 ms·
> Linux somewhat supports /dev/tcp/HOSTNAME/PORT (technically that's application level in bash so not everywhere), and im sure there's daemons you could run to
by tetha 6y ago
> Linux somewhat supports /dev/tcp/HOSTNAME/PORT (technically that's application level in bash so not everywhere), and im sure there's daemons you could run to automount things on the fly.
Do note that this has been disabled in the major distributions at compile time for pretty much ever. The debian bug to build bash with that feature by default is ~20 years old (and was closed as wontdo).
- exikyut 6y agoOn two different Debian 10 boxes bash seems to have it enabled: Terminal 1 $ echo hi > /dev/tcp/127.0.0.1/9999 Terminal 2 $ nc -vvvlp 9999 Listening on [0.0.0.0] (family 2, port 9999) Connection from 127.0.0.1 57540 received! hi $
- amenod 6y agoFor anyone wondering, it is enabled by default on Ubuntu too. I wonder what made someone think that this was a good idea?
- rijoja 6y agoIf you follow the everything is a file philosophy it seems quite natural does it not?
- soulofmischief 6y agoExcept permissions aren't granular enough / are too confusing, it's a giant footgun with the current Linux architecture, which doesn't have all the nice things Plan9 does
- bawolff 6y agoI mean, unless you're host is extremely locked down you'll probably also have telnet,netcat, etc installed, so no great difference.
- nolok 6y agoI'm no specialist but I'm inclined to disagree, for me it's the difference between the ability to run an arbitrary binary and the ability to read/write an arbitrary filepath
- capitainenemo 6y agoThey are imaginary paths in the bash executable. They aren't usable outside it. Thus the netcat analogy.
- LinuxBender 6y agoAnything you can do in telnet or netcat can also be done in python, perl, ruby. One of those is likely installed, most probably python.
- rijoja 6y agoAnd if you think about if all applications where using files for communication blocking one program from the internet would be as simple as a chmod.
- rijoja 6y agoI didn't say that the everything is a file philosophy is necessarily correct and well implemented on Linux. Merely that if you where to continue along this direction it would seem like a logical next step. I don't think I would use this for anything but for shell scripts at best. However especially if you are a plan 9 fanatic then it would seem like quite a good idea which is what the original question was.
- kevinoid 6y agoAlthough it was disabled in Debian bash 2.04-5 on 2000-06-05, it was re-enabled in bash 4.0-5 on 2009-09-13 and is currently enabled. See https://metadata.ftp-master.debian.org/changelogs/main/b/bash/bash_5.1-2_changelog https://metadata.ftp-master.debian.org/changelogs/main/b/bas...