[SLUG] Linux networking!

aardvark llama anisotropy9 at hotmail.com
Fri Nov 22 23:24:01 GMT 2002


>Mark wrote:
>Hi,
Hello!

>What do the following commands mean? what do they do?   What is the 
>information returned from the commands and what does it imply?   I need to 
>understand what i'm doing.
Sure. I'm sorry about the terseness of my previous mail (I was showing my 
son the cbeebies site and at the age of three `just sit there whilst I write 
a large email' doesn't cut much ice ;).

>ps -ef | grep inetd   (What is this asking for?   What does it mean?)
OK then. Linux is an operating system that lets more than one program run at 
the same time[1]. To a first approximation these `running programs' are 
called processes and to find out what processes are running you use the 
command ps. Running ps with the arguments ps -ef gives you detailed 
information about all the processes running at a time. If you know all this 
already, I'm sorry and if so skip to the bit where it says "short answer."

The | grep bit (say pipe grep) takes the output from the ps command and 
filters it for anything in the line inetd or telnetd. (If you want the evil 
details use the man command e.g. man ps or man grep...)

>Returned the response:
>P133    root   712   400   0   05.48   tty1    00.00.00   grep inetd
>P75      root   540   380   2   05.49   tty1    00.00.00   grep inetd
This says is that the command inetd is not running and all that you have 
found is the process you started running ps -ef | grep inetd. That is, 
itself. (I will explain what inetd is in a short while.) If there were and 
inetd running I would expect to see something like:
root        54     1  0 Nov21 ?        00:00:00 /usr/sbin/inetd
llama    31967  6474  0 23:12 pts/1    00:00:00 grep inet

>ps -ef | grep telnetd    (What is this asking for?   What does it mean?)
>Returned the response:
>P133    root   540   400   0   05.45   tty1    00.00.00   grep telnetd
>P75      root   578   380   5   06.01   tty1    00.00.00   grep telnetd
Again there is not telnet daemon either. (See below).

>The P133 has the Telnet Server and emacs installed as server and the P75 
>does not have either installed.
Cool. I prefer XEmacs but there you go.

To telnet from one machine P75 to another P133 you need to have at least the 
telnet executable installed on the P75 and a server program -- often called 
a demon or daemon -- running on the P133 machine.

In the simplest case you would run the telnetd program at start up on P133 
-- my telnet server is the program /usr/sbin/in.telnetd -- and the telnet 
from the P75 would connect and all would be well with the world.

However, life is not quite as simple as this and there is the inet daemon to 
deal with. The way telnet works is there is a tcp/ip network connection 
between the two machines on port 23 [2]. There are lots of ports associated 
with lots of different network protocols -- think ftp, ssh, cvs blah blah -- 
each with their own port and what the inetd does is to map server daemons to 
port numbers. This is all configured in /etc/inetd.conf on my machine and it 
works a bit like this: something tries to connect to, say, port 21 on my 
machine. In /etc/inet.d there is a line that should say:
ftp    stream  tcp     nowait  root    /usr/sbin/tcpd  in.ftpd -d 5
If this is the case the inetd daemon with spawn the in.ftpd daemon to handle 
the request. The tcpd bit is to do with tcp wrappers which you have already 
mentioned in your first post and controls whether you should start the 
daemon dependant on what the ip address of the machine sending the request 
is.

Anyway, my short answer is "you don't have a telnet server/daemon running 
the P133 machine. If you did you then would be able to connect. Probably."

I hope my rather ad hoc explanation sheds a little light on the problem. Let 
me know how you get on and my apologies for this long rambling mail and the 
delay due to the time it took to write.

:)w

[1] Actually this isn't quite true if you only have a single processor. What 
it then does is parcel out really small chunks of time to each program that 
wants to run but because it is all so fast you can't tell. Obviously this is 
more complex if you have more than one cpu.
[2] You're now going to ask me what a port is and I will say I don't know. 
There is a standard port assigned to all sorts of things: ftp is on port 21 
and ssh on port 22 and if you want to know more numbers have a look in 
/etc/services for things like <nn>/tcp.


_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963





More information about the Scarborough mailing list