Ssh error Too many authentication failures for root

8 02 2017

ssh -o PubkeyAuthentication=no root@host





Linode ssh login problem

14 12 2016

If you try to connect to a Linode server by ssh and receive the following message:

Received disconnect from 1.1.1.1: 2: Too many authentication failures

It’s related to the ssh keys, try again with the following argument:

ssh -o PubkeyAuthentication=no user@1.1.1.1

More info:
http://superuser.com/questions/187779/too-many-authentication-failures-for-username





Run ssh-agent at login and load keys with an alias

27 07 2016

Add the following lines to the “~/.bashrc” for start automatically the ssh-agent service in each login and create and alias for load the keys and write the passphrase:

if [ -z "$SSH_AUTH_SOCK" ] ; then
eval `ssh-agent -s`
fi
alias ssh-keys='ssh-add ~/.ssh/name_of_key_one ~/.ssh/name_of_key_two'






Find duplicate IPs inside a subnet

14 10 2015

When a IP address is duplicate in a subnet, if there is a ssh connection to problematic server, the message “Write Failed: broken pipe” usually appears.

For find the MAC address of both hosts, the following command will report them:

# arping -I eth0 -c 3 192.168.0.1

If the result only report one MAC, the problem probably will be in other place.





Keep ssh keys in xfce session

8 05 2015

For have the same behaviour with the ssh keys than in Gnome, write it the first time and keep cached until the end of the session, follow this steps:

Under “Sessions and Startup” menu, add a new “Application Autostart” with:
Name: Keyring
Command: gnome-keyring-daemon --start

Under tab “Advanced” allow:
Launch GNOME services on startup

Finally, restart session.





Debian Jessie hangs ssh on reboot / halt

29 04 2015

Sometimes after reboot or halt a system with Debian Jessie, particularly with systemd, the ssh session didn’t close correctly and hangs. The problem is related with how systemd registers user sessions and control group hierarchy. For solve the it, install libpam-systemd: apt-get install libpam-systemd

 

– Update 1 – Agust 2016

The bug was fixed in openssh-server https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=751636

* Add a session cleanup script and a systemd unit file to trigger it,
     which serves to terminate SSH sessions cleanly if systemd doesn't do
     that itself, often because libpam-systemd is not installed (thanks,
     Vivek Das Mohapatra, Tom Hutter, and others; closes: #751636).

Now, updating openssh-server to version 1:7.3p1-1 or higher solve it too.