본문 바로가기

서버

ubuntu - ssh key 생성하기

728x90

ed25519, RSA, ECDSA 세가지가 있다.

 

만드는 방법은 셋 다 거의 동일함

 

1. 키 생성하기

 

ED25519

ssh-keygen -t ed25519 -C "이메일"

 

[RSA]

ssh-keygen -t rsa -b 4096 -C "이메일"

 

 

2. pub 키 전달

 

서버에 pub키를 전달하여 로그인하면 된다. ex) id_rsa.pub

ssh -i 파일키경로 root@domain.com

 

 

[생성된 경로]

mac

->  ~/.ssh/

리눅스

-> /root/.ssh/

Windows

-> C:\Users\Administrator\.ssh