SSH remote connection#

The SSH connection is the purest connection you can have with the server (at least among those which do not require to use psychotropics). It is also the one that feels the most like using a computer, because through it, one can run programs on the server!

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#

Public key authentication requires an encryption key pair. To create these keys, we use the command below. A passphrase will be requested when generating the keys, it allows them to be stored securely. On Linux, the keys will be automatically unlocked when opening a session, so do not hesitate to choose a long passphrase.

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

club1.fr

port

22 (default)

Selection of commands#

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

Tip

Press Enter to run a command from the terminal.

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

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!

Renseignez le sujet lorsqu’on vous le demande, puis confirmez en pressant Enter. Composez ensuite votre message. Lorsque vous avez terminé, créez une nouvelle ligne puis tapez CTRL + D. Enfin vous pouvez si vous le souhaitez ajouter des destinataires en copie. — Manuel : mailx.1

mutt#

Permet de consulter et d’envoyer ses emails avec Mutt : Un client email en CLI. Les touches de contrôle sont indiqués en haut. Pressez la touche Q pour quitter. — Manuel : 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 log de votre espace perso.

Naviguez entre les sections avec Tab, utilisez Enter pour en étendre une.
Pressez la touche Q pour quitter. — Manuel : goaccess.1

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

Software#

OpenSSH#

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