openssh server 설치 코멘트 아웃

This commit is contained in:
mcchae committed 2026-09-21 08:14:58 +09:00
1 parent 6e1aa7d4b4
commit e01eb5db9c
1 file changed
+27 -27
+27 -27
View File
@@ -48,34 +48,34 @@ function ErrExit { Write-Host "[ERROR] $args" -ForegroundColor Red; exit 1 }
$ConfFile = Join-Path $env:USERPROFILE '.tmux.conf'
# ────────────────────────────────────────────
# Step 0: Ensure OpenSSH Server
# Step 0: Ensure OpenSSH Server (비활성화됨)
# ────────────────────────────────────────────
Info "Checking OpenSSH Server installation status..."
$sshService = Get-Service -Name "sshd" -ErrorAction SilentlyContinue
if (-not $sshService) {
Info "OpenSSH Server is not installed. Attempting installation..."
# OpenSSH Server 기능 추가 (관리자 권한 필요)
try {
$capability = Get-WindowsCapability -Online -Name "OpenSSH.Server~~~~0.0.1.0"
if ($capability.State -ne "Installed") {
Info "Installing OpenSSH Server via Windows Optional Features..."
Add-WindowsCapability -Online -Name "OpenSSH.Server~~~~0.0.1.0" > $null
Success "OpenSSH Server feature added successfully."
}
# sshd 서비스 시작 및 자동 실행 설정
Set-Service -Name "sshd" -StartupType Automatic
Start-Service -Name "sshd"
Success "OpenSSH Server (sshd) service started and configured as Automatic startup."
} catch {
Warn "Failed to auto-install OpenSSH Server: $_"
Warn "This operation may require Administrator privileges."
}
} else {
Success "OpenSSH Server is already installed."
}
# Info "Checking OpenSSH Server installation status..."
# $sshService = Get-Service -Name "sshd" -ErrorAction SilentlyContinue
#
# if (-not $sshService) {
# Info "OpenSSH Server is not installed. Attempting installation..."
#
# # OpenSSH Server 기능 추가 (관리자 권한 필요)
# try {
# $capability = Get-WindowsCapability -Online -Name "OpenSSH.Server~~~~0.0.1.0"
# if ($capability.State -ne "Installed") {
# Info "Installing OpenSSH Server via Windows Optional Features..."
# Add-WindowsCapability -Online -Name "OpenSSH.Server~~~~0.0.1.0" > $null
# Success "OpenSSH Server feature added successfully."
# }
#
# # sshd 서비스 시작 및 자동 실행 설정
# Set-Service -Name "sshd" -StartupType Automatic
# Start-Service -Name "sshd"
# Success "OpenSSH Server (sshd) service started and configured as Automatic startup."
# } catch {
# Warn "Failed to auto-install OpenSSH Server: $_"
# Warn "This operation may require Administrator privileges."
# }
# } else {
# Success "OpenSSH Server is already installed."
# }
# ────────────────────────────────────────────