Безопасный удалённый доступ: `ssh` и `scp`
Освойте безопасную оболочку для удалённого доступа к серверам и защищённого копирования файлов между системами.
«Безопасный удалённый доступ: `ssh` и `scp`» — бесплатный урок Linux Command Line Mastery на CoddyKit. Это урок 3 из 4. Ты можешь прочитать весь урок бесплатно ниже — а потом практиковать его прямо в браузере с встроенным редактором кода и ИИ-репетитором 24/7. Это часть пути обучения Linux Command Line Mastery, и твой прогресс синхронизируется между веб-версией и приложением CoddyKit. Курс Linux Command Line Mastery содержит 4 уроков всего.
Части этого урока еще не переведены и отображаются на английском.
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.comSSH 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.100Connecting 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.comSecure 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.
sshlets you securely log into and control remote servers.scpallows 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!
Часто задаваемые вопросы
Урок «Безопасный удалённый доступ: `ssh` и `scp`» бесплатный?
Да — полный текст урока «Безопасный удалённый доступ: `ssh` и `scp`» бесплатно доступен здесь в веб-версии. Чтобы практиковать его интерактивно (встроенный редактор кода и ИИ-репетитор 24/7) и разблокировать остальной курс Linux Command Line Mastery, подпишись на CoddyKit PRO. Курс Linux Command Line Mastery содержит 4 уроков всего.
Чему я научусь в уроке «Безопасный удалённый доступ: `ssh` и `scp`»?
Освойте безопасную оболочку для удалённого доступа к серверам и защищённого копирования файлов между системами. Ты практикуешь Linux Command Line Mastery с помощью реального кода, который запускаешь прямо в браузере, и ИИ-репетитор 24/7 отвечает на твои вопросы во время урока.
Нужен ли мне опыт, чтобы начать Linux Command Line Mastery?
Предыдущий опыт не требуется. Linux Command Line Mastery на CoddyKit структурирован для всех уровней — от новичков до продвинутых, поэтому ты можешь начать отсюда или с самого начала и учиться в своем темпе. Это урок 3 из 4.
Сколько времени занимает урок «Безопасный удалённый доступ: `ssh` и `scp`»?
Большинство уроков CoddyKit занимают около 5–10 минут. Каждый из них компактный и интерактивный, поэтому ты постоянно делаешь прогресс и продолжаешь с того же места в веб-версии и приложении.
Можно ли писать и запускать код в этом уроке Linux Command Line Mastery?
Да. Каждый урок Linux Command Line Mastery включает встроенный редактор кода, поэтому ты пишешь и запускаешь реальный код прямо в браузере и получаешь моментальную обратную связь от AI — локальная установка не требуется.
Все уроки этого курса
- Управление пользователями и группами: `useradd`, `usermod`, `groupadd`
- Введение в сетевые команды: `ping`, `ip`, `netstat`
- Безопасный удалённый доступ: `ssh` и `scp`
- Разрешения и владельцы файлов с chmod и chown