| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 |
- DATABASE
- Blockchain
- Jupyter Notebook
- ansible
- API
- crawler
- Django
- strings
- project
- github
- .gitignore
- pandas
- MyAnimeList
- basics
- directories
- cached
- Methods
- workbench
- SCV
- Linux
- GIT
- Classes
- Filecoin
- JSON
- forks
- noob
- Anime
- commands
- python
- MySQL
- Today
- Total
제니 블로그
Setting up SSH-Key 본문
First you have to generate a new key on your terminal. You can use any kind of terminal like git bash, powershell etc, but can have different available commands. (I use git bash because it's clean and convenient for when using git!)
You can do this on both Unix and Windows; but this time, I'm running it on windows.
ssh-keygen is a utility that generates a key pair - public and private key.
ssh-keygen -t ed25519 -C "id@gmail.com"
Generating public/private ed25519 key pair.
Enter file in which to save the key (/c/Users/id/.ssh/id_ed25519): <Enter Directory and key name>
# Example : /c/Users/id/Desktop/key

You can now copy the key into the server that you wish to save that key to
The .pub is the generated public key ; which you add to the remote server's authorized_keys file.
ssh-copy-id -i /c/Users/id/Desktop/key.pub user@192.168.0.0
Set the IP to the server that you want to.
Now you can try to access it using that key.
ssh -i c/User/id/Desktop/key user@192.168.0.0
Now... if you access the ssh directory on that server, you will have a file called `authorized_keys`
The authorized_keys file is used in SSH to list the public keys that are allowed to authenticate to a user account. When a connection is attempted, the SSH server verifies that the public key provided by the client matches one of the keys stored in this file. If a match is found, and the client proves possession of the corresponding private key, the server grants access without requiring a password.
To increase the security of the authorized keys, make sure that only a certain IP with that available key can access the server.
cd .ssh
vim authorized_keys
from="YOUR_PUBLIC IP",no-port-forwarding,no-X11-forwarding,no-agent-forwarding ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP5HbieCh+gGpCzPHqevoM6V5OdBLpQROAgA5YLD+CQW id@gmail.com
To increase the security of the authorized keys, make sure that only a certain IP with that available key can access the server.
Now you can enter the server without using your password and securely.