assisi / casu-beaglebone

A repository with a source code for Beaglebone Green used for CASU devices
0 stars 0 forks source link

Slow SSH access from unknown hosts #10

Open rmm-fcul opened 9 years ago

rmm-fcul commented 9 years ago

ssh into the CASU beaglebones is very slow if the remote host IP is not in the CASU /etc/hosts file. Deploying of code uses scp, so this stage is also very slow from an unknown host. However, the same host, with IP entered into the /etc/hosts file becomes usable again.
This slow behaviour is despite having ssh keys installed (from host to have passwordless login on the CASUs)

There might be a network setting that can be tweaked in the beaglebone o/s; but a possible resolution to this issue would simply be documentation (e.g. in http://assisipy.readthedocs.org/en/latest/deploy.html#network-setup).

dmiklic commented 9 years ago

Rob, can you please add this to the assisipy docs and make a pull request there?

rmm-fcul commented 9 years ago

I will update the documentation for now.

However, since the issue is better isolated now, I think a fix is possible. The links below suggest a way forwards that is more robust than having to add new hosts every time. I am in favour of this, unless there are compellings reasons to maintain DNS lookup (and /or the GSS stuff).

http://unix.stackexchange.com/questions/5621/how-to-speed-my-too-slow-ssh-login 1) Turn off DNS lookup [in /etc/sshd_config]

UseDNS no

2) comment out GSSAPI [in /etc/sshd_config]

 `# GSSAPIAuthentication yes`
 `# GSSAPIDelegateCredentials no`

3) add remote host in casu files [in /etc/hosts]

http://injustfiveminutes.com/2013/03/13/fixing-ssh-login-long-delay/ also suggests testing #2 with a client-side option:

ssh -o GSSAPIAuthentication=no user@yourserver

4) handle DNS for IPv4/v6 [in etc/resolv.conf]

options single-request-reopen