≡ Menu

Shell Script accept password using read commnad

{ 6 comments… add one }
  • ashwini November 29, 2012, 9:51 am

    thank u friend

  • Prakash Rana January 23, 2012, 4:14 pm

    Not working for me.

  • ivaylo January 22, 2011, 11:21 am

    #!/bin/bash
    PASS=”abc123″

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

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

    • ngovuongbinhtay April 15, 2011, 12:46 am

      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

  • Amit Gupta August 16, 2010, 12:59 pm

    Not working for me. Find the outpur below

    bash-3.00$ sh testing_pass.txt
    hi
    hi
    bash-3.00$

    • ngovuongbinhtay April 14, 2011, 12:51 pm

      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

Security: Are you a robot or human?

Leave a Comment