Connect over SSH
Edited
If a step fails partway through, the final section describes how to go back. Prefer the account area? Every step here can be done there too.
Prerequisites
- Edit access to the project you work on
harefrom the last few months- A test project to try the steps first
Steps
-
01
Make a Key If You Have None
Make a key pair with
ssh-keygen -f ~/.ssh/deploy_ed25519 -t ed25519except when~/.ssh/deploy_ed25519.pubalready exists. -
02
Add It to the Project
Run
hare key new --name deploy-key --file ~/.ssh/deploy_ed25519.pub. -
03
Start a Machine with the Key
hare server newwith--key deploy-keyinstalls the key during first boot. -
04
Connect
Use
ssh root@192.0.2.10with the address of the new node.
ssh-keygen -f ~/.ssh/deploy_ed25519 -t ed25519 -C deploy-key
hare key new --name deploy-key --file ~/.ssh/deploy_ed25519.pub
hare key list
hare server new node1 --key deploy-key
Ed25519 keys are the first choice, and RSA keys need no less than 3072 bits.
Confirm It Worked
A session without the password prompt confirms it; ssh -v lists the key it offered.
Rolling Back
Removing a key in Azure Hare doesn't reach machines already running; edit ~/.ssh/authorized_keys on them with an editor.
New machines get every project key at first boot; deleting a key later leaves existing machines as they are.
--wait lets slow commands block till the work is complete, which helps scripts.