Bird
0
0

You want to securely automate running a script on remote Linux servers using SSH remoting without storing passwords. Which method is best practice in PowerShell 7+?

hard📝 Application Q9 of 15
PowerShell - Remote Management
You want to securely automate running a script on remote Linux servers using SSH remoting without storing passwords. Which method is best practice in PowerShell 7+?
AStore passwords in plain text and use -Credential parameter.
BUse SSH key-based authentication with New-PSSession -KeyFilePath parameter.
CUse -UserName parameter with no authentication.
DDisable SSH authentication temporarily.
Step-by-Step Solution
Solution:
  1. Step 1: Identify secure authentication methods

    SSH key-based authentication avoids storing passwords and is secure for automation.
  2. Step 2: Evaluate other options

    Storing passwords in plain text is insecure, using -UserName alone requires authentication, and disabling SSH auth is unsafe.
  3. Final Answer:

    Use SSH key-based authentication with New-PSSession -KeyFilePath parameter. -> Option B
  4. Quick Check:

    SSH keys are best for secure automation [OK]
Quick Trick: Use SSH keys, not passwords, for secure automation [OK]
Common Mistakes:
  • Storing passwords insecurely
  • Trying to connect without authentication
  • Disabling security features

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes