SSH_Key_for_Windows - KU-BIG/KUBIG_Wiki GitHub Wiki

2-2. Windows (Draft)

접속방법

ssh -L 9999:localhost:9999 -i [sshν‚€ μœ„μΉ˜] -o ServerAliveInterval=15 -o ServerAliveCountMax=3 [id]@[μ™ΈλΆ€ip]
  • Manually generating your SSH key in Windowsμ—μ„œ 'Generating SSH Keys' μ„Ήμ…˜μ„ μ°Έκ³ ν•˜μ‹œλ©΄ λ©λ‹ˆλ‹€.
  • sshν‚€ μœ„μΉ˜λŠ” μ•„λž˜ μ˜ˆμ‹œμ—μ„œ Enter file in which to save the keyμ—μ„œ μž…λ ₯ν•œ μœ„μΉ˜μž…λ‹ˆλ‹€.
  • 즉, μ˜ˆμ‹œμ—μ„œ 6λ²ˆμ§Έμ€„κ³Ό 같이 ν•˜μ‹œλ©΄ λ©λ‹ˆλ‹€.
  • κ΄„ν˜Έλ₯Ό μ œμ™Έν•œ μ±„λ‘œ [id]μ—λŠ” google cloud platform μ™Όμͺ½ λͺ©λ‘μ˜ λ©”νƒ€λ°μ΄ν„°μ—μ„œ SSHν‚€ ν•­λͺ© μΆ”κ°€ ν›„ ν™•μΈλ˜λŠ” μ‚¬μš©μž 이름을 적어 μ£Όμ‹œκ³  μ™ΈλΆ€ipλŠ” google cloud platformμ™Όμͺ½ λͺ©λ‘μ˜ VMμΈμŠ€ν„΄μŠ€μ—μ„œ ν™•μΈν•˜μ‹€ 수 μžˆμŠ΅λ‹ˆλ‹€.

계정 λͺ…이 영문일 경우 :

μ˜ˆμ‹œ

cd.ssh
ssh-keygen.exe
Enter file in which to save the key (C:\~):rsa_key
Enter passpharase(empty for no passphrase):~
Enter same passphrase again:~
ssh -L 9999:localhost:9999 -i C:\~\rsa_key [id]@[μ™ΈλΆ€ip]
passphrase for key 'C:\~':~

$ sudo apt-get update
$ sudo apt-get install python3-pip
Do you want to continue?[Y/n] y
$ sudo pip3 install jupyterlab    
$ jupyter lab --ip=127.0.0.1 --port=9999 --NotebookApp.token=' '
  • passphrase 이후에 ~ ν‘œμ‹œλŠ” μ‚¬μš©μžκ°€ μ§€μ •ν•˜λŠ” κ°’μ΄μ§€λ§Œ 타이핑할 λ•Œ ν‘œμ‹œλ˜μ§€ μ•ŠμœΌλ‹ˆ λ‹Ήν™©ν•˜μ§€ λ§ˆμ‹œκ³  ν‘œμ‹œλœλ‹€ μƒκ°ν•˜λ©° μž…λ ₯ν•˜μ‹œλ©΄ λ©λ‹ˆλ‹€.

계정 λͺ…이 ν•œκΈ€μΌ 경우:

μ˜ˆμ‹œ

  • .ssh 폴더λ₯Ό C library μ•ˆμ— 생성
  • κ΄€λ¦¬μž κΆŒν•œμœΌλ‘œ cmd μ‹€ν–‰
    ssh-keygen -f C:.ssh\ssh
    Enter file in which to save the key (C:~):rsa_key
    Enter passpharase(empty for no passphrase):~
    Enter same passphrase again:~
  • 그러면 C.ssh에 sshλΌλŠ” pub 파일이 μƒμ„±λ˜μ–΄μžˆμ„ 것이닀.
  • μƒμ„±λœ ssh νŒŒμΌμ„ λ©”λͺ¨μž₯으둜 읽고 Google Cloud Platform -> Computer Engine -> 메타데이터 -> SSH 킀에 ssh 정보 등둝.
    ssh -i C:.ssh\ssh [userid]@μ™ΈλΆ€ip
    둜 μ ‘μ†ν•˜λ©΄ μ„±κ³΅μ μœΌλ‘œ 접속할 수 μžˆλ‹€. 이후 과정은 μœ„μ™€ λ™μΌν•˜κ²Œ μ§„ν–‰ν•˜λ©΄ λœλ‹€.