~/wiki / bezopasnost / what-is-ftp-ssh-public-private-keys-complete-guide

What are FTP and SSH? The most detailed and understandable guide for beginners

◷ 6 min read 5/27/2026

Main chat

A chat for vibe coders: news, guides, live cases, marketplace, and finding executors.

$ cd section/ $ join vibe dev

Imagine that you have an apartment (your server on the Internet), and you need to constantly put things in there (your site files or bot), change furniture (code), and sometimes check if everything is OK. For this purpose there are special "doors and keys" - protocols FTP and SSH.

In this article, we’re going to break it down in as simple words as possible, as if explaining it to a friend who has never worked with servers before. Without complex jargon, with life examples and step-by-step instructions.

1. What is FTP? (File Transfer Protocol)

**FTP is an old but very simple way to transfer files to a server.

It appeared in 1971, before the invention of the modern Internet. Imagine a mailbox where you can put a letter or pick it up. FTP works in much the same way.

What does it look like in practice:

  • You open a program (for example, FileZilla).
  • Enter the server address, login and password.
  • You see two panels: on the left, your files on your computer, on the right, the files on the server.
  • Drag files with the mouse - they are downloaded or downloaded.

** Plus FTP:**

  • Very simple
  • Quickly mastered
  • Supported by almost all hosting services

Huge downsides (why it's hardly used):

  • Everything is transmitted in open text, like a postcard that anyone can read on the way.
  • Login, password and all files can be intercepted.
  • Easy to crack.

Conclusion: FTP can only be used in two ways:

  1. On the local network within the company (where no one can connect).
  2. For very old projects, where it does not work otherwise.

In 2026, we're using *protected options for normal operation.

2. What is SSH? (Secure Shell)

*SSH is a secure "protected shell". It’s like a secret tunnel between your computer and your server.

Through SSH, you can:

  • Connect to the server and work in the command line (as if sitting right behind the server).
  • Transferring files is safe.
  • Run programs on the server.
  • Configure the server remotely.

The main advantage is ** everything is encrypted. Even if someone intercepts your traffic, they will only see the “porridge” of the symbols.

SSH operates on 22 port (standard).

3.SFTP and SCP are FTP safe brothers

  • **SFTP (SSH File Transfer Protocol) is an FTP, but inside a secure SSH tunnel. The most convenient option for most people.
  • SCP (Secure Copy) is an easier way to quickly copy files through the command line.

Most modern programs (FileZilla, WinSCP) support **SFTP.

4. Public and private keys – how it works (simple analogy)

This is the most important and slightly difficult part. Let's take an example.

Imagine what you have:

  • **Very complex lock (public key) - you can give out copies of this lock to anyone.
  • The only key to this lock is the one you have.

Anyone who has a lock (public key) can close the box. It can only be opened by the owner of the private key.

** Important rules:**

  • Don't ever give a private key to anyone.
  • If someone steals your private key, they can access the server.
  • The public key can be inserted on as many servers as you like.

5. Step-by-step instructions: how to create keys

On Windows:

  1. Press Win + S and enter PowerShell.
  2. Insert the command:
powershell
ssh-keygen -t ed25519 -C "yourname@vibecode.ru"
  1. Press Enter several times (or come up with a good passphrase.).

On macOS and Linux:

Open the terminal and do:

bash
ssh-keygen -t ed25519 -C "yourname@vibecode.ru"

The recommended *Ed25519 is modern, fast and very reliable.

After creating the keys, you will receive two files:

  • id_ed25519 - private (keep as the apple of your eye)
  • id_ed25519.pub - Public

6. How to add a public key to the server

The easiest way is:

bash
# From your computer.
ssh-copy-id username@your-server-ip

Or by hand:

  1. Go to the server with the password.
  2. Follow the commands:
bash
mkdir -p ~/.ssh
chmod 700 ~/.ssh
cat >> ~/.ssh/authorized_keys

(Insert the contents of your .pub file)

bash
chmod 600 ~/.ssh/authorized_keys

7. How to connect conveniently

Through the program (recommended for beginners):

  • *FileZilla (free, works everywhere)
  • WinSCP (especially good for Windows)
  • ** Cyberduck**

Through the terminal:

bash
ssh username@your-server-ip

You can create a convenient configuration file ~/.ssh/config:

bash
Host myserver
    HostName 123.456.789.012
    User damir
    IdentityFile ~/.ssh/id_ed25519
    Port 22

Then the connection will be simple: ssh myserver

8. Best safety practices

  1. *Turn off your password completely..
  2. Use a long passphrase on your private key.
  3. Create a separate user for each project.
  4. Update the server system regularly.
  5. Install Fail2Ban (excess protection).
  6. Do not use port 22 (you can change it).
  7. Make backup copies of keys in encrypted form.

9. Frequent problems and solutions

  • "Permission denied (publickey)" - key not added or incorrect rights.
  • Connection refused: The SSH server does not start or blocks the firewall.
  • The key does not work after the reboot - a problem with the rights to the .ssh folder.
  • Try the ed25519 algorithm instead of RSA.

10. Comparative table

Возможность Обычный FTP SFTP (SSH) SCP
Безопасность Очень низкая Очень высокая Очень высокая
Удобство для файлов Отличное Отличное Среднее
Скорость Высокая Высокая Очень высокая
Работа через командную строку Нет Да Да
Рекомендация в 2026 Не использовать Основной выбор Для скриптов

Conclusion

Now you understand what FTP, SSH, SFTP, public and private keys are.

Briefly remember:

  • FTP is old and dangerous.
  • SSH is a modern and secure way of access.
  • Keys are the most reliable method of login (better than passwords).

Start small: generate keys, connect via FileZilla via SFTP, turn off the password. This is one of the most important skills for anyone who works with websites, bots or apps.

If something does not work, write in the comments, we will analyze your specific situation.

$ cd ../ ← back to Security