Read userid and password


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Read userid and password
# 1  
Old 07-06-2010
Question Read userid and password

Am reading userid and password.

code:

Code:
pmsg "Enter the userid \n"
read userid
pmsg "Enter password \n"
read password
pmsg "Enter Database name \n"
read database

When user type password, it a clear text. I want something like
******** or just a blank

any suggestion plz...

Thanks...
Gopal

Last edited by pludi; 07-06-2010 at 09:45 AM.. Reason: code tags, please...
# 2  
Old 07-06-2010
hi,

Code:
echo -n "Password: "
stty -echo
read password
stty echo
echo ""         # force a carriage return to be output
echo You entered $password

# 3  
Old 07-06-2010
bash's read has -s (silent mode) option:
Code:
read -sp'Password: ' passwd
echo "You entered $passwd"

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Emergency UNIX and Linux Support

Read password from a file

Hello Gurus, This is something i need to implement quite urgently. My requirement is as follows: 1. We are using Solaris 10, Sun Access Manager appln. 2. we need to start a domain through script (automated). Syntax of the command goes as below: ./asadmin start-domain --user admin domain1 ... (7 Replies)
Discussion started by: EmbedUX
7 Replies

2. Shell Programming and Scripting

Shell Script to Automatically Read My Password

I have a shell script to run set of commands every week . I dont have a root access on the server but I can run the commands using pbrun cat myscript.sh * * * pbrun command.... each time I run the script , it asks me for my password then it executes fine. ./myscript.sh Password... (7 Replies)
Discussion started by: Sara_84
7 Replies

3. Shell Programming and Scripting

How to read userid and password information from txt file

Hi Experts, I am writing a shell script (for displaying disk space details) which is logging to 15 different servers using following command. ssh userid@servername It is prompting me for password for all 15 servers when I manually run it. However , soon I would like to schedule this script... (4 Replies)
Discussion started by: ajaypatil_am
4 Replies

4. Shell Programming and Scripting

loop to read multiple username and password

Hello all, I am i am trying to read username password. Bassicaly, i have file called sidlist and it has my database name, username and password.... looks something like this.... db1, user1, pass1 db2, user2, pass2 db3, user3, pass4 but i dont know how to make it work, until i get... (4 Replies)
Discussion started by: abdul.irfan2
4 Replies

5. Shell Programming and Scripting

sftp shell script - Password read error.

Hi, I have script which does the sftp function. In the script in one place it able to read the password from file and other place files with below error. warning: has much more security than supplying the password in the clear warning: on the command line. Failed to get password: File... (0 Replies)
Discussion started by: vino_hymi
0 Replies

6. Shell Programming and Scripting

perl script example to take password hiden and read from it

Hi, I am new to perl scripting Can you please let me know if you have an example on how to read the hidden password and read from it? Thanks, Mahesh (1 Reply)
Discussion started by: mum6ue
1 Replies

7. Shell Programming and Scripting

Read Oracle Username password SID from single file and pass it to shell

Dear All I am trying to write one shell which will be running through Cron which contain one SQL query. But I want to draw/fetch the Username password and Instance name (required to loging to the database) from one single file to run that SQL query . Also this file contain details of multiple... (2 Replies)
Discussion started by: jhon
2 Replies

8. AIX

AIX 5.3 userid password length to 6

Hi All, How can I make the password of only two userid with 6 length while others are using regular policy of 8 or more length. Please help. Thanks. (2 Replies)
Discussion started by: itik
2 Replies

9. Shell Programming and Scripting

How To Read A File Remotely Without A Password?

Many thanks to anyone who can help me solve this problem I am having: I am working on an HP-UX system version B.11.11 and I have been tasked with finding a way to read a file on a remote server (cat, grep, etc.) using a specific userID without copying it or moving it to the local machine. ... (0 Replies)
Discussion started by: Korn0474
0 Replies

10. AIX

UserID password validation using C program

I am new to AIX. I was wondering if there is a security API on AIX which I can call from my C program to validate the userID and password of a user. My plan is to have my C program prompt the user for UserID and password. I'll then call the AIX security API to determine what authority the user... (1 Reply)
Discussion started by: AIX_user
1 Replies
Login or Register to Ask a Question