설표의 장고




Windows용 ssh 클라이언트 설치방법 + 사용예시




( 수정됨)


환경

OS :  Windows 10

ssh 연결을 통해 다른 서버에 연결하여 터미널 기능을 사용할 수 있습니다.

ssh 설치하기

"설정"을 열어 "설정 검색" 검색란에 "선택적 기능 추가"를 입력하여 메뉴를 호출합니다.
설정 메뉴는 보통 시작 메뉴에 좌측에 톱니바퀴 모양 아이콘으로 존재합니다.

"선택적 기능 추가" 메뉴의 "추가된 메뉴"에 존재하는 "추가된 메뉴 검색" 검색란에 "SSH 클라이언트"를 검색하여 설치합니다.

윈도우 ssh 클라이언트 검색

설치를 완료하면 이제부터 명령 프롬프트(cmd.exe)에서 ssh 연결을 사용할 수 있게 됩니다.
명령 프롬프트는 "Windows" + "R" 키 조합으로 "실행" 기능을 호출하고, "cmd"를 입력하면 실행할 수 있습니다.

ssh 사용 방법

ssh --help 명령을 통해 도움말을 호출할 수 있습니다.

(django) C:\django\mysite>ssh --help
unknown option -- -
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
           [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
           [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
           [-i identity_file] [-J [user@]host[:port]] [-L address]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
           [-w local_tun[:remote_tun]] destination [command]

보통 사용하게 되는 명령어는 "ssh [user@]host -i [identity_file]"입니다.
identity_file은 보통 .pem키나 .ppk 파일을 사용합니다.

파일 경로의 경우 특정 파일을 드래그하여 명령 프롬프트에 넣어주면 자동으로 경로가 입력됩니다.

다음은 임시로 서버를 생성하고 ssh로 연결했을 때 확인할 수 있는 텍스트입니다.

(django) C:\django\mysite>ssh ubuntu@54.180.238.107 -i "{파일 경로}.pem"
The authenticity of host '54.180.238.107 (54.180.238.107)' can't be established.
ECDSA key fingerprint is ***
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '54.180.238.107' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-1030-aws x86_64)
 
 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage
 
  System information as of Wed Jul  3 00:45:05 UTC 2024
 
 System load:           0.51416015625
  Usage of /:            7.8% of 19.20GB
  Memory usage:          45%
  Swap usage:            0%
  Processes:             108
  Users logged in:       0
  IPv4 address for ens5: 172.26.8.143
  IPv6 address for ens5: 2406:da12:228:bb00:3ee:49b7:a865:634c
 
Expanded Security Maintenance for Applications is not enabled.
 
0 updates can be applied immediately.
 
Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status
 
The list of available updates is more than a week old.
To check for new updates run: sudo apt update
 
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
 
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
 
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
 
ubuntu@ip-172-26-8-143:~$



이 글의 댓글 기능은 일부러 막아놓았습니다. 궁금한 내용이 있다면 게시판을 이용해주세요!


공감 : 0