[CALUG] DoD/OSI Layer 2, 3 and 4 in the real world -- WAS: open ports
Morty
morty+calug at frakir.org
Thu Sep 15 19:59:44 EDT 2011
[snip; resending from correct "From:", with minor edits]
Another attempt to answer the original question:
* Ports are numbers used in networking. "Open ports" are usually
associated with services that are listening. Essentially, they mean
that someone else can connect to your computer even when you're not
telling your computer to do something. That someone else might be
trying to hack your computer or get it to do things that you might
not want it to do. From a security perspective, you want to
minimize your open ports.
* how to enable or disable an individual port is usually related to
the service process that has it open. You can find what ports are
open and what programs are associated with a port like so:
# run as root
netstat -pln --inet --inet6
Note that some of these options are relatively new. So if you have
a really old Linux distro, this command might not be supported.
There are older ways to do this; feel free to ask (or upgrade) if
this is a problem for you.
* Once you know what service is using what port, you can decide which
services you don't need and turn them off. Most Linux distros have
a distro-specific mechanism to enable or disable individual
services, such as sshd and apache httpd. "inetd" or "xinetd" may be
a special case -- a master service that tends to support a whole
bunch of ports and services -- and has a special configuration
mechanism for supported services. telnet in particular is usually
handled via inetd or xinetd.
* ethernet drivers don't deal directly with port requests. Instead,
they pass traffic that meets certain criteria to other kernel
layers, such as the kernel's IPv4 and IPv6 layers. The IPv4 and
IPv6 layers are independent of individual ethernet drivers, or even
of ethernet as a whole -- for example, you can have IPv4 with PPP
(e.g. for dial-up), which doesn't use ethernet. IP, in turn, can
pass the traffic to TCP, UDP, or other protocols. TCP or UDP, in
turn, can pass the request to a service program such as the apache
web server or inetd.
Part of the beauty of IP is that it acts as an abstraction between
high-level protocols and "real" network protocols. This way,
telnet, email, and other protocols work basically the same whether
you are on ethernet, PPP for dialup, PPP over a high speed serial
link, wireless, token ring, FDDI, or ATM. This despite the fact
that many of those lower-level protocols are fundamentally
different. You can easily plug in new services to IP to add
functionality that was not part of the original design. It's quite
brilliant.
* There are some other protocols that you might also see that don't
have ports.
* This is all very common information. If you google for guides to
securing your distro, you should find a lot more info, tailored to
your distro of choice.
- Morty
More information about the CALUG
mailing list