SSH remote connection#
La connexion SSH est la connexion la plus intime que vous puissiez avoir avec le serveur. C’est aussi celle qui peut le plus rappeler l’utilisation d’un ordinateur, car à travers elle, on peut lancer des programmes sur le serveur !

- SSH#
(Secure SHell) Protocole permettant de se connecter à distance en CLI à un serveur. Ses principaux avantages sont d’être entièrement chiffré et d’offrir un accès complet aux fonctionnalités du serveur. Il existe des extensions SSH pour des usages plus spécifiques comme SFTP ou SCP. — Wikipedia
- SFTP#
(SSH File Transfer Protocol) Protocole de transfert et gestion à distance de fichiers basé sur SSH. Il est ainsi entièrement chiffré, et donc comparable à FTPS, mais il offre plus de fonctionnalités (e.g. l’affichage des propriétaires d’un fichier). — Wikipedia
- SCP#
(Secure CoPy) Protocole de copie de fichiers entre deux ordinateurs basé sur SSH. SCP s’utilise principalement à l’aide du client en CLI du même nom. — Wikipedia
Connection#
Warning
The first connection is critical because the key exchange takes place at this moment. To avoid a man-in-the-middle attack we have to make sure that we received the correct key during this exchange.
If you don’t know how to add the server key to your device, the tutorial First SSH connection is for you!
There are two ways to authenticate for an SSH connection. The simplest is to use a password, however it is less secure than using a public key.
Authenticate via password#
On utilise la commande suivante dans le terminal pour se connecter
(remplacer USER par votre identifiant CLUB1) :
ssh USER@club1.fr
You must then enter your CLUB1 password (it is normal that the password is not displayed at the time of writing).
Authenticate with a public key#
L’authentification par clé publique nécessite une paire de clé de chiffrement. Pour créer ces clés, on utilise la commande ci-dessous. Une phrase de passe sera demandée lors de la génération des clés, elle permet de les stocker de manière sécurisée. Sur Linux, les clés seront automatiquement déverrouillées lors de l’ouverture d’une session, il ne faut donc pas hésiter à choisir une longue phrase de passe.
ssh-keygen
The command thereafter then effortlessly sends the public part of the key to the server to be able to use it as an authentication method (replace USER with your CLUB1 login). It will ask you to enter you CLUB1 password to work.
ssh-copy-id -i ~/.ssh/id_rsa USER@club1.fr
Finally, we use the same command again to connect. But this time it’s the keys that will be used. If they are not already unlocked, the passphrase will be prompted.
ssh USER@club1.fr
Connection information#
field |
value |
|---|---|
host |
|
port |
|
Selection of commands#
Voici une sélection de commandes pour vous permettre de découvrir le serveur :
Tip
Pour lancer une commande depuis le terminal, tappez son nom, puis appuyez sur Enter.
- exit#
Pour mettre fin à la connexion SSH avec le serveur.
- passwd#
Allows you to change your CLUB1 password (this will therefore have an effect on the connection to all services). — Manual: passwd.1
- htop#
Allows you to see what is happening on the server at the moment and how much resources are being used. Press the Q key to exit. — Manual: htop.1
- ncdu#
Quick and visual tool to find files or folders that take the most space. Ideal for cleaning! Just navigate with the directional arrows. Press the Q key to leave. — Manual: ncdu.1
- w#
Displays SSH-connected members and indicates the software they are using. This command is a little intrusive! — Manual: w.1
- members#
Affiche les membres d’un groupe :
members GROUP
En remplaçant GROUP par le groupe voulu. Exemple :
members sudooumembers compta. — Manuel : members.1
- mailx#
The most basic way to send an email! This command requires to add at the end, after a space, the email of your recipient.
Tip
If you are sending to a CLUB1 member, no need to add
@club1.fr!Fill in the subject when asked, then confirm by pressing Enter. Write your message afterwards. When you’re done, create a new line and press CTRL + D. Finally you can add recipients in copy, if you want to. — Manual: mailx.1
- mutt#
Allows to consult and send emails with Mutt: A CLI email client. Control keys are indicated at the top. Press the Q key to quit. — Manual: mutt.1
- goaccess#
Un outil qui permet de visualiser la fréquentation de ses sites Web en analysant les logs. Cette commande nécessite de rajouter au bout, après un espace, le fichier de log que vous souhaitez analyser.
Note
Les logs de Apache, qui sert les sites Web, sont stockés dans le dossier
logde votre espace perso.Naviguez entre les sections avec Tab, utilisez Enter pour en étendre une.
Pressez la touche Q pour quitter. — Manuel : goaccess.1