Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

https://docs.microsoft.com/ko-kr/azure/virtual-machines/linux/create-ssh-keys-detailed

Code Block
title명령어
ssh-keygen -t rsa -b 2048
Code Block
title작업내용
SanseLG@SanseLG MINGW64 ~
$ ssh-keygen -t rsa -b 2048
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/SanseLG/.ssh/id_rsa):
Created directory '/c/Users/SanseLG/.ssh'.
/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/SanseLG/.ssh/id_rsa.
Your public key has been saved in /c/Users/SanseLG/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:s62IfPsUDdDKZKB7kD+pnux4NFL2fNzYFYuIu7c+kWg/R71nn2Qwyuck3p9zXIeGCrMOUbJvEotHIMBkSRqhyI SanseLG@SanseLG
The key's randomart image is:
+---[RSA 2048]----+
| ..+o   ....         |
|. o..   o  o.. .      |
|Eo . .  +  = o.. o     |
|+ .   o+ o..+ .oo      |
|  o.o=+ =S..        . oS=.  o.. |
|. ooE.* o=    . B o...B. |
| o.o o .o .   + X oo= *o|
| +.o..+o .    .   + o.B.+.X|
|.o= o+==o       .  .o.o *=|
+----[SHA256]-----+

Code Block
titleprivate key
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEArjXrbhsE3HdSu8TUhbWVUQsKiVRqAGVG5HQ5xBs0GPQyCYlA
dZjKgE2ZiufZOEAQjeRyr81pUXSO1/uDi8vU/dOFWyKP71H8VZ3x0ZxT0hDBm5bW
FzJZz2bnmGu9NCUShXmMtIuYCdXA3oeff3CAik7Wq0BN72aa3bN0/AUNdFrMT/Tm
0R8UtWb3ANZgLdFHyQd5HPmb/iBmLEKfhZQnKS6yfb+HO00Vz00BZUHwfqh+zO/Q
q/KmsZehkaD3KTD66e63y51espOpj0SMy8EuWzEgC/sW0RptLU3aZ4zq/5YPPeBn
PtgMfzFU6BV8HTQ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ssh 폴더 및 하위 파일들의 올바른 퍼미션은 다음과 같습니다. 퍼미션이 잘못된 경우 사용하지 못하게 됩니다.
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub  
chmod 644 ~/.ssh/authorized_keys
chmod 644 ~/.ssh/known_hosts
Code Block
titlepublic key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCuNetuGwTcd1K7xNSFtZVRCwqJVGoAZUbkdDnEGzQY9DIJiUB1mMqATZmK59k4QBCN5HKvzWlRdI7X+4OLy9T904VbIo/vUfxVnfHRnFPSEMGbltYXMlnPZueYa700JRKFeYy0i5gJ1cDeh59/cICKTtarQE3vZprds3T8BQ10WsxP9ObRHxS1ZvcA1mAt0UfJB3kc+Zv+IGYsQp+FlCcpLrJ9v4c7TRXPTQFlQfB+qH7M79Cr8qaxl6GRoPcpMPrp7rfLnV6yk6mPRIzLwS5bMSAL+xbRGm0tTdpnjOr/lg894Gc+2Ax/MVToFXwdNCrKqec8MLuLSsCXpe5lk+y1 SanseLG@SanseLG