OpenSSH는 오픈 소스이며 Windows Server 2019 및 Windows 10(빌드 1809)부터 Windows Server 및 Windows 클라이언트 운영 체제에 추가된다.
SSH 원격 접속을 위해 좌측 돋보기 클릭 후
PowerShell 검색 (x86) 으로 실행
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
명령어를 입력하여 OpenSSH 서버와 클라이언트를 설치한다.
Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'
명령어를 입력하여 SSH 서비스를 시작하고 부팅 시
자동으로 시작하게 설정 한다.
New-NetFirewallRule -Name sshd \
-DisplayName 'OpenSSH Server (sshd)' \
-Enabled True -Direction Inbound \
-Protocol TCP -Action Allow -LocalPort 22
명령어를 입력하여 SSH 서비스의 기본 포트인 22번 포트의 방화벽을 열어준다.
파일 탐색기를 열어
C:\ProgramData\ssh\ 디렉토리로 이동후
구성 파일 변경을 위해 sshd_config 파일 우클릭 하여
연결 프로그램 선택 -> 메모장
ctrl + F로 찾기를 연 후 Password로 다음 찾기를 하다보면 #PasswordAuthentication yes를 찾을 수 있는데 앞에 비밀번호 인증을 허용을 위해 # 주석 제거를 해주고 저장한다.
구성 파일 변경 적용을 위해 Restart-Service sshd 명령어 입력
로컬의 명령 프롬프트에서
ssh administrator@가상 머신 ip 명령어로
ssh 접속 후 yes를 입력하면 ssh 접속이 된다.
'WindowsServer' 카테고리의 다른 글
Windows Shared Directory (0) | 2024.05.20 |
---|---|
Windows 2022, 2019 AD(Active Directory) 구성 (0) | 2024.05.20 |
Windows Teaming (0) | 2024.05.02 |