Q:

SSH - buffer_get_ret: trying to get more bytes 4 than in buffer 0

I am trying to make a tunnel. 
When I run command 
ssh [user]@[host] -p [port] -L [localport]:[ip]:[port2] -N -vv -y -i /home/glab/.ssh/id_rsa

the tunnel starts.  Bu the problem is that it after some time stops working. 
So then I found out that I need autossh.  Tried with this, then tried with supervisor.  Nothing helped. 
In the var/log/syslog file I see lot of logs, and the first lives which come are:
Oct 21 07:40:01 localhost autossh[17521]: starting ssh (count 8)
Oct 21 07:40:01 localhost autossh[17521]: ssh child pid is 17541
Oct 21 07:40:01 localhost /usr/bin/ssh[17541]: OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
Oct 21 07:40:01 localhost /usr/bin/ssh[17541]: debug1: Reading configuration data /etc/ssh/ssh_config
Oct 21 07:40:01 localhost /usr/bin/ssh[17541]: debug1: /etc/ssh/ssh_config line 19: Applying options for *
Oct 21 07:40:01 localhost /usr/bin/ssh[17541]: debug2: ssh_connect: needpriv 0
Oct 21 07:40:01 localhost /usr/bin/ssh[17541]: debug1: Connecting to [ipaddress] [ipaddress] port [port]. 
Oct 21 07:40:01 localhost /usr/bin/ssh[17541]: debug1: Connection established. 
Oct 21 07:40:01 localhost /usr/bin/ssh[17541]: error: buffer_get_ret: trying to get more bytes 4 than in buffer 0
Oct 21 07:40:01 localhost /usr/bin/ssh[17541]: error: buffer_get_string_ret: cannot extract length
Oct 21 07:40:01 localhost /usr/bin/ssh[17541]: error: key_from_blob: can't read key type
Oct 21 07:40:01 localhost /usr/bin/ssh[17541]: error: key_read: key_from_blob \n failed

I search what this error means:
http://www.brandonchecketts.com/archives/ssh-error-trying-to-get-more-bytes-4-than-in-buffer-0

The problem is actually a corrupt line in a users
  ~/.ssh/authorized_keys file.  This user had copy/pasted a new key into
  his authorized_keys file and it had a newline after the ssh-rsa. 
  Strangely enough, people were still able to authenticate if their key
  was above the corrupted line.  Users whose key was listed below the
  corrupt line were not able to log in. 

There is no authorized_keys file in my .ssh directory.  But also one comment says that this problem can be because known_hosts have new line at end of file. 
Then I check if there is new line:
cat -A known_hosts

There I saw $ sign, I am not sure, maybe this means new line, maybe not.  But when running without -A parameter there is no $ sign. 
I tried running
truncate -s $(($(stat -c '%s' known_hosts)-1)) foo

to remove new line as there is written: https://stackoverflow.com/questions/16365155/removing-a-newline-character-at-the-end-of-a-file
but did not help. 
How to fix this?  

A:

Found out that in remote server file authorized_keys was bad - it had multiple lines for one key
https://wiki.mcs.anl.gov/IT/index.php/SSH_Keys:authorized_keys
Not sure why it was so.  After removed line endings where they had not be, problem was solved.