Answers for "add ssh key to server"


copy ssh key to remote server

ssh-copy-id -i ~/.ssh/ [email protected]
Posted by: Guest on May-13-2020

add existing key to ssh

cp /path/to/my/key/id_rsa ~/.ssh/id_rsa
cp /path/to/my/key/ ~/.ssh/
# change permissions on file
sudo chmod 600 ~/.ssh/id_rsa
sudo chmod 600 ~/.ssh/
# start the ssh-agent in the background
eval $(ssh-agent -s)
# make ssh agent to actually use copied key
ssh-add ~/.ssh/id_rsa
Posted by: Guest on August-27-2021

ssh add key to authorized_keys

cat ~/.ssh/ | ssh [email protected] "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
Posted by: Guest on December-17-2020

ssh key

ssh-keygen -t ed25519 -C "[email protected]"
cat ~/.ssh/ | clip
Posted by: Guest on January-27-2021

ssh add new key

$ eval "$(ssh-agent -s)"
> Agent pid 59566
Posted by: Guest on June-18-2020

add ssh key to server

Generate ssh keys (Skip this step if you already have one).
To generate new RSA keys, enter this on the command line.
ssh-keygen -t -rsa
Follow the prompts. You do not need to enter a file name but you should enter a password to make your key more secure. The default file name is . By default the key file is saved at ~/.ssh/ .
Copy your public keys to the remote server.
scp ~/.ssh/ [email protected]_ip:/
Add your public key to the authorized keys file on remote server
To add you keys to the file, you can use the following command:
cat ~/ >> ~/.ssh/authorized_keys

If you do not have the folder ~/.ssh/authorized_keys , you can create this with the following commands:
mkdir -p ~/.ssh
touch ~/.ssh/authorized_keys
Restart server for key changes to take effect
Posted by: Guest on April-08-2021

Browse Popular Code Answers by Language