- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Hidden string in remsh
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2004 07:29 PM
тАО10-27-2004 07:29 PM
This is my problem:
I have to type something like a password on an HP-UX 11i system. This string must be hidden while is typed.
On local I use this kind of script:
export TERM=vt100
stty -echo
read MYSTRING
stty echo
MYSTRING=$(echo $MYSTRING|tr -d "[\015]")
But if I launch this script by remsh it doesn't work...
stty: : Unknown error
How can I encrypt or hidden the typing using remsh?
Thanks
Vale et valete
ZAMPO
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2004 07:56 PM
тАО10-27-2004 07:56 PM
Re: Hidden string in remsh
Are you running the stty command on the remote system?. One problem with it is that you cannot run interactive sessions with remsh. Moreover -echo is a local mode option and I am not sure if it is going to work as you are not really applying the controls to the local terminal (from where you are running remsh).
I suggest you do the stty stuff on the local terminal and pass the data (MYSTRING) to your remsh command if possible.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2004 08:12 PM
тАО10-27-2004 08:12 PM
Re: Hidden string in remsh
I'm looking for an alterative way instead of the use of "stty".
I have to use script in remsh and I'd like to hide my typing.
Vale et valete
ZAMPO
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2004 10:17 PM
тАО10-27-2004 10:17 PM
Re: Hidden string in remsh
Does the remote script need other input, apart from the password?
If not then perhaps you could do: -
stty -echo
remsh yourhost yourscript.sh
stty echo
So turn off echo before remshing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2004 10:56 PM
тАО10-27-2004 10:56 PM
Re: Hidden string in remsh
I like your solution, but it's not my situation...
The problem is that I have 2 concatenated remsh...
The first is from an html page (and i cannot modify that) to an Unix server.
The second is from an Unix server to another unix server!
I can ask for the "password" on the first or the second Unix server.
I'm looking for an alternative to the command
stty
P.S. The password is for connect to an Oracle DB
Thanks for helping me!
Vale et valete
ZAMPO
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2004 11:05 PM
тАО10-27-2004 11:05 PM
Re: Hidden string in remsh
If so then I don't understand how your script can be prompting for the password, since cgi-scripts (or any other way from a html page as far as I'm aware) are not interactive and therefore cannot prompt for a password during execution?
Please give more details of what exactly your setup is and I'll try to help more.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2004 12:37 AM
тАО10-28-2004 12:37 AM
Re: Hidden string in remsh
I suppose is a cgi that launch a script on a first server. I have no visibility of the cgi script and I cannot change it!
The (maybe) cgi script call a remsh to a first server. This first unix script connect the operator to a database Server on another machine.
We have several DBs on several servers, so the first script knows if the DB is on a Window (sql server) or an Unix (Oracle) server.
If the db is on an Unix server, the first script call a remsh on the second server. Here there is my script.
My script is launched by a remsh from an Unix server and my script need to ask to the operator the DB password, because connect me to a database (That is on another server -the 3rd one!)
It's a little complicated!!!
I hople to have explain it clearly; if you need more infos, ask for they!
Thanks a lot
Vale et valete
ZAMPO
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2004 01:27 AM
тАО10-28-2004 01:27 AM
Re: Hidden string in remsh
However the problem remains that because your script doesn't have direct access to the tty functions and therefore to set the terminal to not echo, the terminal will echo (it's a hardware thing not a software thing).
One thing you could do, which is very crude but would stop over-the-shoulder readers from getting the password would be something like: -
# START OF SCRIPT
trap "rm lockfile 2>/dev/null" 0
clear
echo "Press ENTER, then type in the password. The screen will be blank."
read JUNK
touch lockfile
while [ -r lockfile ]
do
clear
done &
read STUFF
rm lockfile 2>/dev/null
echo Your password is : $STUFF
# END OF SCRIPT
Basically this script, before the read command, kicks off a background process that constantly clears the screen. Input is then read, but is wiped from the screen as it's being typed. After read, the lockfile is removed, which stops the background loop. The trap is just to force the background loop to stop if the script breaks out.
If on a slow terminal, it may be an option to use echo ".\c" instead of clear, to fill the screen with dots.
Not tidy, but an option.
Is there any reason why the password actually has to be manually typed by the operator, rather than being encoded into the script (with restricted read permissions, of course).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2004 01:43 AM
тАО10-28-2004 01:43 AM
Re: Hidden string in remsh
trap "rm lockfile.$$ 2>/dev/null" 0
touch lockfile.$$
while [ -r lockfile.$$ ]
do
clear
echo "Enter password, then press RETURN"
done &
read STUFF
rm lockfile.$$ 2>/dev/null
echo Your password is : $STUFF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2004 01:52 AM
тАО10-28-2004 01:52 AM
Re: Hidden string in remsh
You can download and install ssh from the following (in the order listed):
http://hpux.cs.utah.edu/hppd/hpux/Development/Libraries/libiconv-1.9.2/
http://hpux.cs.utah.edu/hppd/hpux/Languages/m4-1.4.2/
http://hpux.cs.utah.edu/hppd/hpux/Gnu/bison-1.875/
http://hpux.cs.utah.edu/hppd/hpux/Gnu/flex-2.5.4a/
http://hpux.cs.utah.edu/hppd/hpux/Gnu/gettext-0.14.1/
http://hpux.cs.utah.edu/hppd/hpux/Gnu/gcc-3.4.2/
http://hpux.cs.utah.edu/hppd/hpux/Gnu/make-3.80/
http://hpux.cs.utah.edu/hppd/hpux/Gnu/sed-4.1.2/
http://hpux.cs.utah.edu/hppd/hpux/Tcl/tcltk-8.4.7/
http://hpux.cs.utah.edu/hppd/hpux/Tcl/tcltk-8.4.7/
http://hpux.cs.utah.edu/hppd/hpux/Development/Tools/db-4.2.52/
http://hpux.cs.utah.edu/hppd/hpux/Languages/perl-5.8.5/
http://hpux.cs.utah.edu/hppd/hpux/Languages/openssl-0.9.7d/
http://hpux.cs.utah.edu/hppd/hpux/Misc/zlib-1.2.1/
http://hpux.cs.utah.edu/hppd/hpux/Networking/Admin/tcp_wrappers-7.6/
http://hpux.cs.utah.edu/hppd/hpux/Networking/Admin/openssh-3.7.1p2/
or get it from here: http://www.software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=T1471AA
live free or die
harry