Welcome to the PiMP Mining Community Forum.


Coin/crypto news, miner.farm and getpimp.org announcements, guides, and tips.


Using ~/.ssh/config file to simplify connecting to rigs using SSH


  • Staff

    SSH command line access made easier:

    It can be quite cumbersome when you have a lot of rigs to log into. You can use a program like MobaXterm or PuTTy to save sessions, or you can use ssh's built-in configuration file to do so.

    What most miners don't seem to know is that SSH can use a configuration file in ~/.ssh/config to create an alias of sorts for SSH hosts. If you use aliases in Bash then you can think of this as an alias for creating an SSH connection to a server or mining rig.

    Without config:

    ssh -i ~/.ssh/mycred1.id_rsa root@192.168.1.31

    With config:

    ssh rig31

    By using the ~/.ssh/config file, it no longer becomes necessary to provide all of the connection parameters every time you want to connect. All information needed to connect to a host can just be defined in a host entry inside the config file.

    Example .ssh/config:

    Host rig31
        Hostname 192.168.1.31
        User root
        IdentityFile ~/.ssh/mycred1.id_rsa
    
    Another side benefit to this is that you also automatically have a document of all SSH servers you can connect to. No need to maintain an easily outdated spreadsheet which has to be updated separately.
    
    Host rig32
        Hostname 192.168.1.32
        User root
        IdentityFile ~/.ssh/mycred1.id_rsa
    
    Host rig33
        Hostname 192.168.1.33
        User root
        IdentityFile ~/.ssh/mycred1.id_rsa
    

    If you have multiple people managing rigs, you can share this file with them. This can help standardize access by having it in version control (like Github) which will help have an audit trail, easier to maintain than having multiple files on one's PC & an indirect backup.

    Also nice to know for the configuration is that you can specify options that are common for some or most hosts, like X forwarding, agent forwarding, etc..

    If you sometimes need to route through a different server, you can also specify these in the config file.

    Another method is to sign up with something like userify which works right off your rsa id.

    Credits: Czar Pino


 



Want 10% more hash from your rigs?



We promise to keep your email safe and never spam you.



Copyright (c) 2012-2019 Portable Instant Mining Platform LLC. All rights Reserved.