{"id":1675,"date":"2021-10-02T13:46:36","date_gmt":"2021-10-02T11:46:36","guid":{"rendered":"http:\/\/calculs.univ-cotedazur.fr\/?page_id=1675"},"modified":"2025-12-03T15:46:25","modified_gmt":"2025-12-03T14:46:25","slug":"connection-using-an-ssh-key","status":"publish","type":"page","link":"https:\/\/calculs.univ-cotedazur.fr\/?page_id=1675&lang=en","title":{"rendered":"Connection using an SSH key"},"content":{"rendered":"\n<p>The usual location for ssh keys is ~\/.ssh on Mac\/Linux and C:\\Users\\%username%\\.ssh on Windows.<\/p>\n\n\n\n<ul><li>id_ed25519.pub: the public key that must be installed on the servers to which you want to connect.<\/li><li>id_ed25519: the private key that must be on the machine you are connecting from. The private key should never be given to other people.<\/li><\/ul>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_11 counter-hierarchy counter-decimal ez-toc-grey\">\n<nav><ul class=\"ez-toc-list ez-toc-list-level-1\"><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/calculs.univ-cotedazur.fr\/?page_id=1675&amp;lang=en#Generate_your_SSH_key\" title=\"Generate your SSH key\">Generate your SSH key<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/calculs.univ-cotedazur.fr\/?page_id=1675&amp;lang=en#How_to_connect_from_different_machines\" title=\"How to connect from different machines\">How to connect from different machines<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/calculs.univ-cotedazur.fr\/?page_id=1675&amp;lang=en#Frequent_errors\" title=\"Frequent errors\">Frequent errors<\/a><ul class=\"ez-toc-list-level-5\"><li class=\"ez-toc-heading-level-5\"><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/calculs.univ-cotedazur.fr\/?page_id=1675&amp;lang=en#If_nothing_happens_when_trying_to_connect\" title=\"If nothing happens when trying to connect\">If nothing happens when trying to connect<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-5\"><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/calculs.univ-cotedazur.fr\/?page_id=1675&amp;lang=en#Permission_denied_(publickey,gssapikeyex,gssapiwithmic)\" title=\"Permission denied (publickey,gssapi-keyex,gssapi-with-mic).\">Permission denied (publickey,gssapi-keyex,gssapi-with-mic).<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-5\"><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/calculs.univ-cotedazur.fr\/?page_id=1675&amp;lang=en#WARNING_REMOTE_HOST_IDENTIFICATION_HAS_CHANGED!_%E2%80%A6\" title=\"WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! \u2026\">WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! \u2026<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/calculs.univ-cotedazur.fr\/?page_id=1675&amp;lang=en#Configure_your_key_with_FileZilla_(Windows_only)\" title=\"Configure your key with FileZilla (Windows only)\">Configure your key with FileZilla (Windows only)<\/a><\/li><\/ul><\/nav><\/div>\n<h4><span class=\"ez-toc-section\" id=\"Generate_your_SSH_key\"><\/span>Generate your SSH key<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>If you do not already have an SSH key, you can generate one: <\/p>\n\n\n\n<p>Open a terminal and type <strong>ssh-keygen -t ed25519<\/strong><\/p>\n\n\n\n<p><strong>Important: <\/strong><\/p>\n\n\n\n<ul><li><strong>Please enter a passphrase when creating your key pair<\/strong> <strong>AND remember this passphrase.<\/strong><\/li><li><strong>Do not modify the default key name and save the key at the default location.<\/strong><\/li><\/ul>\n\n\n\n<p>On Windows, if this command isn&rsquo;t recognized, you should first install the OpenSSH client: Settings &gt; Apps &gt; Optional Features &gt; Add a feature &gt; OpenSSH Client.<\/p>\n\n\n\n<p><strong>After running ssh-keygen your public key is by default in:<\/strong><\/p>\n\n\n\n<ul><li><strong> <\/strong>~\/.ssh\/id_ed25519.pub on Mac\/Linux <\/li><li>C:\\Users\\%username%.ssh\\id_ed25519.pub on Windows.<\/li><\/ul>\n\n\n\n<h4><span class=\"ez-toc-section\" id=\"How_to_connect_from_different_machines\"><\/span>How to connect from different machines<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p><strong>You can install multiple public keys on Azzurra<\/strong>. It is recommended to have as many keys as machines from which you connect.<\/p>\n\n\n\n<p>If you already have access to your Azzurra account, you can add a public key by editing your ~\/.ssh\/authorized_keys file (on the cluster).<\/p>\n\n\n\n<p><strong>You can also install one key on several machines<\/strong>, although the above solution is recommended. To do so, copy your existing ~\/.ssh\/id_ed25519 file (C:\\Users\\%username%.ssh\\id_ed25519 with Windows) into ~\/.ssh\/ on the other machine (C:\\Users\\%username%\\.ssh with Windows) .<\/p>\n\n\n\n<h4><span class=\"ez-toc-section\" id=\"Frequent_errors\"><\/span>Frequent errors<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<h5><span class=\"ez-toc-section\" id=\"If_nothing_happens_when_trying_to_connect\"><\/span><strong>If nothing happens when trying to connect<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h5>\n\n\n\n<ul><li>There may be an error in your command, which should look like: ssh username@login-hpc.univ-cotedazur.fr<\/li><li>You are not connected to a network that allows you to reach the cluster. You need to either tell us you office&rsquo;s IP address or use the university&rsquo;s VPN (<a rel=\"noreferrer noopener\" href=\"https:\/\/calculs.univ-cotedazur.fr\/?page_id=100#Via_le_VPN\" target=\"_blank\">see here<\/a>) and make sure that you are connected to your office&rsquo;s network or the VPN.<\/li><\/ul>\n\n\n\n<h5><span class=\"ez-toc-section\" id=\"Permission_denied_(publickey,gssapikeyex,gssapiwithmic)\"><\/span><strong>Permission denied (publickey,gssapi-keyex,gssapi-with-mic).<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h5>\n\n\n\n<p>If you get this message when trying to connect:<\/p>\n\n\n\n<p>You need to make sure the computer you are using stores the private ssh key associated with the public key you sent us. There must be a file named <strong><strong>id_ed25519<\/strong><\/strong> (the private key) in your <strong>~\/.ssh<\/strong> folder for Mac\/Linux or <strong>C:\\Users\\%username%\\.ssh<\/strong> under Windows associated with a<strong> id_ed25519.pub<\/strong> file (the public key) which is the same file you sent us when requesting your Azzurra account.<\/p>\n\n\n\n<p>If this is OK but you still cannot connect, for Mac\/Linux users only, you can open a terminal on your local computer and type: <\/p>\n\n\n\n<pre class=\"wp-block-verse\">ssh-add key<\/pre>\n\n\n\n<p>Replace <strong>key <\/strong>by the absolute path of your private key (for example: ~\/.ssh\/id_ed25519).<\/p>\n\n\n\n<h5><span class=\"ez-toc-section\" id=\"WARNING_REMOTE_HOST_IDENTIFICATION_HAS_CHANGED!_%E2%80%A6\"><\/span>WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! \u2026<span class=\"ez-toc-section-end\"><\/span><\/h5>\n\n\n\n<p>Open a terminal and type only once:<\/p>\n\n\n\n<pre class=\"wp-block-verse\">ssh-keygen -R login-hpc.univ-cotedazur.fr<\/pre>\n\n\n\n<p>Then, when trying to connect to the cluster, if you are asked \u00ab\u00a0Are you sure you want to continue connecting (yes\/no\/[fingerprint])?\u00a0\u00bb you need to type yes.<\/p>\n\n\n\n<p>If it still doesn&rsquo;t work: in your error message, look for something like \u00ab\u00a0Offending ED25519 key in \/user\/home\/.ssh\/known_hosts:8\u00a0\u00bb. This means you need to edit your known_hosts file and remove the 8th line in this file (to be adjusted depending on the line number written in your error message).<\/p>\n\n\n\n<h4><span class=\"ez-toc-section\" id=\"Configure_your_key_with_FileZilla_(Windows_only)\"><\/span>Configure your key with FileZilla (Windows only)<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>To use your SSH key with FileZilla under Windows, <a href=\"https:\/\/calculs.univ-cotedazur.fr\/?page_id=550&amp;lang=en#Using_FileZilla\">see this page<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The usual location for ssh keys is ~\/.ssh on Mac\/Linux and C:\\Users\\%username%\\.ssh on Windows. id_ed25519.pub: the public key that must be installed on the servers to which you want to connect. id_ed25519: the private key that must be on the &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":580,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/calculs.univ-cotedazur.fr\/index.php?rest_route=\/wp\/v2\/pages\/1675"}],"collection":[{"href":"https:\/\/calculs.univ-cotedazur.fr\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/calculs.univ-cotedazur.fr\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/calculs.univ-cotedazur.fr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/calculs.univ-cotedazur.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1675"}],"version-history":[{"count":34,"href":"https:\/\/calculs.univ-cotedazur.fr\/index.php?rest_route=\/wp\/v2\/pages\/1675\/revisions"}],"predecessor-version":[{"id":3192,"href":"https:\/\/calculs.univ-cotedazur.fr\/index.php?rest_route=\/wp\/v2\/pages\/1675\/revisions\/3192"}],"up":[{"embeddable":true,"href":"https:\/\/calculs.univ-cotedazur.fr\/index.php?rest_route=\/wp\/v2\/pages\/580"}],"wp:attachment":[{"href":"https:\/\/calculs.univ-cotedazur.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}