Howto Add ssh keys to connect cluster servers without password
Description | HowTo Add ssh keys to connect cluster servers |
---|---|
Author | Ndomassi TANDO (ndomassi.tando@ird.fr) |
Creation date | 13/02/22 |
Modification date | 06/02/24 |
Summary
Preambule
Your ssh keys are composed of 1 private key that should remain secret and a public key that you send to the remote server on which you want to connect.
You ssh keys are already installed in the cluster under your /home/login ( with login being your cluster account).. They are named as ssh-login.zip
Retrieve your ssh keys on the cluster:
For new accounts, you can skip this part and directly go to the ” Install your ssh keys” section.
New users will directly receive their ssh keys via email
Via filezilla:
Enter the following parameters :
-
Host : bioinfo-san.ird.fr
-
Login : your cluster account
-
Password : your cluster password
-
Port : 22
Choose the location on your computer where you want to put your file on the left side of the windows.
On the right side, select your ssh-login.zip ( with login being your cluster account) and click on it to transfer it on your computer :
Then decompress your file ssh-login.zip on your computer
Via scp
From your computer, go into the folder of your choice, type the following command :
$~ scp –r
login@bioinfo-san.ird.fr :/home/login/ssh-login.zip .
Install your ssh keys
On Windows using Mobaxterm v 23.4 minimum
Important: Choose the last version of Mobaxterm ( minimum 23.04) to make your ssh keys work
Open Mobaxterm and choose session : then ssh :
In « Basic SSH settings » (in green) , type the following parameters :
Remote host : bioinfo-master1.ird.fr
Tick the « Specify username » box and enter : your login
Port : 22
Then choose « Advanced SSH settings » :
Tick the « Use private key » box and provides your id_rsa.ppk from your ssh-login.zip then press OK
You should now be able to connect directly to bioinfo-master.ird.fr without using your password
On the left of the window in « User sessions » double-click on « bioinfo-master1.ird.fr » to connect :
On Linux, Mac OS using ssh
Open your terminal
Extract your ssh-login.zip :
$~ unzip ssh-login.zip
For Linux:
Copy your id_rsa and id_rsa.pub into your /home/login/.ssh with the following command :
$~ cp id_rsa id_rsa.pub /home/login/.ssh && chmod 600 /home/login/.ssh/id_rsa
For MAC OS:
Copy your id_rsa and id_rsa.pub into your /Users/login/.ssh with the following command :
$~ cp id_rsa id_rsa.pub /Users/login/.ssh
If it is your first connection, answer yes to the question :
« Are you sure you want to continue connecting (yes/no/[fingerprint]) ? »
Install your ssh key on filezilla for the san
You can use your ssh key to automate you transfer from your computer to the remote san server
Open filezilla
Add Key in Filezilla :
Go to « Edit » Menu and click on « Settings » submenu :
Select « SFTP » under « Connection » and click « Add key file » :
Select the private key file in .ppk (Windows or MAC OS ) or the id_rsa (Linux) that you retreive earlier in the ssh-login.zip.
You key will be added to the list. Now just click OK
Once your key file is set, you can connect to the nas servers without any password required.
Then, you can directly connect to the sftp server :
Enter the detail of Host, Username and Port and click on Quick connect :
Create a saved session
Go to « File » —> « Site Manager » and create an « new Site »
Name it as you want and in the right window, set the parameters as follow :
-
Protocol : SFTP-SSH File transfer Protocol
-
Host : bioinfo-san.ird.fr
-
Type of Authentication :normal
-
Login : your account cluster
The just press « connection » to connect or validate to save the configured session.
Now your configured session appears in the front panel under the following icon :
Links
- Related courses : Linux for Dummies
- Related courses : HPC
- Tutorials : Linux Command-Line Cheat Sheet