Files
Personal/linux/ssh_key.md
2026-06-25 08:12:48 +00:00

16 lines
634 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
###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
Use this is password authentication still works (nano /etc/ssh/sshd_config.d/50-cloud-init.conf)
А ещё есть клёвая штука, как ssh-copy-id user@ip_address_of_the_host