Connect to your server with SSH

VPS & Servers

0 people found this article helpful

Open a terminal and run ssh root@your-server-ip. It works the same from Windows 10 and 11, macOS and Linux, with a password or an SSH key.

Good to know: this article is for VPS, cloud and dedicated servers where you have root access. You need the server's IP address and the root password, or an SSH key that is already on the server.

Connect for the first time

  1. Open a terminal. On Windows, open PowerShell or Terminal from the Start menu: Windows 10 and 11 already include the OpenSSH client. On macOS, open Terminal. On Linux, open your terminal app.

  2. Connect as root. Replace 203.0.113.10 with your server's IP address:

    ssh [email protected]

    If your server listens on a different SSH port, add -p and the port number:

    ssh -p 2222 [email protected]
  3. The first time, SSH shows the server's key fingerprint and asks Are you sure you want to continue connecting. Type yes and press Enter. Your computer remembers the server from now on.

  4. Type the root password and press Enter. Nothing appears on the screen while you type: that's normal.

You're in when the prompt changes to something like root@server:~#. Check which system you're on:

cat /etc/os-release
hostname

The first command shows the Linux version (for example Ubuntu 24.04 or AlmaLinux 9), the second the server's name. Type exit to close the connection.

Log in with an SSH key instead of a password

A key is safer than a password and you don't have to type anything to log in. You create the key pair on your own computer, then copy the public half to the server.

  1. On your computer, create a key (press Enter to accept the default file, then set a passphrase):

    ssh-keygen -t ed25519

    This creates a private key id_ed25519 and a public key id_ed25519.pub in the .ssh folder of your user. Never share the private key.

  2. Copy the public key to the server. On macOS and Linux:

    ssh-copy-id [email protected]

    Windows has no ssh-copy-id. In PowerShell, use this instead (one line):

    type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh [email protected] "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"

    Both ask for the root password one last time.

  3. Test it: run ssh [email protected] again. If it logs you in without the root password (it may ask for your key's passphrase), the key works.

Turn off password logins (optional)

Once your key works, you can stop password logins so nobody can guess their way in. Keep your current SSH session open while you do this, and test from a second window before you close it.

printf 'PasswordAuthentication no\nPermitRootLogin prohibit-password\n' > /etc/ssh/sshd_config.d/10-key-only.conf
sshd -t

The first line creates a small settings file. The file name starts with 10- so it's read before files such as 50-cloud-init.conf, which can switch passwords back on. sshd -t checks the settings and prints nothing when they're fine. Then reload SSH:

# Ubuntu
systemctl reload ssh
# AlmaLinux, Rocky Linux, CloudLinux
systemctl reload sshd

Check the result. Both lines should show the values you set:

sshd -T | grep -Ei '^(passwordauthentication|permitrootlogin)'

Now open a new terminal window and log in with your key. Only close the old session when that works.

Common problems

"Connection timed out"

Your computer can't reach the server. Check the IP address, check that the server is running, and check that a firewall on the server (or on your network) allows the SSH port, normally 22.

"Connection refused"

The server answers, but nothing listens on that port. SSH may run on another port (use -p), or the SSH service is stopped. If you can reach the server through a console, start it with systemctl start ssh on Ubuntu or systemctl start sshd on AlmaLinux.

"Permission denied (publickey)"

The server only accepts keys, and your key isn't on it or isn't the one SSH offers. Point SSH at the right key with ssh -i ~/.ssh/id_ed25519 [email protected]. If password logins were turned off before your key was copied, you need console access to add the key.

"REMOTE HOST IDENTIFICATION HAS CHANGED"

This appears after the server was reinstalled, because it now has a new key. If you know the server was reinstalled, remove the old entry on your computer and connect again:

ssh-keygen -R 203.0.113.10

If nobody reinstalled the server, don't connect: contact us first.

If you'd rather not manage the server yourself, ElySpace also offers managed servers.

Related articles

Still stuck? Open a support ticket and we'll help.


Was this answer helpful?

2FA 301 redirect 3D Secure 404 page 500 error 550 error A record accept quote access log account credit account details account password Account Preferences account security add funds addon domain address importer affiliate program AI assistant AlmaLinux 9 Android email Apache Apache virtual host API token Apple Mail Ask AI auth code authenticator app auto-renew automatic payment automatic updates autoresponder AutoSSL bandwidth billing address billing contact billing section block editor block IP bounce bounce message BoxTrapper build a WordPress website bulk email accounts business email buy domain buy hosting buy SSL certificate CalDAV calendar sync callback can't log in cancel hosting cancellation card declined CardDAV catch-all Certbot change domain WordPress change email change nameserver change package change password change payment checklist checkout choose a plan client accounts client area clone WordPress cloud server coming soon page commission company name confirmation link contact contact form Contact Information contacts control panel cPanel cPanel API cPanel contact email cPanel DNS cPanel domains cPanel email cPanel install cPanel language cPanel layout cPanel login cPanel password cPanel SSL cPanel update cPanel users create cPanel account create mailbox credit card cron cron job CRT key CA bundle CSF firewall CSV import currency custom error page Custom Nameservers custom offer dashboard data center database password database privileges database user Database Wizard date.timezone DDNS deceptive site ahead default address delete database delete old emails deny access deploy deposit device email settings Directory Privacy disk space disk usage DKIM DMARC DNS cache DNS explained DNS Records DNS Zone Management document root domain alias domain grace period Domain Hosting Domain Management domain name domain renewal domain transfer downgrade download invoice due date dynamic DNS ElySpace email account email account exists email backup email client email delivery email disk usage email filters email forwarder email history email hosting email login email migration email password email ports email preferences email quota email routing email signature email test email verification EPP code error error log error pages EV SSL expired domain expiry expiry date export database export emails fake email faster support feedback File Manager file permissions firewall first website flush DNS folder force HTTPS forgot password form email not received forward email free migration free SSL FTP account's password FTP password Galaxy email setup getting started Git GitHub Gmail Gmail app GoDaddy good ticket Google malware warning Google sign-in Google Workspace GST number Gzip compression hacked website hacked WordPress hardening help help center home server hosting hosting addons hosting glossary hosting location hosting plan Hosting Service hosting terms hosting tools hosting types hostname hostname SSL hostnamectl hotlink protection HOW TO ADD NAME SERVERS TO MY DOMAIN NAME How to create additional FTP accounts in cPanel How to create FTP accounts in cPanel How to setup name-servers for a domain htaccess htaccess redirect HTTP to HTTPS image theft IMAP IMAP settings IMAP SMTP settings import emails import SQL Imunify360 index.php virus INR install plugin install SSL certificate install WordPress instant answers invite user invoice invoice details invoice emails invoice PDF invoices IP address IP Blocker iPad iPhone email knowledgebase language large database leech protection LEMP Let's Encrypt LFD linked accounts LiteSpeed Cache live chat locked out log out login login email login problem lost email Mac Mac email mail rules mailbox mailbox check mailbox full mailbox size mailing list Mailman maintenance maintenance mode malware removal malware scan manage services mass payment max_execution_time members area memory_limit menu migrate WordPress migration request migration ticket mobile webmail money-back guarantee move email move website move WordPress site MultiPHP INI Editor MultiPHP Manager multiple accounts multiple websites MX record MX records my domains MySQL MySQL database MySQL user mysqldump nameserver Nameservers network drive new account new order newsletter Nginx Node.js notifications npm nvm open ticket Optimize Website or delete order order email out of office outage Outlook Outlook app Outlook IMAP Outlook mobile Outlook password prompt OX App Suite OX webmail page speed password protect pay all pay invoice payment payment details payment failed payment method payment methods PayPal permalinks permissions phishing phone support PHP errors PHP timezone PHP version PHP-FPM php.ini PHPMailer phpMyAdmin plugin updates point domain print invoice printer SMTP product addons products professional email profile public_html publish a post quick start quota quote quotes rating Raw Access raw access logs reading settings redemption period redirect referral link refund register register domain remove user renew domain renewal repair database reseller hosting reset admin password reset password resource usage restore WordPress revoke access revoke privileges root login Roundcube Roundcube export Roundcube identities Roundcube signature rsync backup Samsung Email scam scan to email scheduled task search Search Console self-hosted WordPress send and receive send as server IP address server location server security server status service details services session setup setup domain i setup domain name shared passwords shared vs VPS sign up single sign-on site address Sitejet Builder SMTP SMTP settings spam spam filter SpamAssassin SPF SSH SSH hardening SSH key SSL certificate static front page strong password subaccount subdomain suggestions support ticket support ticket tips support tickets suspension switch account tar test site Thunderbird ticket reply ticket status track delivery transfer website troubleshooting two-factor authentication UAPI Ubuntu Ubuntu 24.04 UFW unpaid invoice unsubscribe unzip upcp upgrade hosting UPI upload files upload_max_filesize URL forwarding user management User Manager username vacation reply VAT ID verify email Web Disk web hosting web hosting basics web server WebDAV webmail webmail From address webmail on phone webmail password website builder website email website migration website not loading Website Performance website security welcome email WhatsApp WhatsApp support whitelist WHM wildcard SSL WordPress 404 WordPress backup WordPress caching WordPress critical error WordPress email WordPress errors WordPress homepage WordPress hosting WordPress login WordPress malware WordPress Management WordPress menu WordPress offline WordPress pages WordPress password WordPress plugins WordPress post WordPress security WordPress SMTP WordPress speed WordPress staging WordPress themes WordPress transfer WordPress update WordPress URL WordPress.org vs WordPress.com WP Mail SMTP wp-admin wp-admin login wp-cron zip Zone Editor zone templates