Shell Script accept password using read commnad

Posted on in Categories Script last updated April 10, 2008

6 comment

  1. #!/bin/bash
    PASS=”abc123″

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

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

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

    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 file.sh order from 1 to 3

Leave a Comment