SSH remote connection#

The SSH connection is the most intimate connection you can have with the server. It’s also the one that most closely resembles using a computer, because through it, you can run programs on the server!

capture d'écran d'un émulateur de terminal après une connexion SSH au serveur CLUB1

SSH#

(Secure SHell) Protocol allowing to connect remotely in CLI to a server. Its main advantages are being fully encrypted and providing full access to server functionality. There are SSH extensions for more specific uses like SFTP or SCP. — Wikipedia

SFTP#

(SSH File Transfer Protocol) File transfer and remote management protocol based on SSH. It is thus fully encrypted, and therefore comparable to FTPS, but it offers more features (e.g. display of file owners). — Wikipedia

SCP#

(Secure CoPy) Protocol for copying files between two computers based on SSH. SCP is mainly used with the CLI client of the same name. — 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#

We use the following command in the terminal to connect (replace USER with your CLUB1 login):

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#

Instead of using a password, if you regularly log in from the same device, it is advisable to log in using a public key.

This requires following a few steps which are outlined in the tutorial: SSH connection using a public key

Connection information#

field

value

host

club1.fr

port

22 (default)

Selection of commands#

Here is a selection of commands to allow you to discover the server:

Tip

To run a command from the terminal, type its name, then press Enter.

exit#

To terminate the SSH connection with the server.

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#

Displays the members of a group:

members GROUP

By replacing GROUP with the desired group. Example: members sudo or members compta. — Manual : 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#

A tool that allows you to visualize the traffic to your Web sites by analyzing the logs. This command requires adding the log file you wish to analyze after a space.

Note

The logs of Apache, which serves the websites, are stored in the log folder of your personal space.

Navigate between sections with Tab, use Enter to expand one. Press Q to exit. — Manual: goaccess.1

site-stats#

Permet un usage simplifié de la commande goaccess en publiant le panneau de statistiques en HTML à partir d’un nom de domaine.

site-stats NOM_DE_DOMAINE [CHEMIN]

Le nom de domaine doit ressembler à moutarde.club1.fr ou www.example.com. Si on ne définit pas de CHEMIN, le panneau est publié dans le dossier static selon la règle suivante : ~/static/tmp/stats/NOM_DE_DOMAINE. — Sources

man#

Displays the manual page corresponding to a command. Which should be indicated after a space. Most manual pages are in English. Press the Q key to leave. — Manual: man.1

Resource sharing#

The commands can consume computing resources. In this case, the server’s processor will be working overtime! If a member monopolizes all 4 processors with a command, they will be unavailable to other processes.

If you want to launch a resource-intensive task and be sure not to slow down other server uses, you can use the following command:

nice#

Increases the niceness of a command. (It will then give priority to other commands.)

nice COMMANDE

By replacing COMMANDE with the command that will be nicely executed. — Manual: nice.1

Tip

To view the server’s resource consumption, one can consult the dashboard or use htop.

Software#

OpenSSH#

Software providing both an SSH server and client. — Wikipedia, Sources