Skip to content
Snippets Groups Projects
Verified Commit a3008f69 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

finish 10.

parent f180f813
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,8 @@ Packet switching is a method of grouping data over the network into packets. Eac
![https://en.wikipedia.org/wiki/Packet_switching#/media/File:Packet_Switching.gif](./img/packet_switching.gif)
In a packet switching network when you send a flux of data (video, sound, etc.), you have the illusion of continuity like for process switching handled by the scheduler.
## **Internet Protocol** (IP)
> The **Internet Protocol** (**IP**) is the principal [communications protocol](https://en.wikipedia.org/wiki/Communications_protocol) in the [Internet protocol suite](https://en.wikipedia.org/wiki/Internet_protocol_suite) for relaying [datagrams](https://en.wikipedia.org/wiki/Datagram) across network boundaries. Its [routing](https://en.wikipedia.org/wiki/Routing) function enables [internetworking](https://en.wikipedia.org/wiki/Internetworking), and essentially establishes the [Internet](https://en.wikipedia.org/wiki/Internet).
......@@ -94,9 +96,35 @@ UDP uses a simple [connectionless communication](https://en.wikipedia.org/wiki/C
- Multicast (a single datagram packet can be automatically routed without duplication to a group of subscribers)
- Lightweight (no ordering of messages, no tracking connections, etc. It is a very simple transport layer designed on top of IP)
### Port
Higher, communication protocols like TCP and UDP, also define **port**. A **port** is a communication endpoint. When software wants to communicate overt TCP or UDP it will do so using a specific **port**. Each system has **port** numbers ranging from 0 to 65535. **Port** numbered from 0 through 1023 are system **ports** used by well-known processes (you need specific rights to use them).
Here are a list of notable port numbers:
| Number | Assignment |
| ------ | ------------------------------------------------------------ |
| 20 | [File Transfer Protocol](https://en.wikipedia.org/wiki/File_Transfer_Protocol) (FTP) Data Transfer |
| 21 | [File Transfer Protocol](https://en.wikipedia.org/wiki/File_Transfer_Protocol) (FTP) Command Control |
| 22 | [Secure Shell](https://en.wikipedia.org/wiki/Secure_Shell) (SSH) Secure Login |
| 23 | [Telnet](https://en.wikipedia.org/wiki/Telnet) remote login service, unencrypted text messages |
| 25 | [Simple Mail Transfer Protocol](https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol) (SMTP) E-mail routing |
| 53 | [Domain Name System](https://en.wikipedia.org/wiki/Domain_Name_System) (DNS) service |
| 67, 68 | [Dynamic Host Configuration Protocol](https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol) (DHCP) |
| 80 | [Hypertext Transfer Protocol](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) (HTTP) used in the [World Wide Web](https://en.wikipedia.org/wiki/World_Wide_Web) |
| 110 | [Post Office Protocol](https://en.wikipedia.org/wiki/Post_Office_Protocol) (POP3) |
| 119 | [Network News Transfer Protocol](https://en.wikipedia.org/wiki/Network_News_Transfer_Protocol) (NNTP) |
| 123 | [Network Time Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) |
| 143 | [Internet Message Access Protocol](https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol) (IMAP) Management of digital mail |
| 161 | [Simple Network Management Protocol](https://en.wikipedia.org/wiki/Simple_Network_Management_Protocol) (SNMP) |
| 194 | [Internet Relay Chat](https://en.wikipedia.org/wiki/Internet_Relay_Chat) (IRC) |
| 443 | [HTTP Secure](https://en.wikipedia.org/wiki/HTTP_Secure) (HTTPS) HTTP over TLS/SSL |
Nowadays, **ports** provide multiplexing, which means that multiple service or communication session can use the same **port** number.
## SSH
There exist numerous other protocols ([RTP](https://en.wikipedia.org/wiki/Real-time_Transport_Protocol) for example). But most of them run over the TCP and UDP protocols. **SSH** or **Secure Shell** is one of them. SSH is a [cryptographic](https://en.wikipedia.org/wiki/Cryptography) [network protocol](https://en.wikipedia.org/wiki/Network_protocol) for operating network services securely over an unsecured network.
There are numerous other protocols ([RTP](https://en.wikipedia.org/wiki/Real-time_Transport_Protocol) for example). But most of them run over the TCP and UDP protocols. **SSH** or **Secure Shell** is one of them. SSH is a [cryptographic](https://en.wikipedia.org/wiki/Cryptography) [network protocol](https://en.wikipedia.org/wiki/Network_protocol) for operating network services securely over an unsecured network.
SSH use a client-server architecture, you use an SSH client to connect to an SSH server. By default most Linux distribution don’t comes with an SSH server installed. For the IFB, SSH connection is the default way to connect to your VMs, so you should have an SSH sever up and running.
......@@ -114,7 +142,7 @@ SSH uses [Public-key cryptography (or asymmetric cryptography](https://en.wikipe
### Public-key cryptography
SSH uses [Public-key cryptography (or asymmetric cryptography](https://en.wikipedia.org/wiki/Public-key_cryptography)), is a cryptographic system which uses pairs of [keys](https://en.wikipedia.org/wiki/Cryptographic_key): *public keys* (which may be known to others), and *private keys* (which may never be known by any except the owner).
[Public-key cryptography (or asymmetric cryptography](https://en.wikipedia.org/wiki/Public-key_cryptography)), is a cryptographic system which uses pairs of [keys](https://en.wikipedia.org/wiki/Cryptographic_key): *public keys* (which may be known to others), and *private keys* (which may never be known by any except the owner).
A cryptographic algorithm is used to generate a pair of *public* and *private* keys from a large random number. Then, the 3 following scheme can be used to secure communication:
......@@ -140,7 +168,7 @@ Can be used to share public keys (see [Diffie-Hellman)](https://fr.wikipedia.org
## SSH Server
By default, on the IFB, password authentication is disabled to enforce the use of public key based authentication. To learn `ssh` command we are going to enable this option on your VMs. Find their `sshd` configuration file and open it with an editor of your choice.
By default, on the IFB, password authentication is disabled to enforce the use of public key based authentication. To learn `ssh` command we are going to enable this option on your VMs. Find the`sshd` configuration file and open it with the editor of your choice.
<details><summary>Solution</summary>
<p>
......@@ -358,4 +386,14 @@ Host work-ens
PreferredAuthentications publickey,password,
```
With the command `ssh work-ens`, the `ssh` client is going to first connect to `ens` and then from `ens` to the `ip.ip.ip.ip` server.
\ No newline at end of file
With the command `ssh work-ens`, the `ssh` client is going to first connect to `ens` and then from `ens` to the `ip.ip.ip.ip` server.
In the next session, we are going to learn how to [install system-wide programs](http://perso.ens-lyon.fr/laurent.modolo/unix/11_install_system_programs.html) like the one managed by `systemd`
> We have used the following commands:
>
> - ssh to establish ssh connection
> - sytemctl to manage system daemons
> - scp to copy files
> - rsync to copy files
......@@ -8,7 +8,8 @@ all: html/index.html \
html/7_streams_and_pipes.html \
html/8_text_manipulation.html \
html/9_batch_processing.html \
html/10_network_and_ssh.html
html/10_network_and_ssh.html \
html/11_install_system_programs.html
html/index.html: index.md github-pandoc.css
......@@ -43,3 +44,6 @@ html/9_batch_processing.html: 9_batch_processing.md github-pandoc.css
html/10_network_and_ssh.html: 10_network_and_ssh.md github-pandoc.css
pandoc -s --toc -c github-pandoc.css 10_network_and_ssh.md -o html/10_network_and_ssh.html
html/11_install_system_programs.html: 11_install_system_programs.md github-pandoc.css
pandoc -s --toc -c github-pandoc.css 11_install_system_programs.md -o html/11_install_system_programs.html
......@@ -14,5 +14,6 @@ title: # Unix / command line training course
8. [Text manipulation](http://perso.ens-lyon.fr/laurent.modolo/unix/8_text_manipulation.html)
9. [Batch processing](http://perso.ens-lyon.fr/laurent.modolo/unix/9_batch_processing.html)
10. [Network and ssh](http://perso.ens-lyon.fr/laurent.modolo/unix/10_network_and_ssh.html)
11. [Install system-wide programs](http://perso.ens-lyon.fr/laurent.modolo/unix/11_install_system_programs.html)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment