mathjax + gtag

Pages

Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Monday, October 24, 2016

Why is ssh slow to connect?

Introduction

There are several reasons why ssh may be getting slow to connect. I'll cover here the ones that happened to me.


On the server side

  1. Make sure you have a line "UseDNS no" uncommented.
  2. Make sure you have "good" (i.e., reachable) DNS servers in /etc/resolv.conf.
  3. Make sure you have no reverse DNS lines in /etc/hosts.deny.
The server side configuration is typically in the file /etc/ssh/sshd_config. Every time you make a change to this file, remember to restart the ssh daemon ("# systemctl restart sshd").

    Item number 3 deserves some comments, since it was the hardest to get right. Denyhosts may be adding lines like  "xxx-xxx-xxx-xxx.rev.abxtelex.eu" that will trigger reverse DNS even if you have "UseDNS no" in the configuration file. You have to remove these lines, but if you have Denyhosts installed, maybe you already know how hard it is to remove entries from this file, since they keep reappearing. If you use OpenSUSE, you have a script called "/usr/sbin/dh_reenable" that will do the trick for you. If you are not using OpenSUSE or have installed Denyhosts by hand, then you have to do it manually, take a look at the Denyhosts FAQ here.

    I still don't have a good solution to problem number 3, the best thing would be that Denyhosts did not add reverse DNS entries in /etc/resolv.conf, but I did not find a way to configure it to behave like that.


    On the client side

    The global client side configuration is typically in the file /etc/ssh/ssh_config. But you can configure things on a user level by editing the file ~/.ssh/config.

    I use the local configuration file like this:

    Host *
    Compression yes
    ForwardX11=yes
    ForwardX11Trusted=yes
    GSSAPIAuthentication=no

    Host analise
    HostName 192.168.1.1

    Host home
    Hostname xxxx.noip.me


    That way I can just type "ssh analise" or "ssh home". In the "home" case, it has the advantage of making my dynamic dns name shorter.


    1. Make sure you have the line "GSSAPIAuthentication=no".

    Thursday, October 16, 2014

    Cuda 6.5 on OpenSuSE 12.3

    NVidia Drivers

    Make sure you have the official NVidia drivers installed in your system:
    • Run Yast.
    • Click in "Software Repositories"
    • Click in "Add"
    • Choose "Specify URL", then "Next"
    • Repository Name: "nvidia", URL: http://download.nvidia.com/opensuse/12.3/
    • Confirm
    • Go back to Yast
    • Click in "Software Management"
    • Search for "nvidia"
    • Add the following packages: 
    1. x11-video-nvidiaG03-340.46-30.1.x86_64
    2. nvidia-gfxG03-kmp-desktop-340.46_k3.7.10_1.1-30.1.x86_64
    3. nvidia-computeG03-340.46-30.1.x86_64
    4. nvidia-settings-325.15-1.3.x86_64
    5. nvidia-glG03-340.46-30.1.x86_64
    6. nvidia-texture-tools-2.0.6-36.2.x86_64
    7. nvidia-uvm-gfxG03-kmp-desktop-340.46_k3.7.10_1.1-30.1.x86_64
    Notice that the above assumes your board is supported by the G03 kernel driver and that you are using the "kernel-desktop". Make sure you choose the proper driver for your board and the kernel driver corresponding to your kernel.

    CUDA Installation

    Install the CUDA repository. Although the repository is for OpenSuSE 13.1, it will work perfectly with 12.3.
    • Click in "Add"
    • Choose "Specify URL", then "Next"
    • Repository Name: "cuda", URL: http://developer.download.nvidia.com/compute/cuda/repos/opensuse131/x86_64
    • Confirm
    • Go back to Yast
    • Click in "Software Management"
    • Search for "cuda"
    • Add the following packages (some of them will be automatically added): 
    1. cuda-documentation-6-5-6.5-14.x86_64
    2. cuda-cudart-6-5-6.5-14.x86_64
    3. cuda-cufft-dev-6-5-6.5-14.x86_64
    4. cuda-repo-opensuse131-6.5-14.x86_64
    5. cuda-visual-tools-6-5-6.5-14.x86_64
    6. cuda-cufft-6-5-6.5-14.x86_64
    7. cuda-npp-dev-6-5-6.5-14.x86_64
    8. cuda-curand-dev-6-5-6.5-14.x86_64
    9. cuda-license-6-5-6.5-14.x86_64
    10. cuda-runtime-6-5-6.5-14.x86_64
    11. cuda-misc-headers-6-5-6.5-14.x86_64
    12. cuda-samples-6-5-6.5-14.x86_64
    13. cuda-curand-6-5-6.5-14.x86_64
    14. cuda-toolkit-6-5-6.5-14.x86_64
    15. cuda-cublas-6-5-6.5-14.x86_64
    16. cuda-cusparse-dev-6-5-6.5-14.x86_64
    17. cuda-drivers-340.29-0.x86_64
    18. cuda-cudart-dev-6-5-6.5-14.x86_64
    19. cuda-npp-6-5-6.5-14.x86_64
    20. cuda-command-line-tools-6-5-6.5-14.x86_64
    21. cuda-cusparse-6-5-6.5-14.x86_64
    22. cuda-6.5-14.x86_64
    23. cuda-core-6-5-6.5-14.x86_64
    24. cuda-cublas-dev-6-5-6.5-14.x86_64
    25. cuda-driver-dev-6-5-6.5-14.x86_64
    26. cuda-6-5-6.5-14.x86_64
    • Click "Accept".

    Testing





    Usefull Links