- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Garbage characters when user telnets in
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
Forums
Discussions
Discussions
Discussions
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
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
02-05-2004 02:37 AM
02-05-2004 02:37 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2004 02:44 AM
02-05-2004 02:44 AM
Re: Garbage characters when user telnets in
What is the enviro variable TERM set to in the users .profile ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2004 03:04 AM
02-05-2004 03:04 AM
Re: Garbage characters when user telnets in
The sequence you show corresponds with trying to set TAB stops, probably from the 'tabs' command. See: man tabs.
Apparently your login scripts (/etc/profile? ~/.profile ? .cshrc ? ) uncoditionally blast the victims terminals.
You want to make this conditional. using something like (no solution, just hints):
if [ ! "$VUE" ]; then
# set term if it's not set
if [ "$TERM" = "" -o "$TERM" = "unknown" -o "$TERM" = "dialup" \
-o "$TERM" = "network" ]
Also check out ttytype and tset
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2004 03:07 AM
02-05-2004 03:07 AM
Re: Garbage characters when user telnets in
insf -e has helped me in the past with this, I don't know why it works though.
Also if there is a particular pty thats bad, use rmsf on it first.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2004 03:23 AM
02-05-2004 03:23 AM
Re: Garbage characters when user telnets in
For some environment scripts I also tty -s
For example:
tty -s
if ( $status == 0 ) stty erase "^?"
> they see garbage characters
That's not garbage... it just looks like garbage to the untrained eye :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2004 03:35 AM
02-05-2004 03:35 AM
SolutionDON'T hardcode TERM=something in .profile!! There are hundreds of terminals (and imitations that run on PCs called 'emulators') out there and most Unix systems are well equipped to handle them all using a library called Curses. Curses defines generic features (like clear screen and clear tabs) but translates these into terminal-specific strings based on the value of TERM. In your case, [3g can be found using:
untic vt100 | grep 3g
bel=^G, cr=\r, csr=\E[%i%p1%d;%p2%dr, tbc=\E[3g
where untic decodes all the codes for the vt100 terminal. You see \E[3g which translates to ESC (the escape charater) plus [3g and the generic feature is called tbc. In the man page for terminfo (very lengthy) you'll see that tbc is clear all tabs.
So start with:
echo $TERM
This setting is what tells the Curses library what terminal you have. Obviously, it doesn't match at all so it must have been hardcoded (or preset via telnet--more later). Remove any TERM= codes in .profile and replace it with:
eval $(ttytype -s)
As mentioned, you'll need to protect the ttytype command in case the login is run in batch mode (like su - username in a cron job). In batch mode, there is no controlling terminal, so you code it this way:
if tty -s
then
eval $(ttytype)
tput reset
tabs
fi
The code will only run if there is a real terminal login and sets TERM, COLUMNS, LINES and ERASE.
Depending on what you are using (a PC, a Mac, a Linux box, etc) the handshake during telnet login can set TERM automatically (but you don't want that at all!). Using a subcode in the telnet handshake, your local box can provide a string that will be used to preset TERM even before /etc/profile runs. The problem is that there is little chance that the string provided has any relationship to the terminfo database in HP-UX. So use ttytype to ID the terminal and set TERM automatically.
In the future, you can troubleshoot logins (ie, profile commands) by simply adding:
set -x
to /etc/profile and/or .profile which then traces each step of the script.
Bill Hassell, sysadmin