Windows 10, 1709 버전에서 SSH Client와 SSH Server 설치하기


참고: https://blogs.msdn.microsoft.com/powershell/2017/12/15/using-the-openssh-beta-in-windows-10-fall-creators-update-and-windows-server-1709/

첫째, Windows 10 및 Windows Server 2016의 1709 버전에 OpenSSH Client를 설치하여 powershell에서 ssh root@linux_server로 접속하여 Linux를 관리할 수 있다. 즉, 별도로 Putty와 같은 SSH Client를 설치할 필요가 없어졌다.

둘째, Windows 10, Windows Server 2016의 1709버전에 OpenSSH Server를 설치하여 Linux 컴퓨터에서 ssh를 사용하여 Windows 컴퓨터에 접속하여 Windows Server를 PowerShell로 관리할 수 있게 된다.

Windows는 PowerShell, Linux는 SSH(bash)로 관리하는데, 앞으로는 Windows와 Linux의 상호 운영에 상당히 편리하게 되었다.

SSH Client와 SSH Server 설치하기

2가지 방법으로 설치할 수 있다. 원하는 방법을 사용하면 된다. GUI로 하거나 PowerShell로 설치할 수 있다

<설정에서 설치하기>

12345

<PowerShell에서 설치하기>

p1p2p3

지금까지는 SSH Client와 SSH server를 모두 설치했다.
SSH Client를 실행하기 위하여 다음과 같이 한다
<SSH Client 실행하기>
p3-1

마지막으로 SSH server에 접속해본다. 사전에 CentOS Linux를 실행해둔다.
<SSH Server에 접속하기>
p4

접속을 성공했다.

이제는 Windows 10, 1709 버전에 SSH Server를 실행해본다.

<OpenSSH Server 실행하기>
1. Key 생성하기
cd C:\Windows\System32\OpenSSH

.\ssh-keygen -A
.\ssh-add ssh_host_ed25519_key

2.OpenSSHUtils 모듈 설치하여 Repair-SshdHostKeyPermission cmdlet 사용하기
Get-Module -ListAvailable
cd “C:\Program Files\WindowsPowerShell\Modules”
Save-Module -Name opensshutils -Path .
Install-Module -Force OpenSSHUtils
Get-Command -Module OpenSShUtils

Repair-SshdHostKeyPermission -FilePath C:\Windows\System32\OpenSSH\ssh_host_ed25519_key

3. SSHD 실행하기
Start-Service sshd
Get-Service sshd
p5

드디어 Windows 10에 SSH Server가 실행하게 되었다.
이제부터는 Linux에서 SSH로 접속하여 Windows를 관리할 수 있게 된 셈이다.
Windows에 접속해서 관리는 PowerShell로 변경하여 하면 된다

<Linux에서 Windows 10의 SSH Server로 접속하기>
ssh administrator@192.168.219.106
암호 입력
p6

드디어 Linux에서 Windows에 접속하여 관리할 수 있게 되었다.

Leave a comment