0Pricing
Linux Command Line Mastery · Leçon

Accès distant sécurisé : `ssh` et `scp`

Maîtrisez l’interpréteur de commandes sécurisé pour accéder à des serveurs distants et copier des fichiers en toute sécurité entre systèmes.

Accès distant sécurisé : `ssh` et `scp` est une leçon Linux Command Line Mastery gratuite sur CoddyKit. Ceci est la leçon 3 sur 4. Tu peux lire la leçon complète ci-dessous gratuitement — puis la pratiquer en direct dans le navigateur avec un éditeur de code intégré et un tuteur IA 24/7. Elle fait partie du parcours d'apprentissage Linux Command Line Mastery, et ta progression se synchronise sur le web et l'application CoddyKit. Le cours Linux Command Line Mastery comprend 4 leçons au total.

Certaines parties de cette leçon n'ont pas encore été traduites et s'affichent en anglais.

Welcome to Secure Remote Access!

In this lesson, you'll learn how to connect to remote computers and transfer files securely using the Linux terminal.

We'll cover two essential tools: ssh for secure remote login and scp for secure file copying.

Secure Shell (SSH) Explained

SSH, or Secure Shell, is a network protocol that allows you to establish a secure, encrypted connection to a remote server over an unsecured network.

  • It provides a secure channel over an unsecured network by using strong cryptography.
  • It's commonly used for remote command-line login and remote command execution.

Your First SSH Connection

To connect to a remote server using SSH, you need the username on the remote server and its hostname or IP address.

The basic command is ssh username@hostname_or_ip. Try running the example below, replacing the placeholder with an actual host if you have one, or just observing the syntax.

ssh your_username@example.com

SSH with IP Address

Instead of a hostname (like example.com), you can also use the server's IP address. This is common when setting up new servers or in local networks.

The process is identical; just swap the hostname for the IP.

ssh your_username@192.168.1.100

Connecting on a Different Port

By default, SSH uses port 22. However, for security reasons or specific configurations, servers might use a different port (e.g., 2222).

You can specify a different port using the -p option followed by the port number.

ssh -p 2222 your_username@example.com

Secure Copy (SCP) Explained

SCP, or Secure Copy Protocol, is a command-line utility that allows you to securely copy files and directories between local and remote hosts, or between two remote hosts.

  • It uses SSH for data transfer and authentication.
  • This means your file transfers are encrypted and secure.

SCP: Sending Files to Remote

To copy a file from your local machine to a remote server, specify the local file path first, then the remote destination (username@host:path).

Remember to replace placeholders with your actual details.

scp local_file.txt your_username@example.com:/home/your_username/

SCP: Getting Files from Remote

To copy a file from a remote server to your local machine, the syntax is reversed: remote source first, then local destination.

You can specify a local directory, and the file will be copied into it.

scp your_username@example.com:/remote/path/file.log ./downloads/

SCP: Copying Entire Directories

If you need to copy an entire directory (folder) and its contents, you'll use the -r (recursive) option with scp.

This tells scp to copy all subdirectories and files within the specified folder.

scp -r local_folder/ your_username@example.com:/remote/backups/

Quick Check: Remote Access Tools

Which of the following commands are primarily used for secure remote access or secure file transfer in a Linux environment?

Recap: SSH and SCP Mastery

Great job! You've learned the fundamentals of secure remote access and file transfer.

  • ssh lets you securely log into and control remote servers.
  • scp allows you to securely copy files and directories between local and remote systems.
  • Both use encryption to protect your data during transfer.

These commands are indispensable for server administration and development!

Questions Fréquemment Posées

La leçon « Accès distant sécurisé : `ssh` et `scp` » est-elle gratuite ?

Oui — le texte complet de « Accès distant sécurisé : `ssh` et `scp` » est gratuit à lire ici sur le web. Pour la pratiquer de manière interactive (un éditeur de code intégré et un tuteur IA 24/7) et déverrouiller le reste du cours Linux Command Line Mastery, passe à CoddyKit PRO. Le cours Linux Command Line Mastery comprend 4 leçons au total.

Qu'est-ce que j'apprendrai dans « Accès distant sécurisé : `ssh` et `scp` » ?

Maîtrisez l’interpréteur de commandes sécurisé pour accéder à des serveurs distants et copier des fichiers en toute sécurité entre systèmes. Tu pratiques Linux Command Line Mastery avec du code pratique que tu exécutes directement dans le navigateur, et un tuteur IA 24/7 répond à tes questions au fur et à mesure que tu avances dans la leçon.

Dois-je avoir de l'expérience pour commencer Linux Command Line Mastery ?

Aucune expérience préalable n'est requise. Linux Command Line Mastery sur CoddyKit est structuré pour les débutants jusqu'aux apprenants avancés, donc tu peux commencer ici ou depuis le début et avancer à ton rythme. Ceci est la leçon 3 sur 4.

Combien de temps prend la leçon « Accès distant sécurisé : `ssh` et `scp` » ?

La plupart des leçons CoddyKit prennent environ 5–10 minutes. Chacune est courte et interactive, tu progresses régulièrement et tu repiques exactement où tu t'es arrêté sur le web et l'app.

Peux-tu écrire et exécuter du code dans cette leçon Linux Command Line Mastery ?

Oui. Chaque leçon Linux Command Line Mastery inclut un éditeur de code intégré, tu écris et exécutes du vrai code directement dans ton navigateur et tu reçois des retours IA instantanés — aucune configuration locale requise.

Toutes les leçons de ce cours

  1. Gérer les utilisateurs et les groupes : `useradd`, `usermod`, `groupadd`
  2. Introduction aux commandes réseau : `ping`, `ip`, `netstat`
  3. Accès distant sécurisé : `ssh` et `scp`
  4. Autorisations et propriété des fichiers avec chmod et chown
← Retour à Linux Command Line Mastery