Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

Dell Command PowerShell Provider 보안 암호 기능

Summary: Dell Command | PowerShell Provider 보안 암호 기능, ConvertTo-SecureString, ConvertFrom-SecureString

This article may have been automatically translated. If you have any feedback regarding its quality, please let us know using the form at the bottom of this page.

Article Content


Symptoms

영향을 받는 제품:

  • Dell Command | PowerShell Provider

Cause

해당 사항 없음

Resolution

보안 암호의 이면에 있는 개념은 운영 스크립트에서 중요한 암호를 일반 보기로 전달해서는 안 된다는 것입니다. 이는 심각한 보안 부족입니다. PowerShell을 사용하면 암호를 보호하거나 최소한 암호 가시성을 줄일 수 있습니다. 먼저 보안 문자열의 일반적인 측면을 논의한 다음 Dell Command PowerShell Provider(DCPP)가 PowerShell의 선명한 기능을 활용하여 암호를 보호하는 방법에 대해 설명합니다.

콘솔에서 사용자 이름 및 암호를 읽어보겠습니다. 사용자 이름은 일반적으로 보안이 필요하지 않으며 모든 사용자가 볼 수 있다는 것을 알고 있습니다. 하지만 비밀번호의 경우, 비밀번호를 비밀번호로 알려서는 안 됩니다. 아래와 같은 명령을 통해 이 요구 사항을 촉진할 수 있습니다.

$user = Read-Host "Enter Username"

$pass = Read-Host "Enter Password" -AsSecureString

위의 내용은 암호와 같은 중요한 정보를 보호해야 할 때 보안을 추가하는 방법에 대한 개요입니다. 위의 예에서 변수 $pass 유형 System.Security.SecureString입니다. PowerShell이 DCPP의 측면을 파악하기 전에 안전한 필드를 용이하게 하기 위해 제공하는 다른 널리 사용되는 cmdlet 2개를 소개합니다.

두 명령은 다음과 ConvertFrom-SecureString같습니다ConvertTo-SecureString. ConvertTo-SecureString 일반 텍스트를 입력 System.Security.SecureString으로 변환합니다. 아래에 예가 나와 있습니다.

"P@ssword1" | ConvertTo-SecureString -AsPlainText -Force

위의 예에서는 일반 텍스트 P@assword1 가 유형 System.Security.SecureString으로 변환됩니다. 이는 더 많은 정보이며 널리 사용될 수도 있고 사용하지 않을 수도 있습니다.

다음 cmdlet은 보안 문자열을 암호화된 표준 문자열로 변환하는 데 사용되는 보다 널리 사용되는 cmdlet ConvertFrom-SecureString 입니다. 주요 제한 ConvertTo-SecureString 은 나중에 사용할 수 있도록 해당 출력을 파일에 직접 쓸 수 없다는 것입니다. 이 제한을 극복하기 위해 파일에 편리하게 저장할 수 있는 암호화된 표준 문자열로 변환 System.Security.SecureString 되는 문자열을 사용해야 ConvertFrom-SecureString 합니다.

일반 텍스트를 P@ssword1 보안 문자열로 변환한 다음 출력을 파이프하여 ConvertFrom-SecureString 파일에 안전하고 편리하게 저장할 수 있는 암호화된 문자열을 가져옵니다.

예를 들어 컴퓨터에서 관리자 암호가 설정된 경우 이를 파일에 저장해야 합니다. 다음을 사용하여 이 작업을 수행할 수 있습니다.

Read-Host "Enter Admin Password" -AsSecureString |
ConvertFrom-SecureString | Out-File "C:\Scripts\AdminPassword.txt"

이 관리자 암호를 다음과 같이 보안 객체로 변수로 다시 검색할 수 있습니다.

$pass = Get-Content "C:\Scripts\AdminPassword.txt" | ConvertTo-SecureString

이제 DCPP의 보안 암호를 활용하는 방법을 알아보십시오. DCPP에서 사용자의 컴퓨터에 시스템 또는 관리자 암호가 설정된 경우 모든 set 명령에 대해 해당 암호를 전달해야 합니다. 따라서 이 암호를 일반 텍스트로 제공하면 보안이 침해됩니다. 암호를 다음과 같이 System.Security.SecureString전달해야 합니다. 또한 암호를 전달할 SecureString 때는 일반 –Password 스위치가 아닌 스위치로 -PasswordSecure 전달해야 합니다. 사용자가 암호를 설정하고 AdvancedBatteryChargeCfgDisabled 전달하는 SecureString 예가 아래에 나와 있습니다.

Set-item AdvancedBatteryChargeCfg disabled –PasswordSecure $pass

여기서 $pass 시스템 및 관리자 암호를 보유하고 있으며 유형 System.Security.SecureString입니다. 위의 토론과 마찬가지로 다음과 같이 읽을 수 있습니다.$pass

$pass = Read-Host "Enter system/admin password" –AsSecureString

필요한 경우 다음과 같이 파일에 저장할 $pass 수 있습니다.

$pass| ConvertFrom-SecureString | Out-File "C:\Scripts\AdminPassword.txt

Additional Information

Article Properties


Affected Product

Dell Command | Powershell Provider

Last Published Date

11 Sept 2023

Version

7

Article Type

Solution