PowerShell Core 정식 출시-2018년1월10일


참고1: https://blogs.msdn.microsoft.com/powershell/2018/01/10/powershell-core-6-0-generally-available-ga-and-supported/

여기를 참고하면 된다

참고2: https://docs.microsoft.com/en-us/powershell/scripting/setup/Installing-PowerShell-Core-on-Windows?view=powershell-6

참고3: 다운로드하는 곳
https://github.com/PowerShell/PowerShell/releases

참고4: PowerShell Core 6.0 내용
https://docs.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-core-60?view=powershell-6

참고5: Linux에서 설치하는 방법
https://docs.microsoft.com/en-us/powershell/scripting/setup/Installing-PowerShell-Core-on-macOS-and-Linux?view=powershell-6

 

Windows Server 2016의 1709버전에서 Linux Container 실행하기


참고: https://www.thomasmaurer.ch/2017/10/how-to-run-docker-linux-container-on-windows-server-1709/

** 아래와 같이 하면 되는데, 기업 라이센스가 있는 1709 버전으로 반드시 작업해야 한다

1) Install Docker Enterprise Edition Preview on Windows Server 1709
Install-Module DockerProvider
Install-Package Docker -ProviderName DockerProvider -RequiredVersion preview
Restart-Computer

2) Enable Docker Linux Containers on Windows
[Environment]::SetEnvironmentVariable(“LCOW_SUPPORTED”, “1”, “Machine”)
Restart-Service Docker

3) Verify that Docker is running
docker info
docker version

4) Run Linux Docker Container on Windows Server
docker pull microsoft/nanoserver
docker pull ubuntu
docker pull alpine
docker pull supertest2014/nyan

docker run –rm microsoft/nanoserver cmd /c echo Hello Microsoft
docker run –rm alpine echo Hello Linux
docker run -t –rm supertest2014/nyan

** 난 여기서 실패했다. 그 이유는 docker version에서 Experimental이 true가 나와야 하는데, 나는 false가 나왔기 때문이다.

7

** 참고: http://www.deploycontainers.com/2017/11/04/install-docker-enterprise-preview-edition-windows-server-2016-version-1709/

여기를 보면
The Semi-Annual Channel will only be available for Volume Licensing Customers with Software Assurance.
If you don’t have Software Assurance you can use Microsoft Azure where it’s available.
즉, Volume Licensing Customer에게만 제공되는 Windows Server 2016 version 1709를 사용해야 한다는 것이다. 나는 이 이미지가 없고, Long-Term Servicing channel 이미지를 가지고 사용했기 때문이다. 만약에 사용하고자 한다면 Azure를 이용하면 제대로 할 수 있다
Azure에서 MarketPlace으로 들어 가서 “1709 with container”를 검색하여 해당 VM을 설치하면 된다
8

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에 접속하여 관리할 수 있게 되었다.