Re: When logging in from a Linux machine using openssh backspace does not work (1095 Views)
Reply
Frequent Advisor
Posts: 46
Registered: ‎03-07-2012
Message 1 of 9 (1,186 Views)

When logging in from a Linux machine using openssh backspace does not work

Hello,

when logging in using openssh from a Linux system to a comware switch, backspace does not work, however ctrl-h, does.

Is there a trick to enable backspace when connecting from unix based system to a comware switch?

 

Cheers,

       Thomas

 

Valued Contributor
Posts: 212
Registered: ‎10-06-2013
Message 2 of 9 (1,173 Views)

Re: When logging in from a Linux machine using openssh backspace does not work

You are not alone:

 

http://h30499.www3.hp.com/t5/Comware-Based/Telnet-SSH-access-backspace-does-not-work/td-p/2316253

 

Let me know if somebody finds a more solid solution to this problem.

 

A possible workaround (depending on client) might be to dig up how to configure your ssh client to "Delete key sends ^H" as described in:

 

http://www.myteneo.net/blog/-/blogs/hp-comware-can-t-backspace-in-iterm

Valued Contributor
Posts: 212
Registered: ‎10-06-2013
Message 3 of 9 (1,170 Views)

Re: When logging in from a Linux machine using openssh backspace does not work

[ Edited ]

Some claims using a different terminal might solve this (like xterm instead of gnome-terminal).

 

Juniper-people has the very same problem by the way =)

 

http://www.juniperforum.com/index.php?topic=3056.0

 

Here is another solution/workaround:

 

http://unix.stackexchange.com/questions/13413/force-telnet-ssh-to-use-crtl-h-for-backspace

 

http://www.ibb.net/~anne/keyboard/keyboard.html

 

Acclaimed Contributor
Posts: 25,875
Registered: ‎03-06-2006
Message 4 of 9 (1,150 Views)

Re: When logging in from a Linux machine using openssh backspace does not work

> backspace does not work, however ctrl-h, does.

 

Your switch is working correctly.   It's your Linux box that's broken/misconfigured.  ;-)

Backspace should be control-H.  You need to check your stty settings on Linux to see what it is sending.

If you see ^? on Linux and ^h on your switch, that's the problem.

 

If you are using putty, there is a configuration setting that you can change for the backspace key.

In my .profile and putty sessions I make sure it is consistently set so erase/backspace is control-H.

Frequent Advisor
Posts: 46
Registered: ‎03-07-2012
Message 5 of 9 (1,144 Views)

Re: When logging in from a Linux machine using openssh backspace does not work

Hello,

 

Your switch is working correctly.   It's your Linux box that's broken/misconfigured.  ;-)

 

do you have any proof for that because the track record is clear:

 

- Linux works

- Solaris works

- AIX works

- HP-UX works

- Procurve works

- Cisco works

 

The only thing that does not work is comware switches.

 

When I issue 'stty erase ^H' on my Linux term than it breaks Ctrl-H on Linux but still does not work on Comware switches. So I assume that Comware has somewhere a broken termcap entry and they should fix it.

 

Cheers,

     Thomas

Valued Contributor
Posts: 212
Registered: ‎10-06-2013
Message 6 of 9 (1,131 Views)

Re: When logging in from a Linux machine using openssh backspace does not work

I can confirm that the method described in http://unix.stackexchange.com/questions/13413/force-telnet-ssh-to-use-crtl-h-for-backspace is good workaround (at least for me, confirmed with both A5820 and A5120 using Ubuntu 13.10).

 

That is (on Ubuntu):

 

1) apt-get install expect

 

2) vi /usr/bin/kbdfix

 

or whatever you wish to call your file.

 

3) Put this into the kbdfix file:

 

#!/usr/bin/expect

#Name this file as kbdfix and make it executable in your path
eval spawn -noecho $argv

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

 

4) Save the file and set proper permissions on it (for example):

 

chmod 755 /usr/bin/kbdfix

 

5) Now connect to your comware device:

 

kbdfix ssh username@1.2.3.4

 

(where 1.2.3.4 is the ip of your comware-device).

 

And voila! Backspace works as expected :-)

Frequent Advisor
Posts: 46
Registered: ‎03-07-2012
Message 7 of 9 (1,123 Views)

Re: When logging in from a Linux machine using openssh backspace does not work

Hello,

I like fixing bugs better than fighting the symptoms and using expect on top of ssh is not really a solution it is a very

ugly workaround that I'm not going to use.

 

Cheers,

     Thomas

Valued Contributor
Posts: 90
Registered: ‎09-20-2013
Message 8 of 9 (1,113 Views)

Re: When logging in from a Linux machine using openssh backspace does not work

hi,

 

I can confirm that backspace sends ASCII DEL, works fine on comware 7.10 (7.1.035, Release 2210) but doesn't on comware 5.2 ( 5.20.105, Release 6708).
 
I guess you have to use Control-H or if you use gnome-terminal or similar, you can make a special profile for it and make backspace send CONTROL-H. Still it needs a fix or at least a possibility to configure it to make it "act correctly".
 
Regards
 
Søren Dideriksen, Network Administrator
Region Midtjylland
Highlighted
Acclaimed Contributor
Posts: 25,875
Registered: ‎03-06-2006
Message 9 of 9 (1,095 Views)

Re: When logging in from a Linux machine using openssh backspace does not work

>do you have any proof for that because the track record is clear:

 

"works" means it works the way I want it to work.  ;-)

 

>When I issue "stty erase ^H" on my Linux term than it breaks Ctrl-H

 

Breaks it how?  This means when you type a control H, it should erase one char.

It also means your backspace key better be configured to send ^H.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.