Shell Script accept password using read commnad

in Categories Script last updated April 10, 2008

Share this on:

6 comment

  1. #!/bin/bash

    read -s -p “Password: ” mypassword
    echo Enter Password:

    if [ “$mypassword” = “$PASS” ]
    then echo “Password Accepted”
    else echo “Access Denied”

    1. help me …
      Write a shell script setup linux security policies include:
      1. password policy
      2. User policy
      3. firewall
      Note: Create a from 1 to 3. purposes:
      If (1) successful
      then 2
      If (2) successful
      then 3

    1. write a shell script with the following tasks:
      1. login (including your username and password).
      2.add, delete user name and password / add, delete group
      3. firewall.
      Note: as a general order from 1 to 3

    Have a question? Post it on our forum!