From 27ba1ee13d5d025adede3c36ccdc44bed77f2ebd Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Mon, 9 Dec 2024 02:53:50 -0700 Subject: [PATCH] Add Scripts/Bash/Configure SSH Key Authentication.md --- Scripts/Bash/Configure SSH Key Authentication.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Scripts/Bash/Configure SSH Key Authentication.md diff --git a/Scripts/Bash/Configure SSH Key Authentication.md b/Scripts/Bash/Configure SSH Key Authentication.md new file mode 100644 index 0000000..381bc98 --- /dev/null +++ b/Scripts/Bash/Configure SSH Key Authentication.md @@ -0,0 +1,14 @@ +*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. \ No newline at end of file