jorrit
Posts: 23
Joined: Mon Oct 17, 2016 10:48 am

Problem with ssh from linux to raspberry

Tue Oct 25, 2016 6:49 pm

Hi, I have a raspberry pi 3. If I ssh (using putty) from windows to the pi all is ok. I can do 'vi', 'nano' and such.
However if I do that from linux I get a terminal. I can type commands but all tools like vi (or vim), nano, top that do a bit more advanced terminal activity cause the ssh session to freeze. Again, on windows it is fine. It is only when I do this via linux that I get this problem.

Any clue what this could be?

Thanks!

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5813
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Problem with ssh from linux to raspberry

Tue Oct 25, 2016 7:18 pm

jorrit wrote:Hi, I have a raspberry pi 3. If I ssh (using putty) from windows to the pi all is ok. I can do 'vi', 'nano' and such.
However if I do that from linux I get a terminal. I can type commands but all tools like vi (or vim), nano, top that do a bit more advanced terminal activity cause the ssh session to freeze. Again, on windows it is fine. It is only when I do this via linux that I get this problem.
Any clue what this could be?
Thanks!
I'm guessing you're SSH'ing in to the Pi from a Linux terminal (command line). What SSH options are you using?
Personally I prefer to use (as you do for Windows) PuTTY which is available for Linux too!
FWIW, some (old) notes/screenshots are here:
http://www.cpmspectrepi.uk/raspberry_pi ... aspPi.html
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

jorrit
Posts: 23
Joined: Mon Oct 17, 2016 10:48 am

Re: Problem with ssh from linux to raspberry

Tue Oct 25, 2016 7:21 pm

I was just using ssh -l pi 192.xxxx

Nothing else

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5813
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Problem with ssh from linux to raspberry

Tue Oct 25, 2016 7:37 pm

jorrit wrote:I was just using ssh -l pi 192.xxxx
Nothing else
Ok. Nothing fancy. What terminal type/emulator are you using on your Linux box (eg. LXTerminal, Xterm ...) and what flavour of Linux (I'm currently running Debian 8)? Do you have more than one Pi (or can you borrow another one)? If so, do you get the same issues "Pi to Pi")? Historically I've always run SSH with X-forwarding etc. enabled so that GUI apps run from the command line can display on the "logged in" Linux box. (Or a Windows m/c with something like Hummingbird running to provide an X-windows compatible display system). Somewhat simpler than a "full-blown" VNC setup.
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

jorrit
Posts: 23
Joined: Mon Oct 17, 2016 10:48 am

Re: Problem with ssh from linux to raspberry

Wed Oct 26, 2016 4:59 pm

I'm using 'konsole' from kubuntu. I have only access to my own Pi

jorrit
Posts: 23
Joined: Mon Oct 17, 2016 10:48 am

Re: Problem with ssh from linux to raspberry

Wed Oct 26, 2016 5:10 pm

Oh! Turns out I was wrong. It is actually broken from windows too. But it worked before I did sudo apt-get update/upgrade on the PI.
Seems that the upgrade has broken something. Anyway to fix this as it is pretty annoying trying to edit files on the pi this way.

Can it be that somehow the terminal settings on the pi got messed up?

Edit: seems if I output too much text it blocks too. apt-get upgrade did work with lots of output though.

Edit 2: I just found this: http://raspberrypi.stackexchange.com/qu ... g-randomly
I experienced a similar issue. It seemed that if executing a command over ssh that returned more than a few lines that ssh would freeze. sudo apt-get upgrade would run fine, but ls -r or ifconfig would freeze after about 10 lines. Changing the MTU settings resolved the issue for me.

The following command resolved things. I was connected over wifi, so replace the interface name as necessary. Default MTU was 1500:

sudo ifconfig wlan0 mtu 500 up
I'll try that

Thanks

jorrit
Posts: 23
Joined: Mon Oct 17, 2016 10:48 am

Re: Problem with ssh from linux to raspberry

Wed Oct 26, 2016 6:08 pm

Ok, for future reference. This command exactly solved my problem:

sudo ifconfig wlan0 mtu 500 up

wh7qq
Posts: 1475
Joined: Thu Oct 09, 2014 2:50 am

Re: Problem with ssh from linux to raspberry

Wed Oct 26, 2016 7:32 pm

I simply do

Code: Select all

ssh pi@192.168.1.x
(Bad on me, I haven't changed the username) from a linux terminal to either a Raspberry Pi B+ or a RPi 3 or any linux terminal. The command prompt changes to reflect the different device but otherwise works just like a normal terminal. I just did an apt-get install raspberrypi-kernel on the B+ and had no problems with the display showing multiple lines or locking up. There is no need for the " -l" if the username is specified in the address. Using putty adds an unnecessary package, as ssh is native to linux. You may need to do

Code: Select all

 sudo apt-get update && sudo apt-get install ssh
if ssh isn't already part of your distro. Also, I am running default MTU values (1500) and reaching the B+ by wifi. No need to make life more complicated than it is.

User avatar
HawaiianPi
Posts: 5971
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Problem with ssh from linux to raspberry

Wed Oct 26, 2016 7:58 pm

I don't have any trouble from Linux terminals either. Currently using Linux Mint 18, but I have used SSH from several distros without issue.

I normally just use:
ssh username@hostname

One of the first things I do when setting up a new Pi is change the default hostname and password, so all our Pi computers have unique hostnames. This simplifies things considerably, because I don't have to worry about IP addresses.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5813
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Problem with ssh from linux to raspberry

Thu Oct 27, 2016 2:32 pm

jorrit wrote:Ok, for future reference. This command exactly solved my problem:
sudo ifconfig wlan0 mtu 500 up
O.K. Just to clarify (for others) that means that (strictly) your problem was not an SSH issue but a (more general) wireless networking issue. Which happens to be something I'm less likely to come across because my netbook and (most of) my Pi's are usually connected via their (wired) ethernet ports.**
Trev.
** Long before WiFi became common and cheaply available I installed a wired LAN "backbone" in the house which is still "going strong". Most of the WiFi connections are associated with my daughters' devices ('phones, tablets ...).
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

jorrit
Posts: 23
Joined: Mon Oct 17, 2016 10:48 am

Re: Problem with ssh from linux to raspberry

Wed Nov 02, 2016 6:47 pm

I have one further question about this. Is it possible to add this command to some kind of bootup script or something? Because I have to do it everytime the Pi boots up

Thanks

Return to “Troubleshooting”