You are not logged in.
Pages: 1
Please help me, how to in ARch open tcp connection? My problem is that i dont have /dev/tcp device.
Thak you.
Offline
/dev/tcp is special in that way. It's doesn't actually exist as a file, but still works only for redirection purposes.
From the man page of bash:
handles several filenames specially when they are used in redirec‐
tions, as described in the following table:
/dev/fd/fd
If fd is a valid integer, file descriptor fd is dupli‐
cated.
/dev/stdin
File descriptor 0 is duplicated.
/dev/stdout
File descriptor 1 is duplicated.
/dev/stderr
File descriptor 2 is duplicated.
/dev/tcp/host/port
If host is a valid hostname or Internet address, and port
is an integer port number or service name, bash attempts
to open a TCP connection to the corresponding socket.
/dev/udp/host/port
If host is a valid hostname or Internet address, and port
is an integer port number or service name, bash attempts
to open a UDP connection to the corresponding socket.
Examples:
http://thesmithfam.org/blog/2006/05/23/ … -devtcp-2/
http://hacktux.com/bash/socket
Offline
What are you trying to do?
Are you asking about firewalls?
Are you asking about how to provide a service such as HTTP, FTP, ssh, or (gulp) Telnet?
Are you asking about how to write a program that provides a service through a tcp port ?(how to write a server?)
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Thaks for answers. i wanted to try these commands
exec 3<>/dev/tcp/bruxy.regnet.cz/80
echo -e "GET http://bruxy.regnet.cz/linux/mandel/mandel.ansi HTTP/1.0\n" >&3
cat <&3
This is the method how to download bash script from this page
http://bruxy.regnet.cz/web/linux/EN/man … t-in-bash/
But everywhere is mentioned this path of device
/dev/tcp
and i dont have it
$ls /dev/tcp
ls: cannot access /dev/tcp: No such file or directory
$cat /dev/tcp
cat: /dev/tcp: No such file or directory
Recently i have discovered this path in my system
$ls /proc/net/tcp
/proc/net/tcp
Is that same?
Offline
Okay, that all hurts my brain. It would seem this /dev/tcp is no longer supported in the kernel; but --- it seems that Bash provides the functionality. If you are using the Bash shell, what you propose should work.
In fact... I just tried it in zsh, and it failed miserably. Then I invoked it under Bash, and I am looking at a Madelbrot Fractal.
$ls /proc/net/tcp /proc/net/tcp
Is that same?
No.
"Files" under the /proc tree are to provide information about what is going on inside the drivers. Those files will provide information about retries, bit error rates, and other sundry information about the innards of the network operation.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
oh ok! sorry i get it
/dev/tcp is not file in any way. bash can open tcp or udp connection through it and this is bash feature.
only for completeness bash has to be compiled with this
--enable-net-redirections
enable /dev/tcp/host/port redirection
thank you. problem solved
Offline
Pages: 1