Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-18-2011, 04:40 PM   #1
Registered: Aug 2010
Posts: 103

Rep: Reputation: 5
variable as a password ?

Hello y'all, I created a variable that Serves as a password, the problem an having is that anytime I type the word, its visible and I don't want it to be visible and seen in my screen anytime its typed. You know when you use the "SU" command and you type in the password its doesn't show on the screen, don't know of there is anything I can also to make my secret word not to show when I type it in. For better understanding, I wrote a script that test for a condition, if the condition is met then its request for a word. So this is what an actually trying to protect. Don't know if this can be achieved. Thanks in anticipation.
Old 02-18-2011, 04:43 PM   #2
LQ Guru
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
I take it you are talking about a bash script, I presume?
Old 02-18-2011, 06:00 PM   #3
Senior Member
Registered: Jan 2010
Posts: 1,620

Rep: Reputation: 450Reputation: 450Reputation: 450Reputation: 450Reputation: 450

Do you mean something like this
read -rs variable
Old 02-19-2011, 01:09 AM   #4
Registered: Aug 2010
Posts: 103

Original Poster
Rep: Reputation: 5
Its like my post was not explicit enough, cause no one seems to understand. I wrote a script and put in my ~/.bashrc to test for a condition, if that condition is met then its request a word, and of the wrong word is supplied the terminal exits. Its a way of conttolling access to my terminal. What I really want now is to know of there. Is anything that can be done so when o type in the word its does not show on my screen. Like the way "su" password stays invisible on the screen.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash: Input password into a variable 1veedo Linux - General 5 08-24-2010 04:07 AM
Script to copy specific directory based on variable to folder with that variable name fluxburn Programming 7 01-07-2010 08:59 PM
AWK a variable Ouptut to a new variable and using the new variable with the old one alertroshannow Linux - Newbie 4 02-16-2009 01:08 AM
Sed search for variable and delete entire line, but variable contains forward /'s Passions Programming 2 11-10-2008 04:44 PM
setting proxy username and password in environment variable maveickstorm Linux - Networking 2 11-21-2006 01:20 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:32 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration