Silent input with read -s (passwords)
📖 Scenario: You are creating a simple script to ask a user for their username and password. For security, the password should not be shown on the screen as the user types it.
🎯 Goal: Build a bash script that asks for a username and a password. The password input should be silent (hidden) using read -s. Then display a message showing the username and a confirmation that the password was received.
📋 What You'll Learn
Create a variable
username to store the user's input.Create a variable
password to store the user's input silently using read -s.Print a message showing the username and a confirmation that the password was entered.
💡 Why This Matters
🌍 Real World
Scripts often need to ask users for passwords without showing them on screen to keep them safe.
💼 Career
Knowing how to securely get passwords in scripts is important for system administrators and developers automating tasks.
Progress0 / 4 steps