All checks were successful
GitOps Automatic Deployment / GitOps Automatic Deployment (push) Successful in 8s
17 lines
1.5 KiB
Markdown
17 lines
1.5 KiB
Markdown
*Purpose*: Sometimes you need two linux computers to be able to talk to eachother without requiring a password. Passwordless SSH can be achieved by running the following commands:
|
|
|
|
!!! note "Non-Root Key Storage Considerations"
|
|
When you generate SSH keys, they will be stored in a specific user's profile, the one currently executing the commands. If you want to have passwordless SSH, you would run the commands from a non-root user (e.g. `nicole`).
|
|
|
|
``` sh
|
|
ssh-keygen # (1)
|
|
ssh-copy-id -i /home/nicole/.ssh/id_rsa.pub nicole@192.168.3.18 # (2)
|
|
ssh -i /home/nicole/.ssh/id_rsa nicole@192.168.3.18 # (3)
|
|
```
|
|
|
|
1. Just leave all of the default options and do not put a password on the SSH key. )
|
|
2. Change the directories to account for your given username, and change the destination to the user@IP corresponding to the remote server. You will be prompted to enter the password once to store the SSH public key on the remote computer.
|
|
3. This command is to validate that everything worked. If the remote user is the same as the local user (e.g. `nicole`) then you dont need to add the `-i /home/nicole/.ssh/id_rsa` section to the SSH command.
|
|
|
|
!!! warning "Run before configuring Global SSH Infrastructure Key"
|
|
There is a global automation that leverages a [Global Infrastructure Public SSH Key](https://git.bunny-lab.io/Infrastructure/LinuxServer_SSH_PublicKey). If this runs before you run the commands above, you will be unable to configure SSH key relationships and it will need to be done manually. |