LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-23-2009, 07:16 AM   #1
vlaflipper
LQ Newbie
 
Registered: Sep 2009
Posts: 4

Rep: Reputation: 0
Telnet backspace problems on Ubuntu , Tinycore


I have a Unix based telnet server.
I can connect it works all.
But when i press backspace i get ^?
I looked on google but i can't get it fixed because i can't change
the server settings.
i hope it can bee fixed
 
Old 09-23-2009, 06:08 PM   #2
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by vlaflipper View Post
I have a Unix based telnet server.
I can connect it works all.
But when i press backspace i get ^?
I looked on google but i can't get it fixed because i can't change
the server settings.
i hope it can bee fixed
It can be fixed -- this is a very common terminal problem. You just change what character the backspace key generates. But to be more specific, I would have to know what terminal you are using -- straight from the shell? A GUI application?

Typically you tell the server what to expect from your side by identifying a particular terminal emulation. And you can change the server's expectations about your side of the transaction. Here is just one example:

Using stty to Set Backspace Key

There are any number of similar configuration changes you can make from your side, and they affect all Telnet transactions.

By the way, why are you using Telnet? I strongly recommend that you look into SSH instead. Telnet is very insecure.
 
Old 09-24-2009, 01:43 AM   #3
vlaflipper
LQ Newbie
 
Registered: Sep 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by lutusp View Post
It can be fixed -- this is a very common terminal problem. You just change what character the backspace key generates. But to be more specific, I would have to know what terminal you are using -- straight from the shell? A GUI application?

Typically you tell the server what to expect from your side by identifying a particular terminal emulation. And you can change the server's expectations about your side of the transaction. Here is just one example:

Using stty to Set Backspace Key

There are any number of similar configuration changes you can make from your side, and they affect all Telnet transactions.

By the way, why are you using Telnet? I strongly recommend that you look into SSH instead. Telnet is very insecure.
I tried "stty erase ^?" on the terminal because I can't get on the telnet server. I must edit it in the Terminal. so that's not the solution for me.
i also tried

#!/usr/bin/expect

eval spawn -noecho $argv

interact {
\177 {send "\010"}
"\033\[3~" {send "\177"}
}


#!/bin/sh

if [ "$#" -ge 1 ]; then
if grep -wq "$@" /etc/bad-bs-hosts ; then
exec kbdfix telnet.orig "$@"
else
exec telnet.orig "$@"
fi
else
exec telnet.orig
fi
 
Old 09-24-2009, 03:38 AM   #4
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by vlaflipper View Post
I tried "stty erase ^?" on the terminal because I can't get on the telnet server. I must edit it in the Terminal. so that's not the solution for me.
??? ... put the command in your ".profile" file as suggested in the link I provided. That way, you never have to type it again.

Alternative -- create a shell script that sets the desired backspace definition, then immediately logs you onto the desired Telnet server. This saves even more typing. A script like this:

Code:
#!/bin/bash

stty erase '^?'
telnet (server-name)
 
Old 09-24-2009, 05:35 AM   #5
vlaflipper
LQ Newbie
 
Registered: Sep 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by lutusp View Post
??? ... put the command in your ".profile" file as suggested in the link I provided. That way, you never have to type it again.

Alternative -- create a shell script that sets the desired backspace definition, then immediately logs you onto the desired Telnet server. This saves even more typing. A script like this:

Code:
#!/bin/bash

stty erase '^?'
telnet (server-name)
that i tried and its set 'stty -a' ^? is set as erase
 
Old 09-24-2009, 06:15 AM   #6
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by vlaflipper View Post
that i tried and its set 'stty -a' ^? is set as erase
Please tell me what your post would mean if it were expressed in simple, declarative sentences.

Did you test the backspace setting after exiting the shell script? This is not relevant to running telnet inside the shell script. Inside the shell script, the setting is maintained. After the shell script exits, the prior setting is reestablished (because it's not inherited by the parent process).

So .,. tell me exactly what you did, and exactly what the results were. Leave nothing to the imagination.
 
Old 09-24-2009, 09:01 AM   #7
vlaflipper
LQ Newbie
 
Registered: Sep 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by lutusp View Post
Please tell me what your post would mean if it were expressed in simple, declarative sentences.

Did you test the backspace setting after exiting the shell script? This is not relevant to running telnet inside the shell script. Inside the shell script, the setting is maintained. After the shell script exits, the prior setting is reestablished (because it's not inherited by the parent process).

So .,. tell me exactly what you did, and exactly what the results were. Leave nothing to the imagination.
First:

We tried to set the command 'stty erase ^?' on the terminal
this did'nt work same problem.

Than we used this script.

#!/usr/bin/expect

eval spawn -noecho $argv

interact {
\177 {send "\010"}
"\033\[3~" {send "\177"}
}


#!/bin/sh

if [ "$#" -ge 1 ]; then
if grep -wq "$@" /etc/bad-bs-hosts ; then
exec kbdfix telnet.orig "$@"
else
exec telnet.orig "$@"
fi
else
exec telnet.orig
fi



it did't help eighter. so the problem is not slove-ed.
 
Old 09-25-2009, 12:44 AM   #8
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by vlaflipper View Post
First:

We tried to set the command 'stty erase ^?' on the terminal
this did'nt work same problem.

Than we used this script.

#!/usr/bin/expect

eval spawn -noecho $argv

interact {
\177 {send "\010"}
"\033\[3~" {send "\177"}
}


#!/bin/sh

if [ "$#" -ge 1 ]; then
if grep -wq "$@" /etc/bad-bs-hosts ; then
exec kbdfix telnet.orig "$@"
else
exec telnet.orig "$@"
fi
else
exec telnet.orig
fi



it did't help eighter. so the problem is not slove-ed.
1. Through experimentation, find an stty entry sequence that does solve the problem. Do not abandon this step until you have gotten a sequence that works.

2. Having successfully completed step (1) above, put the same sequence into a shell script:

Code:
#!/bin/bash
stty (the successful sequence from step (1) above)
telnet (server-name)
Use this simple shell script (not the one in your reply) until the problem is solved. There is no point in adding luxury accessories to a car that won't run.
 
  


Reply


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
Backspace not mapped (^H) at telnet login prompt. Ivan at work Linux - Server 12 06-18-2012 08:57 AM
Backspace not mapped (^H) at telnet login prompt. Ivan at work Linux - Newbie 3 05-29-2009 12:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:43 PM.

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