[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: Trouble



>Hi, my name is Amaranta, and i'm from Chile. In the page says that I have to write you in

>english, so i'm trying, but i'm not that handy though, so please be patience.
>
>I have 2 problems:
>
>1.- I sort of need the login.cc file of the Debian sources and I can't find it in anywere, if

>you please could send it to me. I need to see an example of how to capture the password

> of the user of the keyboard before it apears in the screen (like when someone make su).
[snip]

 

I am assuming that you are writing a program that requires a user to enter a password and you just want to ensure that the password is not displayed. If that is the case, here is how you would do it in bash. Please note that the read command is a bash shell variable so you will have to read the bash man pages for more information (`man bash` …I swear the devs do this on purpose sometimes…heh heh  :)

 

#!/bin/sh

read -rsp "Enter Password:" pass

echo ""

echo $pass

 

 

As for other languages, I use the following phrase to do google searches whenever I need this info “Mask password entry in <insert language>”. Here are a few for you since you didn’t say what language you are using:

C/C++ : http://www.dreamincode.net/forums/showtopic57944.htm

Java : http://java.sun.com/developer/technicalArticles/Security/pwordmask/

 

Hope that helps. Have fun!

~S~

 


Reply to: