On this page
What is SSH and why does it matter to you as a server owner?
When you buy a virtual private server (VPS) or a dedicated server, you don't get a screen and keyboard to sit in front of. The server lives in a data center that may be thousands of kilometers away. The natural question is: how do you control it, then? The answer is SSH.
SSH is a network protocol that lets your computer (the client) connect to another machine (the server) over the internet and open a "shell", that is, a command-line session in which the commands you type run on the remote server as if you were sitting right in front of it. Everything that passes between your computer and the server (passwords, commands, output and files) is encrypted, so no one can eavesdrop on it or modify it in transit.
Before SSH, people used protocols such as Telnet, rlogin and rsh, and they were a security disaster: they sent the password as plain text that anyone listening on the network could read. SSH appeared in 1995 to solve this problem at its root, and today it is the absolute standard for remote server administration on every Unix and Linux system, and even on Windows Server.
Why the command line at all?
You might wonder: why not a graphical panel instead of an intimidating black screen? The answer is that the command line is:
- Faster and lighter: It doesn't spend server resources drawing an interface; every byte of the server's memory goes to your application.
- More powerful: A single command can accomplish what would take dozens of clicks in a graphical interface, and it can be automated in scripts.
- Available on every server: Every Linux distribution comes with SSH ready to go, while graphical interfaces are rare and heavy on servers.
- Recordable and repeatable: You can save commands, share them and run them on hundreds of servers at once.
If you are still wondering whether you need a server with this level of control at all, see what a VPS is and when you need one to understand the difference between shared hosting and a virtual server you manage yourself.
How does SSH work? Encryption, fingerprints and authentication
To understand SSH in practice, you need to grasp three parts, each of which happens on every connection: establishing an encrypted channel, verifying the server's identity, and verifying your own identity.
1) Establishing the encrypted channel
When you connect, your computer and the server negotiate encryption algorithms and exchange temporary session keys through a mechanism called Diffie-Hellman key exchange. The result is a fast symmetric encrypted channel that protects all data for the rest of the session. This happens automatically, without any action on your part.
2) Verifying the server's identity (the host key and its fingerprint)
Every SSH server has its own key pair, called the host key. On the first connection, the client shows you this key's fingerprint and asks whether you trust it:
The authenticity of host '203.0.113.10 (203.0.113.10)' can't be established.
ED25519 key fingerprint is SHA256:abc123def456...xyz.
Are you sure you want to continue connecting (yes/no/[fingerprint])?When you type yes, the server's key is stored in the ~/.ssh/known_hosts file on your computer. On later connections, the client automatically compares the server's key with the saved one. If they match, it connects silently; if they differ, it warns you loudly (the server may have been rebuilt, or it may be a man-in-the-middle attack). This fingerprint is your first line of defense against server impersonation.
3) Verifying your identity (authentication)
Once you trust the server, it is your turn to prove who you are. There are two main methods here: a password or a public/private SSH key pair. This is a crucial point, and we devote a whole section to it, because your choice here determines the security level of your entire server.
The diagram above illustrates key authentication: your computer keeps the private key (a secret that never leaves your computer), and the server keeps the public key. The server verifies that you own the matching private key without the private key itself ever being sent over the network.
| Component | Where does it live? | Its role |
|---|---|---|
| Client (SSH client) | Your local computer | Starts the connection and encrypts your requests |
| Server (SSH daemon / sshd) | The remote server | Accepts connections and verifies identity |
| host key | The server | Proves the server's identity to the client (the fingerprint) |
| Private key | Your computer only | Proves your identity; never leaves your computer |
| Public key | The server | Placed in authorized_keys to allow you to log in |
The first connection: ssh user@ip and port 22
The basic structure of the connect command is simple:
ssh username@server-ip-or-hostnameA real-world example of connecting to a new server as root:
ssh root@203.0.113.10On the first connection, it will ask you to accept the server's fingerprint (as we saw), then ask for the password. Type it (no characters will appear on the screen, which is normal for security reasons) and press Enter. If it works, you will find yourself at the server's command prompt, like this:
root@my-server:~#Congratulations: you are now inside your server.
Specifying the port and user explicitly
SSH listens on port 22 by default. If you change the port (we will explain later why you might), specify it with the -p flag:
ssh -p 2222 username@203.0.113.10| Part | Example | Meaning |
|---|---|---|
| The command | ssh | The SSH client program |
The -p flag | -p 2222 | Connection port (22 by default) |
| User | username@ | The name of the user account on the server |
| Host | 203.0.113.10 | The server's IP or domain name |
Note: port 22 is the standard SSH port. Remember that it is the default port that must be open in the firewall for you to be able to connect.
To leave the session at any time, type exit or press Ctrl+D:
exitPasswords vs. SSH keys: why keys are far more secure
This is the most important point in the entire guide. Many breaches start with a server that accepts logins with a weak or guessable password. SSH keys solve the problem at its root.
A password is a shared secret known to both sides; it can be guessed with brute-force attacks, leaked, or captured through phishing. And since servers face thousands of automated login attempts every day, a single weak password is enough to cause a disaster.
An SSH key is a mathematical pair: a private key that stays only on your computer, and a public key that you place on the server. When you log in, your computer proves that it owns the private key through a cryptographic challenge, without the private key itself being sent. A private key (ed25519 or RSA 4096) is practically impossible to guess by brute force.
| Criterion | Password | SSH key |
|---|---|---|
| Strength against brute force | Weak to moderate | Very strong (practically impossible) |
| What travels over the network | Sent (encrypted) | The private key is never sent |
| Risk of leaking | High (phishing, reuse) | Low (the private key never leaves your computer) |
| Ease of automation | Limited (requires input) | Excellent (non-interactive login) |
| Everyday convenience | You type it every time | Instant login without typing |
| Managing multiple users | Complicated | Easy (one public key per person) |
| Extra protection | — | A passphrase on the key |
The bottom line: always use SSH keys, and disable password login once you have confirmed that your key works. This is the single most important security measure you can take for your server.
Generating SSH keys and copying them to the server
The process has three steps: generate the key pair on your computer, copy the public key to the server, and test the login.
Step 1: Generate the key pair with ssh-keygen
Open a terminal on your computer (not on the server) and run:
ssh-keygen -t ed25519 -C "your_email@example.com"It will ask where to save the key (accept the default ~/.ssh/id_ed25519 by pressing Enter), then for a passphrase, an extra layer of protection that encrypts the private key itself on your disk. Setting a passphrase is strongly recommended: that way, even if your computer is stolen, the key can't be used without it.
The result is two files in the ~/.ssh folder:
id_ed25519: the private key (never share it with anyone).id_ed25519.pub: the public key (this is the one you put on servers).
The ed25519 type is the currently recommended choice: short, fast and very secure. If you have an old system that doesn't support it, use RSA with a length of 4096 bits:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"| Flag | Example | Function |
|---|---|---|
-t | -t ed25519 | Key type (ed25519 recommended, or rsa) |
-b | -b 4096 | Key length in bits (for RSA; ed25519 is fixed) |
-C | -C "email" | A comment to identify the key (usually an email or description) |
-f | -f ~/.ssh/work_key | Path/file name of the output key |
-N | -N "passphrase" | Set the passphrase directly (for scripts) |
-p | -p | Change the passphrase of an existing key |
Step 2: Copy the public key to the server with ssh-copy-id
The easiest way to install your public key on the server:
ssh-copy-id username@203.0.113.10It will ask for the server password one last time, then automatically add your public key to the ~/.ssh/authorized_keys file on the server and set the correct permissions. If you use a custom port:
ssh-copy-id -p 2222 username@203.0.113.10If ssh-copy-id is not available (common on Windows), copy the key manually:
cat ~/.ssh/id_ed25519.pub | ssh username@203.0.113.10 "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"Step 3: Test the login
Now try connecting:
ssh username@203.0.113.10You should get in right away (or after entering the key's passphrase, if you set one) without being asked for the server password. If that works, you are ready to disable password login later.
Setting up keys is part of a complete server setup sequence. To see the full picture, from the moment you buy the server to securing it and running your application, see the guide to setting up your first VPS from scratch.
The diagram above summarizes the flow of setting up a new server: you connect first, create a non-root user, install your key, secure SSH, then install your software. SSH is the gateway to every step that follows.
The ~/.ssh/config file: shortcuts that save you time
If you manage several servers, you will get tired of typing the user, IP and port every time. The ~/.ssh/config file on your computer solves that. Create or edit it:
nano ~/.ssh/configAnd add a block for each server:
Host myserver
HostName 203.0.113.10
User deploy
Port 2222
IdentityFile ~/.ssh/id_ed25519
Host db
HostName 198.51.100.20
User admin
Port 22
IdentityFile ~/.ssh/db_keyNow, instead of a long command, you just type:
ssh myserver| Option | Example | Function |
|---|---|---|
Host | Host myserver | The short name you type |
HostName | 203.0.113.10 | The actual server address |
User | deploy | The default username |
Port | 2222 | The port |
IdentityFile | ~/.ssh/id_ed25519 | The private key used for this server |
ServerAliveInterval | 60 | Send a keepalive every 60 seconds to prevent the session from dropping |
Make sure the file's permissions are correct, or SSH will ignore it:
chmod 600 ~/.ssh/configThe most important commands after logging in
Once you are logged in, you are in a Linux environment. These are the most commonly used commands, grouped by purpose.
Navigating and listing files
pwd # print the current path
ls -lah # list files in detail, with sizes and hidden files
cd /var/www # change to a directory
cd .. # go up one directory
cd ~ # go to your home directoryManaging files and folders
mkdir projects # create a directory
touch index.html # create an empty file
cp file.txt backup.txt # copy a file
mv old.txt new.txt # move/rename
rm file.txt # delete a file
rm -r folder # delete a directory and its contents (careful!)
cat file.txt # print a file's contents
less /var/log/syslog # page through a long file (q to quit)
nano config.txt # edit a file in a simple editorPermissions and ownership
chmod 600 ~/.ssh/id_ed25519 # read/write for the owner only
chmod 755 script.sh # execute for everyone, write for the owner
chown deploy:deploy file.txt # change the file's owner and groupAdministrative privileges with sudo
A regular user doesn't have system privileges; you borrow root privileges temporarily with sudo:
sudo apt update # update the package lists
sudo apt install nginx # install a program
sudo systemctl restart nginx # restart a serviceMonitoring the system and services
top # watch processes and resources live (q to quit)
df -h # disk space
free -h # memory usage
systemctl status nginx # status of a specific service
journalctl -u nginx -n 50 # last 50 lines of the service logs| The command | Function | Example |
|---|---|---|
ls | List files | ls -lah |
cd | Change directory | cd /var/www |
cp / mv / rm | Copy/move/delete | cp a b |
chmod / chown | Permissions/ownership | chmod 644 file |
sudo | Administrative privileges | sudo apt update |
systemctl | Manage services | systemctl restart nginx |
top / df / free | Monitor resources | df -h |
journalctl | Read logs | journalctl -u nginx |
A practical tip: get used to Tab to autocomplete file names, and to the up arrow to recall previous commands. These two alone will double your speed.
Transferring files: scp, sftp and rsync
Controlling a server isn't complete without moving files to and from it. You have three tools, all of which run over encrypted SSH.
scp: quick, direct copying
scp (secure copy) is the simplest for one-off copies. The pattern: scp source destination.
Upload a file from your computer to the server:
scp ./report.pdf username@203.0.113.10:/home/username/Download a file from the server to your computer:
scp username@203.0.113.10:/var/log/app.log ./Copy an entire folder (with the -r flag), and with a custom port (a capital -P for scp):
scp -r -P 2222 ./site username@203.0.113.10:/var/www/| Flag | Function |
|---|---|
-r | Copy a directory recursively |
-P 2222 | Specify the port (note: capital P in scp) |
-i key | Specify a particular private key |
-C | Compress data during transfer |
sftp: an interactive file management session
sftp opens an interactive session in which you navigate and transfer files with FTP-like commands, but encrypted:
sftp username@203.0.113.10Inside the session:
ls # server files
lls # files on your local computer (local ls)
cd /var/www # navigate on the server
put localfile.txt # upload a file
get remotefile.txt # download a file
put -r myfolder # upload a directory
bye # quitrsync: smart syncing for large files
rsync is the most powerful for syncing and backups: it transfers only the differences, so it can resume and it speeds up large updates:
rsync -avz -e "ssh -p 2222" ./site/ username@203.0.113.10:/var/www/site/| Flag | Function |
|---|---|
-a | Archive mode (preserves permissions and timestamps) |
-v | Verbose output |
-z | Compression during transfer |
-e "ssh -p 2222" | Specify the port/SSH options |
--delete | Delete whatever no longer exists in the source (careful) |
--dry-run | Simulate without actually running (for testing) |
| Tool | Best for | Interactive? | Incremental transfer? |
|---|---|---|---|
scp | A quick one-off copy | No | No |
sftp | Browsing and managing files manually | Yes | No |
rsync | Syncing and recurring backups | No | Yes |
Securing SSH: the most important steps after setup
Your server on the public internet faces automated break-in attempts around the clock. These measures shrink the attack surface considerably. All of them are made in the SSH server's configuration file:
sudo nano /etc/ssh/sshd_configAfter any change, test the configuration, then restart the service:
sudo sshd -t # check the configuration is valid before restarting
sudo systemctl restart ssh # or: sudo systemctl restart sshdCritical warning: after making changes, don't close your current session until you have opened a new session in a separate window and confirmed that it works. If you make a configuration mistake and close your session, you may lock yourself out of your server.
1) Create a non-root user and disable root login
The most dangerous thing is allowing root to log in directly over SSH, because attackers always know its name. Create a regular user with sudo privileges first:
adduser deploy
usermod -aG sudo deployCopy your key to this user (ssh-copy-id deploy@...), test the login, then disable root login in sshd_config:
PermitRootLogin no2) Disable password authentication
Once you have confirmed that your key works fully, disable passwords to shut the door on guessing for good:
PasswordAuthentication no
PubkeyAuthentication yes
ChallengeResponseAuthentication no3) Restrict which users are allowed
Allow only specific users to log in over SSH:
AllowUsers deploy admin4) Change the default port (optional)
Changing the port from 22 provides no real security (security through obscurity), but it noticeably reduces the noise of automated login attempts in your logs:
Port 2222Remember to open the new port in the firewall before restarting, or you will be locked out:
sudo ufw allow 2222/tcp
sudo ufw delete allow 22/tcp # after confirming that 2222 works
sudo ufw enable| Setting in sshd_config | Recommended value | Effect |
|---|---|---|
PermitRootLogin | no | Prevents direct root login |
PasswordAuthentication | no | Eliminates password guessing |
PubkeyAuthentication | yes | Enables key authentication |
AllowUsers | deploy | Restricts login to specific users |
Port | 2222 | Reduces the noise of automated attacks |
MaxAuthTries | 3 | Limits authentication attempts per connection |
LoginGraceTime | 30 | Drops hanging connections quickly |
5) Install Fail2ban to block attackers automatically
Fail2ban monitors the login logs, and when it detects several failed attempts from a single IP, it automatically blocks that IP in the firewall for a period of time:
sudo apt update
sudo apt install fail2ban
sudo systemctl enable --now fail2banCreate a local configuration so your customizations aren't wiped out by updates:
sudo nano /etc/fail2ban/jail.localAnd add:
[sshd]
enabled = true
port = 2222
maxretry = 4
bantime = 3600
findtime = 600Restart it and check the status:
sudo systemctl restart fail2ban
sudo fail2ban-client status sshdThese same principles (least privilege, restricted access, blocking failed attempts) apply to every administration interface on your server, not just SSH. If you also run a control panel, apply the same logic as in the guide to securing cPanel.
SSH clients: Windows, macOS and Linux
The connection tool differs slightly depending on your local computer's operating system.
macOS and Linux
Both come with a built-in OpenSSH client. Open the Terminal app and type the ssh command directly. Every command in this guide works without any additional installation.
Windows
You have two excellent options:
- OpenSSH built into PowerShell: Windows 10/11 come with a ready-to-use OpenSSH client. Open PowerShell and type the
ssh,scpandssh-keygencommands exactly as you would on Linux. This is the simplest option and the one recommended today. - PuTTY: A long-established graphical program. You enter the server address and port in a windowed interface. For keys, PuTTY uses its own
.ppkformat generated with the PuTTYgen tool, and you transfer files with the companionpscptool.
| System | Default client | How to start |
|---|---|---|
| Linux | Built-in OpenSSH | Terminal → ssh user@ip |
| macOS | Built-in OpenSSH | Terminal → ssh user@ip |
| Windows 10/11 | OpenSSH in PowerShell | PowerShell → ssh user@ip |
| Windows (alternative) | PuTTY + PuTTYgen | Graphical interface + .ppk keys |
Managing keys and the ssh-agent
If you set a passphrase on your key (which is the right thing to do), you will be asked for it on every connection. This is where ssh-agent comes in: a program that keeps your decrypted key in memory for the whole session, so you enter the passphrase only once.
Start the agent and add your key:
eval "$(ssh-agent -s)" # start the agent
ssh-add ~/.ssh/id_ed25519 # add the key (you enter the passphrase once)
ssh-add -l # list the keys currently loaded| The command | Function |
|---|---|
ssh-add key | Add a key to the agent |
ssh-add -l | List loaded keys |
ssh-add -d key | Remove a specific key |
ssh-add -D | Remove all keys |
Tips for managing keys securely:
- One key per person, not a shared key: That way you can revoke one person's access by deleting only their key.
- Back up your private key in a safe, encrypted place: losing it means losing your access (if you have disabled passwords).
- Rotate keys regularly for sensitive accounts, and remove old ones from
authorized_keys. - Never upload your private key to a Git repository or an unencrypted cloud service.
Troubleshooting common errors
The most common SSH error messages and their direct fixes.
Permission denied (publickey)
This means the server rejected your key. Common causes: the public key is not in authorized_keys, the .ssh folder has the wrong permissions, or you are using the wrong username. Fix the permissions on the server:
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keysFor detailed diagnosis, connect in verbose mode to see which key is being tried and why it is rejected:
ssh -v username@203.0.113.10Host key verification failed
The server's key has changed from the one saved in known_hosts. The reason may be legitimate (the server was rebuilt) or dangerous (impersonation). If you are sure the change is legitimate, delete the old entry:
ssh-keygen -R 203.0.113.10Then reconnect and accept the new fingerprint.
Connection refused / Connection timed out
refused means the machine rejected the connection on that port (the SSH service is stopped or the port is closed). timed out means it didn't respond at all (the server is off, the IP is wrong, or a firewall is dropping the packets). Check:
# on the server (if you can reach it another way): make sure SSH is running
sudo systemctl status ssh
# make sure the port is open in the firewall
sudo ufw statusToo many authentication failures
The client tries so many keys that it exceeds the server's limit before reaching your correct key. Force a single key:
ssh -o IdentitiesOnly=yes -i ~/.ssh/id_ed25519 username@203.0.113.10| Error | Most likely cause | Fix |
|---|---|---|
Permission denied (publickey) | Key not installed or wrong permissions | Check authorized_keys and chmod 600 |
Host key verification failed | The server's key changed | ssh-keygen -R host, then reconnect |
Connection refused | SSH service stopped or port closed | Start sshd and open the port |
Connection timed out | Server off, or IP/firewall issue | Check the IP, the server status and the firewall |
Too many authentication failures | Too many keys tried | Use -o IdentitiesOnly=yes -i key |
WARNING: UNPROTECTED PRIVATE KEY | Private key permissions are too open | chmod 600 ~/.ssh/id_ed25519 |
Expert tips and common beginner mistakes
- Don't disable passwords before testing your key: This is the most common reason people get locked out of their server. Open a new session with the key and confirm that it works before disabling anything.
- Don't always work as root: Create a user with sudo privileges and work as that user; it reduces the risk of catastrophic commands and leaves an audit trail.
- Use
tmuxorscreenfor long tasks: If your connection drops during a long operation (an update, a backup), it may stop. These tools keep the session alive on the server. - Enable
ServerAliveIntervalin~/.ssh/configto stop firewalls from dropping idle sessions. - Keep a copy of your private key in a password manager or on encrypted media; losing it means losing access.
- Review
authorized_keysregularly and remove the keys of people who no longer need access. - Be careful with
rm -randrm -rf: There is no undo and no recycle bin on the server. Double-check the path.
Frequently asked questions
What is the difference between SSH and SSL/TLS? Both use encryption, but for different purposes. SSH is a protocol for logging in securely, controlling a remote server from the command line and transferring files. SSL/TLS is a protocol for securing connections between browsers and websites (https). In short: SSH is for managing the server, and TLS is for securing visits to your site.
Do I need to know Linux before using SSH? SSH itself is easy: one command to connect. But once you are logged in, you will need basic Linux commands (navigation, files, permissions, sudo) to get anything useful done. The commands section of this guide is enough to get started, and you will learn the rest through practice.
Is port 22 secure, or should I change it? Port 22 is secure in itself; security comes from encryption and authentication, not from the port number. Changing the port is "security through obscurity" and won't stop a serious attacker, but it does reduce the noise of automated login attempts in your logs. Far more important is disabling root login and password login and using keys.
What if I lose my private key? If password login is still enabled, log in with your password, then generate a new key and install it. If you have disabled password login, you will need your provider's panel console (console/VNC or rescue mode) to log in and install a new key. That is why it is always recommended to keep an encrypted backup of your private key.
What is the difference between ed25519 and RSA? Both are key types. ed25519 is newer: its keys are shorter and faster, and its security is excellent, which is why it is the recommended choice today. RSA is older and more widely compatible with very old systems, but it needs 4096 bits to match the security of ed25519. Choose ed25519 unless you are dealing with an old system that doesn't support it.
Can several people log in to the same server over SSH?
Yes, and that is the right way to do it. Give each person their own user and put their public key in the authorized_keys file of their own account. That way you can track who did what, and you can revoke one person's access by deleting their key without affecting anyone else.
Why don't the password characters appear as I type? This is deliberate security behavior in Linux: no asterisks or characters appear, so no one can see how long your password is. Type it with confidence and press Enter; it is actually being recorded even though the screen stays blank.
What is the difference between scp, sftp and rsync?
All three transfer files over SSH. scp is the simplest for a quick one-off copy. sftp is an interactive session in which you browse and transfer manually. rsync is the smartest for syncing and backups because it transfers only the differences and can resume, which saves a lot of time on repeated updates.
Is SSH free? Yes. OpenSSH, the most widely used client and server implementation, is open source and completely free, and it is included in every Linux distribution, macOS and Windows 10/11. There are no licensing costs at all.
How do I keep an SSH session running after I shut down my computer?
The session itself ends when you shut down your computer, but you can run long processes inside tmux or screen on the server. They keep running in the background even if your connection drops, and you can return to them later with the tmux attach command. This is essential for updates, backups and any task that must not stop.
Can I use SSH for tunneling and port forwarding? Yes, and it is a powerful feature. SSH can create encrypted "tunnels" that forward a port from your computer to a service on the server (for example, to reach an internal database securely without exposing it to the internet). This is an advanced topic, but it shows that SSH is more than just a remote command line.
Conclusion
SSH is your key, literally and figuratively, to full control of your server. You have learned how it works (encryption, the host key fingerprint, authentication), how to connect with ssh user@ip, why SSH keys are far more secure than passwords and how to generate and copy them, the most important Linux commands after logging in, how to transfer files with scp, sftp and rsync, how to secure SSH by disabling root and password login and installing Fail2ban, and how to fix the most common errors. Start today by generating an ed25519 key and installing it on your server, then disable password login once you have confirmed it works. That step alone takes you from a server exposed to guessing to a hardened one.
Frequently asked questions
What is the difference between SSH and SSL/TLS?
Both use encryption, but for different purposes. SSH is a protocol for logging in securely, controlling a remote server from the command line and transferring files. SSL/TLS is a protocol for securing connections between browsers and websites (https). In short: SSH is for managing the server, and TLS is for securing visits to your site.
Do I need to know Linux before using SSH?
SSH itself is easy: one command to connect. But once you are logged in, you will need basic Linux commands (navigation, files, permissions, sudo) to get anything useful done. The commands section of this guide is enough to get started, and you will learn the rest through practice.
Is port 22 secure, or should I change it?
Port 22 is secure in itself; security comes from encryption and authentication, not from the port number. Changing the port is "security through obscurity" and won't stop a serious attacker, but it does reduce the noise of automated login attempts in your logs. Far more important is disabling root login and password login and using keys.
What if I lose my private key?
If password login is still enabled, log in with your password, then generate a new key and install it. If you have disabled password login, you will need your provider's panel console (console/VNC or rescue mode) to log in and install a new key. That is why it is always recommended to keep an encrypted backup of your private key.
What is the difference between ed25519 and RSA?
Both are key types. ed25519 is newer: its keys are shorter and faster, and its security is excellent, which is why it is the recommended choice today. RSA is older and more widely compatible with very old systems, but it needs 4096 bits to match the security of ed25519. Choose ed25519 unless you are dealing with an old system that doesn't support it.
Can several people log in to the same server over SSH?
Yes, and that is the right way to do it. Give each person their own user and put their public key in the authorized_keys file of their own account. That way you can track who did what, and you can revoke one person's access by deleting their key without affecting anyone else.
Why don't the password characters appear as I type?
This is deliberate security behavior in Linux: no asterisks or characters appear, so no one can see how long your password is. Type it with confidence and press Enter; it is actually being recorded even though the screen stays blank.
What is the difference between scp, sftp and rsync?
All three transfer files over SSH. scp is the simplest for a quick one-off copy. sftp is an interactive session in which you browse and transfer manually. rsync is the smartest for syncing and backups because it transfers only the differences and can resume, which saves a lot of time on repeated updates.
Is SSH free?
Yes. OpenSSH, the most widely used client and server implementation, is open source and completely free, and it is included in every Linux distribution, macOS and Windows 10/11. There are no licensing costs at all.
How do I keep an SSH session running after I shut down my computer?
The session itself ends when you shut down your computer, but you can run long processes inside tmux or screen on the server. They keep running in the background even if your connection drops, and you can return to them later with the tmux attach command. This is essential for updates, backups and any task that must not stop.
Can I use SSH for tunneling and port forwarding?
Yes, and it is a powerful feature. SSH can create encrypted "tunnels" that forward a port from your computer to a service on the server (for example, to reach an internal database securely without exposing it to the internet). This is an advanced topic, but it shows that SSH is more than just a remote command line.