Registration/SSH: Difference between revisions
(7 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{|style="background:#deffee; width:100%;" |
|||
|style="padding:5px; background:#cef2e0; text-align:left"| |
|||
[[Image:Attention.svg|center|25px]] |
|||
|style="padding:5px; background:#cef2e0; text-align:left"| |
|||
This process is only necessary for the bwUniCluster and the bwForCluster Helix. |
|||
On the other clusters, SSH keys can still be copied to the <code>authorized_keys</code> file. |
|||
|} |
|||
= Registering SSH Keys with your Cluster = |
= Registering SSH Keys with your Cluster = |
||
Line 57: | Line 66: | ||
Here you can add and revoke SSH keys. To add a ssh key, please follow these steps: |
Here you can add and revoke SSH keys. To add a ssh key, please follow these steps: |
||
1. '''Select the cluster''' for which you want to create a second factor:</br> → [https://login.bwidm.de/user/ssh-keys.xhtml '''bwUniCluster 2.0''']</br> → [https:// |
1. '''Select the cluster''' for which you want to create a second factor:</br> → [https://login.bwidm.de/user/ssh-keys.xhtml '''bwUniCluster 2.0''']</br> → [https://bwservices.uni-heidelberg.de/user/ssh-keys.xhtml '''bwForCluster Helix'''] |
||
[[File:BwIDM-twofa.png|center| |
[[File:BwIDM-twofa.png|center|600px|thumb|My SSH Pubkeys.]] |
||
3. Click the '''Add SSH Key''' or '''SSH Key Hochladen''' button. |
3. Click the '''Add SSH Key''' or '''SSH Key Hochladen''' button. |
||
[[File:Bwunicluster 2.0 access ssh keys empty.png|center| |
[[File:Bwunicluster 2.0 access ssh keys empty.png|center|400px|thumb|Add new SSH key.]] |
||
4. A new window will appear. |
4. A new window will appear. |
||
Enter a name for the key and paste your SSH public key (file <code>~/.ssh/<filename>.pub</code>) into the box labelled "SSH Key:". |
Enter a name for the key and paste your SSH public key (file <code>~/.ssh/<filename>.pub</code>) into the box labelled "SSH Key:". |
||
Click on the button labelled '''Add''' or '''Hinzufügen'''. |
Click on the button labelled '''Add''' or '''Hinzufügen'''. |
||
[[File:Ssh-key.png|center| |
[[File:Ssh-key.png|center|600px|thumb|Add new SSH key.]] |
||
5. If everything worked fine your new key will show up in the user interface: |
5. If everything worked fine your new key will show up in the user interface: |
||
[[File:Ssh-success.png|center| |
[[File:Ssh-success.png|center|800px|thumb|New SSH key added.]] |
||
Once you have added SSH keys to the system, you can bind them to one or more services to use either for interactive logins ('''Interactive key''') or for automatic logins ('''Command key'''). |
Once you have added SSH keys to the system, you can bind them to one or more services to use either for interactive logins ('''Interactive key''') or for automatic logins ('''Command key'''). |
||
Line 90: | Line 99: | ||
2. Select '''Registered services/Registrierte Dienste''' from the top menu and click '''Set SSH Key/SSH Key setzen''' for the cluster for which you want to use the SSH key. |
2. Select '''Registered services/Registrierte Dienste''' from the top menu and click '''Set SSH Key/SSH Key setzen''' for the cluster for which you want to use the SSH key. |
||
[[File:BwIDM-registered.png|center| |
[[File:BwIDM-registered.png|center|600px|thumb|Select Cluster for which you want to use the SSH key.]] |
||
3. The upper block displays the SSH keys currently registered for the service. |
3. The upper block displays the SSH keys currently registered for the service. |
||
The bottom block displays all the public SSH keys associated with your account. |
The bottom block displays all the public SSH keys associated with your account. |
||
Find the SSH key you want to use and click '''Add/Hinzufügen'''. |
Find the SSH key you want to use and click '''Add/Hinzufügen'''. |
||
[[File:Ssh-service-int.png|center| |
[[File:Ssh-service-int.png|center|800px|thumb|Add SSH key to service.]] |
||
4. A new window appears. |
4. A new window appears. |
||
Select '''Interactive''' as the usage type, enter an optional comment and click '''Add/Hinzufügen'''. |
Select '''Interactive''' as the usage type, enter an optional comment and click '''Add/Hinzufügen'''. |
||
[[File:Ssh-int.png|center| |
[[File:Ssh-int.png|center|600px|thumb|Add interactive SSH key to service.]] |
||
5. Your SSH key is now registered for interactive use with this service. |
5. Your SSH key is now registered for interactive use with this service. |
||
[[File:Ssh-service.png|center| |
[[File:Ssh-service.png|center|800px|thumb|SSH key is now registered for interactive use.]] |
||
Line 121: | Line 130: | ||
'''Command Keys''' can be used for automatic workflows. |
'''Command Keys''' can be used for automatic workflows. |
||
If you want to use rsync, please read the [[Registration/SSH/rrsync|rrsync wiki]]. |
|||
⚫ | |||
⚫ | |||
1. [[Registration/SSH#Adding_a_new_SSH_Key|'''Add a new "command SSH key"''']] if you have not already done so. |
1. [[Registration/SSH#Adding_a_new_SSH_Key|'''Add a new "command SSH key"''']] if you have not already done so. |
||
Line 127: | Line 138: | ||
2. Select '''Registered services/Registrierte Dienste''' from the top menu and click '''Set SSH Key/SSH Key setzen''' for the cluster for which you want to use the SSH key. |
2. Select '''Registered services/Registrierte Dienste''' from the top menu and click '''Set SSH Key/SSH Key setzen''' for the cluster for which you want to use the SSH key. |
||
[[File:BwIDM-registered.png|center| |
[[File:BwIDM-registered.png|center|600px|thumb|Select Cluster for which you want to use the SSH key.]] |
||
3. The upper block displays the SSH keys currently registered for the service. |
3. The upper block displays the SSH keys currently registered for the service. |
||
The bottom block displays all the public SSH keys associated with your account. |
The bottom block displays all the public SSH keys associated with your account. |
||
Find the SSH key you want to use and click '''Add/Hinzufügen'''. |
Find the SSH key you want to use and click '''Add/Hinzufügen'''. |
||
[[File:Ssh-service-com.png|center| |
[[File:Ssh-service-com.png|center|800px|thumb|Add SSH key to service.]] |
||
4. A new window appears. |
4. A new window appears. |
||
Line 145: | Line 156: | ||
| If you want to register a command key to be able to transfer data automatically, please use the following string as in the '''Command''' text field (please verify the path on the cluster first): |
| If you want to register a command key to be able to transfer data automatically, please use the following string as in the '''Command''' text field (please verify the path on the cluster first): |
||
<pre> |
<pre> |
||
/usr |
/usr[/local]/bin/rrsync -ro /home/aa/aa_bb/aa_abc1/ |
||
</pre> |
</pre> |
||
|} |
|} |
||
[[File:Ssh-com.png|center| |
[[File:Ssh-com.png|center|600px|thumb|Add command SSH key to service.]] |
||
5. After the key has been added, it will be marked as '''Pending''': |
5. After the key has been added, it will be marked as '''Pending''': |
||
You will receive an e-mail as soon as the key has been approved and can be used. |
You will receive an e-mail as soon as the key has been approved and can be used. |
||
[[File:Ssh-service.png|center| |
[[File:Ssh-service.png|center|800px|thumb|SSH key is now registered for interactive use.]] |
||
== Revoke/Delete SSH Key == |
== Revoke/Delete SSH Key == |
||
Line 167: | Line 177: | ||
Here you can add and revoke SSH keys. To revoke/delete a ssh key, please follow these steps: |
Here you can add and revoke SSH keys. To revoke/delete a ssh key, please follow these steps: |
||
1. '''Select the cluster''' for which you want to create a second factor:</br> → [https://login.bwidm.de/user/ssh-keys.xhtml '''bwUniCluster 2.0''']</br> → [https:// |
1. '''Select the cluster''' for which you want to create a second factor:</br> → [https://login.bwidm.de/user/ssh-keys.xhtml '''bwUniCluster 2.0''']</br> → [https://bwservices.uni-heidelberg.de/user/ssh-keys.xhtml '''bwForCluster Helix'''] |
||
[[File:BwIDM-twofa.png|center| |
[[File:BwIDM-twofa.png|center|600px|thumb|My SSH Pubkeys.]] |
||
2. Click '''REVOKE/ZURÜCKZIEHEN''' next to the SSH key you want to revoke. |
2. Click '''REVOKE/ZURÜCKZIEHEN''' next to the SSH key you want to revoke. |
||
[[File:Ssh-success.png|center| |
[[File:Ssh-success.png|center|800px|thumb|Revoke SSH key.]] |
Latest revision as of 16:35, 8 November 2023
This process is only necessary for the bwUniCluster and the bwForCluster Helix.
On the other clusters, SSH keys can still be copied to the |
Registering SSH Keys with your Cluster
Interactive SSH Keys are not valid all the time, but only for one hour after the last 2-factor login. They have to be "unlocked" by entering the OTP and service password. |
SSH Keys are a mechanism for logging into a computer system without having to enter a password. Instead of authenticating yourself with something you know (a password), you prove your identity by showing the server something you have (a cryptographic key).
The usual process is the following:
- The user generates a pair of SSH Keys, a private key and a public key, on their local system. The private key never leaves the local system.
- The user then logs into the remote system using the remote system password and adds the public key to a file called ~/.ssh/authorized_keys .
- All following logins will no longer require the entry of the remote system password because the local system can prove to the remote system that it has a private key matching the public key on file.
While SSH Keys have many advantages, the concept also has a number of issues which make it hard to handle them securely:
- The private key on the local system is supposed to be protected by a strong passphrase. There is no possibility for the server to check if this is the case. Many users do not use a strong passphrase or do not use any passphrase at all. If such a private key is stolen, an attacker can immediately use it to access the remote system.
- There is no concept of validity. Users are not forced to regularly generate new SSH Key pairs and replace the old ones. Often the same key pair is used for many years and the users have no overview of how many systems they have stored their SSH Keys on.
- SSH Keys can be restricted so they can only be used to execute specific commands on the server, or to log in from specified IP addresses. Most users do not do this.
To fix these issues it is no longer possible to self-manage your SSH Keys by adding them to the ~/.ssh/authorized_keys file on bwUniCluster/bwForCluster. SSH Keys have to be managed through bwIDM/bwServces instead. Existing authorized_keys files are ignored.
Minimum requirements for SSH Keys
Algorithms and Key sizes:
- 2048 bits or more for RSA
- 521 bits for ECDSA
- 256 Bits (Default) for ED25519
ECDSA-SK and ED25519-SK keys (for use with U2F Hardware Tokens) cannot be used yet.
Please set a strong passphrase for your private keys.
Adding a new SSH Key
|
SSH keys are generally managed via the My SSH Pubkeys menu entry on the registration pages for the clusters. Here you can add and revoke SSH keys. To add a ssh key, please follow these steps:
1. Select the cluster for which you want to create a second factor:
→ bwUniCluster 2.0
→ bwForCluster Helix
3. Click the Add SSH Key or SSH Key Hochladen button.
4. A new window will appear.
Enter a name for the key and paste your SSH public key (file ~/.ssh/<filename>.pub
) into the box labelled "SSH Key:".
Click on the button labelled Add or Hinzufügen.
5. If everything worked fine your new key will show up in the user interface:
Once you have added SSH keys to the system, you can bind them to one or more services to use either for interactive logins (Interactive key) or for automatic logins (Command key).
Registering an Interactive Key
Interactive SSH Keys are not valid all the time, but only for one hour after the last 2-factor login. They have to be "unlocked" by entering the OTP and service password. |
Interactive Keys can be used to log into a system for interactive use. Perform the following steps to register an interactive key:
1. Add a new interactive SSH key if you have not already done so.
2. Select Registered services/Registrierte Dienste from the top menu and click Set SSH Key/SSH Key setzen for the cluster for which you want to use the SSH key.
3. The upper block displays the SSH keys currently registered for the service. The bottom block displays all the public SSH keys associated with your account. Find the SSH key you want to use and click Add/Hinzufügen.
4. A new window appears. Select Interactive as the usage type, enter an optional comment and click Add/Hinzufügen.
5. Your SSH key is now registered for interactive use with this service.
Registering a Command Key
SSH command keys are always valid and do not need to be unlocked with a 2-factor login. This makes these keys extremely valuable to a potential attacker and poses a security risk. Therefore, additional restrictions apply to these keys:
|
Command Keys can be used for automatic workflows. If you want to use rsync, please read the rrsync wiki.
Perform the following steps to register a "Command key" (in this example we use rrsync):
1. Add a new "command SSH key" if you have not already done so.
2. Select Registered services/Registrierte Dienste from the top menu and click Set SSH Key/SSH Key setzen for the cluster for which you want to use the SSH key.
3. The upper block displays the SSH keys currently registered for the service. The bottom block displays all the public SSH keys associated with your account. Find the SSH key you want to use and click Add/Hinzufügen.
4. A new window appears. Select Command as the usage type. Type the full command with the full path, including all parameters, in the Command text box. Specify a network address, list, or range in the From text field (see man 8 sshd for more info). Please also provide a comment to speed up the approval process. Click Add/Hinzufügen.
Example |
---|
If you want to register a command key to be able to transfer data automatically, please use the following string as in the Command text field (please verify the path on the cluster first):
/usr[/local]/bin/rrsync -ro /home/aa/aa_bb/aa_abc1/ |
5. After the key has been added, it will be marked as Pending: You will receive an e-mail as soon as the key has been approved and can be used.
Revoke/Delete SSH Key
Revoked keys are locked and can no longer be used. |
SSH keys are generally managed via the My SSH Pubkeys menu entry on the registration pages for the clusters. Here you can add and revoke SSH keys. To revoke/delete a ssh key, please follow these steps:
1. Select the cluster for which you want to create a second factor:
→ bwUniCluster 2.0
→ bwForCluster Helix
2. Click REVOKE/ZURÜCKZIEHEN next to the SSH key you want to revoke.