Adding ssh_key to a server

This commit is contained in:
Reisber 2026-02-01 20:43:03 +03:00 committed by GitHub
parent e3a87e45c5
commit 9cc143c28f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 0 deletions

9
linux/ssh_key Normal file
View File

@ -0,0 +1,9 @@
###How to add SSH key to server
After setting up first remote ssh connection type from your PC (not server)
scp C:\Users\User.ssh*.pub user@hostname:/home/user/
(example: C:\Users\user*\.ssh\id_ed25519.pub user@ip_address_of_the_host:/home/)
Then enter password, after that >
Go to your server and add your key, to ssh_authorized keys >
cat id_ed*.pub >> ~/.ssh/authorized_keys
And don't forget to restart ssh and sshd