윈도우 tmux 설치 시 필요하면 openssh server도 설치하도록 추가

This commit is contained in:
Jerry Chae committed 2026-05-27 10:50:39 +09:00
1 parent bc1f52c030
commit f4adbf0915
2 files changed
+33 -1

No files matched your search

+30
View File
@@ -47,6 +47,36 @@ function ErrExit { Write-Host "[ERROR] $args" -ForegroundColor Red; exit 1 }
# ────────────────────────────────────────────
$ConfFile = Join-Path $env:USERPROFILE '.tmux.conf'
# ────────────────────────────────────────────
# Step 0: Ensure OpenSSH Server
# ────────────────────────────────────────────
Info "OpenSSH Server 설치 여부 확인 중..."
$sshService = Get-Service -Name "sshd" -ErrorAction SilentlyContinue
if (-not $sshService) {
Info "OpenSSH Server가 설치되어 있지 않습니다. 설치를 시도합니다..."
# OpenSSH Server 기능 추가 (관리자 권한 필요)
try {
$capability = Get-WindowsCapability -Online -Name "OpenSSH.Server~~~~0.0.1.0"
if ($capability.State -ne "Installed") {
Info "Windows 선택적 기능에서 OpenSSH Server를 설치하는 중..."
Add-WindowsCapability -Online -Name "OpenSSH.Server~~~~0.0.1.0" > $null
Success "OpenSSH Server 기능이 성공적으로 추가되었습니다."
}
# sshd 서비스 시작 및 자동 실행 설정
Set-Service -Name "sshd" -StartupType Automatic
Start-Service -Name "sshd"
Success "OpenSSH Server(sshd) 서비스가 시작되었으며 자동 실행으로 설정되었습니다."
} catch {
Warn "OpenSSH Server 자동 설치에 실패했습니다: $_"
Warn "이 기능은 '관리자 권한'이 필요할 수 있습니다."
}
} else {
Success "OpenSSH Server가 이미 설치되어 있습니다."
}
# ────────────────────────────────────────────
# Step 1: Install tmux
# ────────────────────────────────────────────