Password wont hide when I type it!!


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Password wont hide when I type it!!
# 1  
Old 10-21-2010
Error Password wont hide when I type it!!

Hi there,

I found out a very strange behavior.
If I call ssh, my password will be invisible when I'm prompted to type it:
Code:
santiago@cassiopee:~$ ssh titan.caoba.fr "echo connected"
santiago@titan.caoba.fr's password:    <--- password is hidden when typed
connected
santiago@cassiopee:~$

If I call sudo, my password will also be invisible when I'm prompted to type it:
Code:
santiago@cassiopee:~$ sudo echo superpower
[sudo] password for santiago:          <--- password is hidden when typed
superpower
santiago@cassiopee:~$

So far, that's everything we want. But if I combine the two commands, the password is fully and clearly displayed when prompted to type it in for sudo:
Code:
santiago@cassiopee:~$  ssh titan.caoba.fr "sudo echo connected with superpower"
santiago@titan.caoba.fr's password:    <--- password is hidden when typed
[sudo] password for santiago: abc123   <--- password is NOT hidden when typed
connected with superpower
santiago@cassiopee:~$

Isn't that strange?
How can I circumvent this?

Thanks for your help
Santiago
# 2  
Old 10-21-2010
Code:
# echo "enter your pass:" ; stty -echo ; read mypass ; stty echo
enter your pass:
 # echo $mypass
this is a test
#

Don't know whether it can come from ssh configuration or from sudo configuration

try ssh -t or ssh -T (or any option that deal with tty or pseudo tty assignement to ssh session).
you can also compare the ssh config and/or sudo config between machines
(find one your test is working and one on which your test doesn't work
then compare the ssh config and/or sudo config between them)

Last edited by ctsgnb; 10-21-2010 at 02:36 PM.. Reason: error
# 3  
Old 10-22-2010
Error

Thanks ctsgnb,

ssh -t and ssh -T both work fine.

I have another question. It is still ssh related.
my distant machine is called titan.caoba.fr but the DNS synchronie.caoba.fr also links to it. Is there any way to tell what address I used to open the ssh connection?
Maybe an environement variable. I tried $SSH_HOST but it doesn't work. I'm thinking of something like:
Code:
santiago@cassiopee:~$ ssh titan.caoba.fr "echo $SSH_HOST"
santiago@titan.caoba.fr's password:
titan.caoba.fr
santiago@cassiopee:~$ ssh synchronie.caoba.fr "echo $SSH_HOST"
santiago@synchronie.caoba.fr's password:
synchronie.caoba.fr

# 4  
Old 10-22-2010
Code:
ssh synchronie.caoba.fr "nslookup $SSH_HOST" ?

If you know which specific IP you want to connect through, you can just go for

Code:
ssh supersantiago@123.45.67.89 "whatever ninja command"

# 5  
Old 10-22-2010
Do you mean the remote host name or what host was used:
Code:
ssh titan.caoba.fr 'echo $HOSTNAME'

Code:
ssh titan.caoba.fr 'echo $SSH_CLIENT'

# 6  
Old 12-11-2010
Thanks everyone for your answers.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to hide password when using echo cmd?

Hi Am using unix Aix Ksh I need to hide the password using echo cmd Connecting the database and fetching ip_address and password from one table. greping the IP_address and password using two variable IP_addr Pawd Then Used echo cmd echo " connecting to $IP-addr and $Pawd" ... (3 Replies)
Discussion started by: Venkatesh1
3 Replies

2. Shell Programming and Scripting

How to hide/encrypt password in script?

Hi I have following problem Im writing a script (in bash ) , where need to be written login & passwd for databas client . Its need to in following form login passwd@dbhostname . The problem is so anybody can read it so the passwd & login are visible and thats not very safety . Can... (8 Replies)
Discussion started by: kvok
8 Replies

3. Shell Programming and Scripting

Best way to hide password in bash script?

Dear folks, The title of my thread says mostly all of what I want to do. Basically I want to auto-ssh to a remote host, and run a program on it (VLC is just an example). I wrote a script which calls xterm and then runs expect on it. The code is as follow #!/bin/bash export PASS="xxxxxxx"... (22 Replies)
Discussion started by: dukevn
22 Replies

4. UNIX for Dummies Questions & Answers

How can i hide username/password

hi all, i run sqlplus command on unix(HP-UX) like "sqlplus username/password@serverA @deneme.sql" but when someone run "ps -ef | grep sqlplus", it can see my username and password :( How can i hide username and password. thanx. (1 Reply)
Discussion started by: temhem
1 Replies

5. Cybersecurity

how to hide os type from scaning of nmap or nessus

my os is freebsd 7.1 just open sshd and hide the sshd banner nessus still report correctly the os type how to hide os type from scaning of nmap or nessus? Thanx so much. my ipfw rule: ipfwcmd="ipfw -q add allow tcp" localip="192.168.1.254" $ipfwcmd from any to $localip 22 in setup... (2 Replies)
Discussion started by: overdose
2 Replies

6. Shell Programming and Scripting

How can i hide Server Type Plz

Helo .. How Can i Hide My Server Type Here Hostpres.com - Host Pres And writing Secureb By .... And how Can i Hide uname -a: Linux server.xxxx.net 2.6.18-ovz028stab053.14-enterprise #1 SMP Mon Jun 2 18:25:30 MSD 2008 i686 From Php Shell Like c99... (3 Replies)
Discussion started by: a7medo
3 Replies

7. Shell Programming and Scripting

How Do I Hide the Password in a Script

Hi, I am writing a UNIX .ksh script and need to send the login password of the login id that is executing the script to a command that I am executing in the script. I don't want that password to be seen by anyone except whoever is executing the script. Does anyone know how I can accomplish... (6 Replies)
Discussion started by: samd
6 Replies

8. Shell Programming and Scripting

Want to hide password

All, In my script I am calling another script.. in that script I need to enter a password. Problem is that everyone is able to see the password when I enter that. Is there any way that when i enter that password it should not display or may look like *******. Or if there any other way that I... (1 Reply)
Discussion started by: arpitk
1 Replies

9. Shell Programming and Scripting

How to hide password on Linux?

Hi falks, I have the following ksh code: echo "Enter VS Admin password:" oldstty=`stty -g` stty -echo intr '$-' read password stty $oldstty echo This code ask from a user to enter his password. The OS suppose to hide the entering of the... (2 Replies)
Discussion started by: nir_s
2 Replies

10. Programming

hide password typing

I am doing a project in C program which requires to type in password in Unix terminal. Does anybody know how to shade or not output any words typed by user in the terminal? I use the function scan() to read typing from user. Thanks in advance. (2 Replies)
Discussion started by: ivancheung
2 Replies
Login or Register to Ask a Question