Difference between revisions of "Server Basics"

From docwiki
Jump to: navigation, search
(Units)
 
(4 intermediate revisions by the same user not shown)
Line 5: Line 5:
   
 
Linux is an ideal operating sytstem for servers. From a small Raspberry Pi that controls some IoT devices to the big data centers. Linux is everywhere. Here we will only cover some of the more common server services. You can also learn some basics that are useful for many server applications.
 
Linux is an ideal operating sytstem for servers. From a small Raspberry Pi that controls some IoT devices to the big data centers. Linux is everywhere. Here we will only cover some of the more common server services. You can also learn some basics that are useful for many server applications.
  +
  +
== Units ==
   
 
* [[Listen Sockets, Ports and Telnet]]
 
* [[Listen Sockets, Ports and Telnet]]
  +
* [[inetd, tcpwrapper]]
 
  +
* [[Apache Basics and simple CGI scripts]]
=== netcat, nc, ncat ===
 
  +
* [[openssl]]
 
  +
* [[Security of Web Applications]]
netcat is kind of a swiss-army knife tool for network connections. There are 3 different versions which are sometimes installed with the same name.
 
  +
* [[mysql, samba, other servers]]
 
You can find out which of those exist by trying the option '''-h''' with the above command. In my case i have install ncat with comes from the nmap tools (usefull to scan networks for hosts that answer).
 
On my machine all 3 command: netcat nc and ncat are aliases to ncat.
 
 
So I will show you the ncat version of nc:
 
 
Here we connect but use the pipe to directly send the "HEAD /" to get response from the server:
 
<pre>
 
$echo HEAD / | ncat www.orf.at 80
 
HTTP/1.1 400 Bad Request
 
Date: Sun, 29 Mar 2020 19:42:34 GMT
 
Server: Apache
 
Content-Length: 226
 
Connection: close
 
Content-Type: text/html; charset=iso-8859-1
 
...
 
</pre>
 
 
With nc, netcat, ncat we can also create a '''listen socket''':
 
 
<pre>
 
$ ncat -4 -l 1234
 
</pre>
 
 
The above opens a listen socket on port 1234 (for IPv4 only). If we want to connect to this service we can open telnet connection in an other terminal windows:
 
 
<pre>
 
$ telnet localhost 1234
 
</pre>
 
 
What you type here will show up on in the terminal where you run the ncat command.
 

Latest revision as of 17:46, 1 April 2020


Motivation

Linux is an ideal operating sytstem for servers. From a small Raspberry Pi that controls some IoT devices to the big data centers. Linux is everywhere. Here we will only cover some of the more common server services. You can also learn some basics that are useful for many server applications.

Units