{"id":2386,"date":"2024-06-02T16:47:43","date_gmt":"2024-06-02T13:47:43","guid":{"rendered":"https:\/\/www.fibacloud.com\/community\/tutorials\/?p=2386"},"modified":"2026-10-04T22:57:46","modified_gmt":"2026-10-04T19:57:46","slug":"how-to-connect-to-a-remote-server-via-ssh","status":"publish","type":"post","link":"https:\/\/www.fibacloud.com\/community\/tutorials\/en\/how-to-connect-to-a-remote-server-via-ssh\/","title":{"rendered":"How to Connect to a Remote Server with SSH"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"2386\" class=\"elementor elementor-2386\" data-elementor-post-type=\"post\">\n\t\t\t\t<div class=\"elementor-element elementor-element-247689a e-con-full e-flex e-con e-parent\" data-id=\"247689a\" data-element_type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-ca5ec3e elementor-widget elementor-widget-text-editor\" data-id=\"ca5ec3e\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.21.0 - 08-05-2024 *\/\n.elementor-widget-text-editor.elementor-drop-cap-view-stacked .elementor-drop-cap{background-color:#69727d;color:#fff}.elementor-widget-text-editor.elementor-drop-cap-view-framed .elementor-drop-cap{color:#69727d;border:3px solid;background-color:transparent}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap{margin-top:8px}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap-letter{width:1em;height:1em}.elementor-widget-text-editor .elementor-drop-cap{float:left;text-align:center;line-height:1;font-size:50px}.elementor-widget-text-editor .elementor-drop-cap-letter{display:inline-block}<\/style>\t\t\t\t<p>SSH provides an encrypted connection for running commands on a remote server. A secure connection has two separate checks: <strong>the server\u2019s identity<\/strong> and <strong>the user\u2019s authorization<\/strong>. The server host key and your user key are different keys. Your user private key stays on your own device.<\/p>\n<h2>Before you connect<\/h2>\n<p>This guide uses OpenSSH on Linux, macOS or Windows to reach a server you are authorized to access. Obtain the server address, existing SSH port, assigned username and accepted authentication method from the administrator. Replace <code>server.example.com<\/code>, <code>deploy<\/code> and <code>22<\/code> with your own values.<\/p>\n<p>The SSH service must be running, your account must permit login and network rules must allow your source address. Having a cloud server does not automatically create an SSH account. Use an individual or task-specific account with only the required privileges instead of a shared <code>root<\/code> login. Verify access to the provider\u2019s recovery console before initial setup or access changes.<\/p>\n<p>Check your client:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c8fcb52 elementor-widget elementor-widget-text-editor\" data-id=\"c8fcb52\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<pre><code class=\"language-bash\">ssh -V<\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4265f62 elementor-widget elementor-widget-text-editor\" data-id=\"4265f62\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>On Windows, run this in PowerShell or Windows Terminal. If OpenSSH is unavailable, install the operating system\u2019s supported OpenSSH Client component. PuTTY users must perform the same host-identity check; do not automatically accept an unknown key.<\/p>\n<figure class=\"fc-editorial-figure\" data-fc-visual=\"20260920\" aria-labelledby=\"fc-editorial-caption-2386\"><a href=\"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-content\/uploads\/community-editorial-20260920\/fc-ssh-en-inline-20260920.webp\" target=\"_blank\" rel=\"noopener\" aria-label=\"Open full-size illustration\"><picture><source media=\"(max-width: 600px)\" srcset=\"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-content\/uploads\/community-editorial-20260920\/fc-ssh-en-mobile-20260920.webp\" width=\"720\" height=\"1140\"><img loading=\"lazy\" src=\"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-content\/uploads\/community-editorial-20260920\/fc-ssh-en-inline-20260920.webp\" srcset=\"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-content\/uploads\/community-editorial-20260920\/fc-ssh-en-inline-20260920.webp 1440w, https:\/\/www.fibacloud.com\/community\/tutorials\/wp-content\/uploads\/community-editorial-20260920\/fc-ssh-en-inline-20260920-300x242.webp 300w, https:\/\/www.fibacloud.com\/community\/tutorials\/wp-content\/uploads\/community-editorial-20260920\/fc-ssh-en-inline-20260920-1024x825.webp 1024w, https:\/\/www.fibacloud.com\/community\/tutorials\/wp-content\/uploads\/community-editorial-20260920\/fc-ssh-en-inline-20260920-768x619.webp 768w\" sizes=\"auto, (max-width: 900px) 100vw, 820px\" width=\"1440\" height=\"1160\" alt=\"Which side holds each key?\" class=\"wp-image-2560\"  decoding=\"async\"><\/picture><\/a><figcaption id=\"fc-editorial-caption-2386\"><strong>Which side holds each key?<\/strong> The host key authenticates the server. The user\u2019s private key stays on the client; the authorized public key on the server verifies the user\u2019s signature.<details><summary>Step-by-step explanation<\/summary><ol><li>Identify: Verify the server host-key fingerprint.<\/li><li>Keep: The user private key stays on the client.<\/li><li>Sign: The client proves possession of its key.<\/li><li>Verify: The server checks the authorized public key.<\/li><\/ol><\/details><\/figcaption><\/figure>\n<h2>Verify the server fingerprint on the first connection<\/h2>\n<p>Obtain the SSH fingerprint through the provider\u2019s trusted console or an independently verified administrator channel. If the server uses an Ed25519 host key, an administrator can inspect its fingerprint from the server console with this read-only command:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d59a6e7 elementor-widget elementor-widget-text-editor\" data-id=\"d59a6e7\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<pre><code class=\"language-bash\">sudo ssh-keygen -lf \/etc\/ssh\/ssh_host_ed25519_key.pub -E sha256<\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9bec6c3 elementor-widget elementor-widget-text-editor\" data-id=\"9bec6c3\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>If the server offers a different key type, compare the fingerprint for that same algorithm. Forcing an unsupported algorithm or disabling client warnings is not a solution.<\/p>\n<p>Connect from your computer:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-45ebee9 elementor-widget elementor-widget-text-editor\" data-id=\"45ebee9\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<pre><code class=\"language-bash\">ssh -o StrictHostKeyChecking=ask -p 22 deploy@server.example.com<\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1d386b2 elementor-widget elementor-widget-text-editor\" data-id=\"1d386b2\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Accept the key only when its type and SHA256 fingerprint match the value obtained through the trusted channel. Stop if they differ. A key obtained from the same unverified connection or collected only with <code>ssh-keyscan<\/code> does not independently establish the server\u2019s identity.<\/p>\n<p>The accepted key is saved in your local <code>known_hosts<\/code> file. The next prompt may ask for your account password or your user-key passphrase. These are different from the host-fingerprint check.<\/p>\n<h2>Create a user key and authorize only its public half<\/h2>\n<p>Do not overwrite an existing file with the same name. If your policy and server support Ed25519:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-18f26be elementor-widget elementor-widget-text-editor\" data-id=\"18f26be\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<pre><code class=\"language-bash\">ssh-keygen -t ed25519 -f \"$HOME\/.ssh\/fibacloud_ed25519\" -C \"deploy workstation\"<\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-268140c elementor-widget elementor-widget-text-editor\" data-id=\"268140c\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Set a strong key passphrase when prompted. <code>fibacloud_ed25519<\/code> is the private key; <code>fibacloud_ed25519.pub<\/code> is the shareable public key. Do not upload the private key to the server, a repository or a support request.<\/p>\n<p>On Linux\/macOS with <code>ssh-copy-id<\/code> installed, add the public key to your authorized account after verifying the host fingerprint:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9397fc1 elementor-widget elementor-widget-text-editor\" data-id=\"9397fc1\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<pre><code class=\"language-bash\">ssh-copy-id -i \"$HOME\/.ssh\/fibacloud_ed25519.pub\" -p 22 deploy@server.example.com<\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d9c744d elementor-widget elementor-widget-text-editor\" data-id=\"d9c744d\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>This uses your existing authorized login. If password login is disabled or your Windows client lacks <code>ssh-copy-id<\/code>, send the public key to the authorized administrator through a trusted channel. The administrator should add it to the correct account\u2019s <code>authorized_keys<\/code> file without deleting existing keys.<\/p>\n<p>Test the new key in a separate terminal:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c333d56 elementor-widget elementor-widget-text-editor\" data-id=\"c333d56\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<pre><code class=\"language-bash\">ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes \\\n  -i \"$HOME\/.ssh\/fibacloud_ed25519\" -p 22 deploy@server.example.com<\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f481e6e elementor-widget elementor-widget-text-editor\" data-id=\"f481e6e\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>This requires the host key to have already been verified and recorded. Keep the existing recovery session open until the new session works.<\/p>\n<h2>Configure repeat connections<\/h2>\n<p>Add a separate <code>Host<\/code> section to <code>~\/.ssh\/config<\/code> without replacing existing settings:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-826222d elementor-widget elementor-widget-text-editor\" data-id=\"826222d\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<pre><code class=\"language-text\">Host fibacloud-test\n    HostName server.example.com\n    User deploy\n    Port 22\n    IdentityFile ~\/.ssh\/fibacloud_ed25519\n    IdentitiesOnly yes\n    StrictHostKeyChecking yes<\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-49e44c4 elementor-widget elementor-widget-text-editor\" data-id=\"49e44c4\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>On Linux\/macOS, restrict file permissions. On Windows, configure the files\u2019 NTFS permissions for your account.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-eedb3ea elementor-widget elementor-widget-text-editor\" data-id=\"eedb3ea\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<pre><code class=\"language-bash\">chmod 700 \"$HOME\/.ssh\"\nchmod 600 \"$HOME\/.ssh\/config\" \"$HOME\/.ssh\/fibacloud_ed25519\"\nssh -G fibacloud-test\nssh fibacloud-test<\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f6a60df elementor-widget elementor-widget-text-editor\" data-id=\"f6a60df\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p><code>ssh -G<\/code> displays effective client settings without connecting. After login, use <code>whoami<\/code> and <code>hostname<\/code> to check the account and machine. Use <code>exit<\/code> to close the session when finished.<\/p>\n<h2>Separate connection failures<\/h2>\n<table>\n<thead>\n<tr>\n<th>Symptom<\/th>\n<th>Check first<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>Connection timed out<\/code><\/td>\n<td>Address, existing port, client network and rules allowing your source IP. Changing credentials will not repair network reachability.<\/td>\n<\/tr>\n<tr>\n<td><code>Connection refused<\/code><\/td>\n<td>Destination address\/port and whether SSH is listening. Investigate through the recovery console.<\/td>\n<\/tr>\n<tr>\n<td><code>Permission denied (publickey)<\/code><\/td>\n<td>Username, selected private key and the public key authorized for that account.<\/td>\n<\/tr>\n<tr>\n<td><code>REMOTE HOST IDENTIFICATION HAS CHANGED<\/code><\/td>\n<td>Reinstallation, approved key rotation or the wrong server. Independently verify the new fingerprint before removing an old record.<\/td>\n<\/tr>\n<tr>\n<td><code>Too many authentication failures<\/code><\/td>\n<td>The intended <code>IdentityFile<\/code> and <code>IdentitiesOnly yes<\/code>; the agent may be offering too many keys.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><code>ssh -v fibacloud-test<\/code> provides client diagnostics. Review addresses, usernames and local paths before sharing logs. Do not hide errors with <code>StrictHostKeyChecking=no<\/code>.<\/p>\n<h2>Make changes without losing access<\/h2>\n<p>This guide does not change the server\u2019s SSH port or login policy. Changing a port is not a sufficient access-security measure. Before later disabling password login or changing network rules, verify a second key-authenticated session and recovery-console access. The administrator should run the configuration test before restarting the service.<\/p>\n<p>If the new key fails, preserve the working login. For rollback, remove only the client <code>Host<\/code> section or public-key line added in this procedure; do not delete entire <code>authorized_keys<\/code> or <code>known_hosts<\/code> files. If a key may be exposed, revoke its public-key authorization and generate a replacement.<\/p>\n<h2>Sources<\/h2>\n<ul>\n<li><a href=\"https:\/\/man.openbsd.org\/ssh\" rel=\"nofollow noopener\" target=\"_blank\">OpenSSH \u2014 ssh: connections, authentication and host keys<\/a><\/li>\n<li><a href=\"https:\/\/man.openbsd.org\/ssh_config\" rel=\"nofollow noopener\" target=\"_blank\">OpenSSH \u2014 ssh_config: StrictHostKeyChecking, IdentityFile and IdentitiesOnly<\/a><\/li>\n<li><a href=\"https:\/\/man.openbsd.org\/ssh-keygen\" rel=\"nofollow noopener\" target=\"_blank\">OpenSSH \u2014 ssh-keygen: keys and fingerprints<\/a><\/li>\n<\/ul>\n<p class=\"fc-article-review-date\">Technical content and sources reviewed on October 4, 2026. Recheck the relevant official documentation when a version or provider changes.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Connect with OpenSSH, verify the server fingerprint, protect your user key and troubleshoot connectivity without bypassing identity checks.<\/p>\n","protected":false},"author":1,"featured_media":2559,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[240,78,242,244],"class_list":["post-2386","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials-en","tag-remote-server","tag-security","tag-server-management","tag-ssh"],"lang":"en","translations":{"en":2386,"tr":1889},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/posts\/2386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/comments?post=2386"}],"version-history":[{"count":11,"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/posts\/2386\/revisions"}],"predecessor-version":[{"id":2398,"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/posts\/2386\/revisions\/2398"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/media\/2559"}],"wp:attachment":[{"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/media?parent=2386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/categories?post=2386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fibacloud.com\/community\/tutorials\/wp-json\/wp\/v2\/tags?post=2386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}