[우분투 ssh 접속 속도 문제]
$ sudo vi /etc/ssh/ssh_config
:% s/GSSAPIAuthentication yes/GSSAPIAuthentication no/g
참고 : http://www.walkernews.net/2009/04/06/how-to-fix-scp-and-ssh-login-prompt-is-very-slow-in-linux/
How To Fix: SCP And SSH Login Prompt Is Very Slow In Linux
Apparently, today is not a good day for me. But it’s not too bad too as I still have enough fingers to count all these bad incidents :-)
OK, back to topic. How to find out that what cause the SSH or SCP login prompt to slowdown? How could you fix this so-called slow or delayed SSH and SCP login prompt?
This is one of the “bad incident” happened on me today – as the boss was looking at me to scp program patches to a remote Linux-based application server, the SSH login prompt took more than 1 minute to appear on screen.
To be precise, the stopwatch showed that it took exactly 1 minute and 25 seconds to display SSH login prompt!
Luckily, I do not have to Google for more than a minute to find the cause and solution :-)
What causes SCP and SSH login prompt to slowdown?
For my case, the GSSAPI authentication feature was causing the delayed SSH login prompt!
You can confirm the causes of your case by using the -v option switch. For example, the following is the verbose response of SSH login process started with -v option:
How to fix SCP and SSH delayed login prompt?
The answer for my case is apparently by disabling GSSAPI authentication, which can be done in one of these three ways:
1) Specify the option to disable GSSAPI authentication when using SSH or SCP command, e.g.:
2) Explicitly disable GSSAPI authentication in SSH client program configuration file, i.e. edit the /etc/ssh/ssh_config and add in this configuration (if it’s not already in the config file):
3) Create a file called config in .ssh directory of respective user home directory (or whichever user home directory that need to get rid of this show login prompt). For example, edit/home/devstl/.ssh/config (create the config file if it’s not currently exist) and add in the
After disabling GSSAPI authentication, SSH login prompt is back to “normal” now:
As you can see, the SSH login is not currently authenticated via public key cryptography method, which I’ve to fix it later :-(
How To Fix: SCP And SSH Login Prompt Is Very Slow In Linux
Apparently, today is not a good day for me. But it’s not too bad too as I still have enough fingers to count all these bad incidents :-)OK, back to topic. How to find out that what cause the SSH or SCP login prompt to slowdown? How could you fix this so-called slow or delayed SSH and SCP login prompt?
This is one of the “bad incident” happened on me today – as the boss was looking at me to scp program patches to a remote Linux-based application server, the SSH login prompt took more than 1 minute to appear on screen.
To be precise, the stopwatch showed that it took exactly 1 minute and 25 seconds to display SSH login prompt!
Luckily, I do not have to Google for more than a minute to find the cause and solution :-)
What causes SCP and SSH login prompt to slowdown?
For my case, the GSSAPI authentication feature was causing the delayed SSH login prompt!
You can confirm the causes of your case by using the -v option switch. For example, the following is the verbose response of SSH login process started with -v option:
dev01 [/home/devstl]$ ssh -v appssupp@10.50.100.111
......
......
......
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic
debug1: An invalid name was supplied
Cannot determine realm for numeric host address
debug1: An invalid name was supplied
Cannot determine realm for numeric host address
debug1: An invalid name was supplied
Cannot determine realm for numeric host address
debug1: Next authentication method: publickey
debug1: Trying private key: /home/devstl/.ssh/identity
debug1: Trying private key: /home/devstl/.ssh/id_rsa
debug1: Trying private key: /home/devstl/.ssh/id_dsa
debug1: Next authentication method: password
appssupp@10.50.100.111's password:
How to fix SCP and SSH delayed login prompt?
The answer for my case is apparently by disabling GSSAPI authentication, which can be done in one of these three ways:
The “fix” is tested with SSH clients installed by openssh-clients-3.9p1-8.RHEL4.15 RPM file.
1) Specify the option to disable GSSAPI authentication when using SSH or SCP command, e.g.:
ssh -o GSSAPIAuthentication=no appssupp@10.50.100.111
2) Explicitly disable GSSAPI authentication in SSH client program configuration file, i.e. edit the /etc/ssh/ssh_config and add in this configuration (if it’s not already in the config file):
GSSAPIAuthentication no
3) Create a file called config in .ssh directory of respective user home directory (or whichever user home directory that need to get rid of this show login prompt). For example, edit/home/devstl/.ssh/config (create the config file if it’s not currently exist) and add in the
GSSAPIAuthentication no
option.1) /etc/ssh/ssh_config is a global SSH client configuration file that affects all system users who are using SSH client programs.
2) /home/devstl/.ssh/config is local SSH client configuration file that only affects the user account called devstl. Whatever SSH client options specified in this local file overwrite the options stated in global SSH client configuration file.
After disabling GSSAPI authentication, SSH login prompt is back to “normal” now:
dev01 [/home/devstl]$ ssh -v appssupp@10.50.100.111
......
......
......
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/devstl/.ssh/identity
debug1: Trying private key: /home/devstl/.ssh/id_rsa
debug1: Trying private key: /home/devstl/.ssh/id_dsa
debug1: Next authentication method: password
appssupp@10.50.100.111's password:
As you can see, the SSH login is not currently authenticated via public key cryptography method, which I’ve to fix it later :-(