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