Skip to content
Back to blog

Magichosting

Connecting to your Linux server via SSH: the first steps

E
Elias Bieber
Estimated reading time: 3 min

Your first steps on a Linux server: connect via SSH from Windows, Mac or Linux, understand the fingerprint and learn the most important commands.

LinuxSSHGetting startedDebianUbuntu

What is SSH?

SSH (Secure Shell) is the encrypted command line of your Linux server. You use it to install software, edit configurations and read logs – whether your computer runs Windows, macOS or Linux. You only need three details from the MagicHosting dashboard: the IP address, the user root and the password. If you selected an SSH key when ordering, you sign in with your key instead.

Connecting from Windows, macOS and Linux

Windows 10 and 11 already include the OpenSSH client. Open PowerShell or Terminal; on a Mac and on Linux, open the terminal. The command is the same everywhere:

bash
ssh root@YOUR-SERVER-IP

On the first connection, SSH asks whether you trust the server and shows its fingerprint. With yes your computer remembers the server; then you enter the password. No asterisks appear while typing – that's normal.

Prefer a graphical tool? On Windows, PuTTY works too: enter the IP address, port 22, "Open".

Your first commands

After the first login, bring the system up to date. These are the commands you'll need most often:

bash
apt update && apt upgrade -y   # update the system
passwd                         # change the root password
hostnamectl                    # show system and hostname
df -h                          # disk space
free -h                        # memory
htop                           # live processes (quit with q; apt install htop if missing)
systemctl status SERVICE       # status of a service
journalctl -u SERVICE -n 50    # last 50 log lines of a service

Use exit or Ctrl + D to disconnect. Programs that should keep running after you log out – such as a game server or a bot – are set up as a systemd service or installed directly via the Autoinstaller in the dashboard.

Signing in with an SSH key instead of a password

An SSH key is safer and more convenient than a password. You create it once on your computer and copy the public part to the server:

bash
# Windows (PowerShell): create a key and copy it to the server
ssh-keygen -t ed25519
type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh root@YOUR-SERVER-IP "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

# macOS and Linux
ssh-keygen -t ed25519
ssh-copy-id root@YOUR-SERVER-IP

At MagicHosting you can also store keys in the dashboard and select them when ordering a Linux server – the key is then set up from the first boot. Securing SSH: keys, users and firewall shows how to switch off password login afterwards.

Common error messages

  • Connection timed out: The server is still starting, switched off, or a firewall blocks port 22. Check the status in the dashboard and use the VNC console if needed.
  • Connection refused: The SSH service isn't running. In the VNC console, start it with systemctl restart ssh.
  • Permission denied: Wrong user name or password – or password login is disabled and your key is missing.
  • REMOTE HOST IDENTIFICATION HAS CHANGED: Typical after a reinstall: the server has new keys. Remove the old entry with ssh-keygen -R YOUR-SERVER-IP and reconnect.

Next steps

  1. Secure SSH – keys, your own user, no password login.
  2. Set up Fail2ban – automatic bans for brute-force attempts.
  3. UFW firewall without lockouts – open only the ports you really need.

Was this post helpful?

MagicHosting – Hosting with real value

Hosting pays off with MagicHosting: fair pricing, current deals and operation in SkyLink RZ. Servers, domains and personal support – no hidden costs.

  • Current limited offers from our server exchange
  • Affordable domains with transparent pricing and great offers
  • Powerful DDoS protection for maximum availability
  • Personal support when you have questions or issues