Non-default location for ssh config file in Linux

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












How can I tell ssh to look for config file in a location other than the default one: ~/.ssh/config?










share|improve this question

























    up vote
    2
    down vote

    favorite












    How can I tell ssh to look for config file in a location other than the default one: ~/.ssh/config?










    share|improve this question























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      How can I tell ssh to look for config file in a location other than the default one: ~/.ssh/config?










      share|improve this question













      How can I tell ssh to look for config file in a location other than the default one: ~/.ssh/config?







      linux ssh






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked yesterday









      motam79

      1296




      1296




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted











          -F configfile



          Specifies an alternative per-user configuration file. If a configuration file is given on the command line, the system-wide configuration file (/etc/ssh/ssh_config) will be ignored. The default for the per-user configuration file is ~/.ssh/config.




          Source: https://linux.die.net/man/1/ssh






          share|improve this answer




















          • This works but every time I need to enter the config file path. Is it possible to store this option as default somewhere?
            – motam79
            yesterday










          • @motam79 quoting: "[...] the system-wide configuration file (/etc/ssh/ssh_config) will be ignored.". Without system-wide file, you can't store this anywhere. (This is my own assumption without any hard evidence and testing!)
            – Ismael Miguel
            yesterday











          • @motam79 If you're only starting ssh manually from the command line, you can make a shell alias. If you use other stuff (scripts, binaries, whatever) that look for ssh on the path, you could drop a wrapper script somewhere that has a higher priority than the real binary.
            – pt314
            yesterday

















          up vote
          3
          down vote













          As of OpenSSH 7.3p1, you can Include other config files in ssh_config.



          So, you could add to /etc/ssh/ssh_config:



          Include ~/custom_ssh.conf


          Don't think this will stop the default ~/.ssh/config from being loaded, however.






          share|improve this answer








          New contributor




          C. Furlani is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.

















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "3"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1357394%2fnon-default-location-for-ssh-config-file-in-linux%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            4
            down vote



            accepted











            -F configfile



            Specifies an alternative per-user configuration file. If a configuration file is given on the command line, the system-wide configuration file (/etc/ssh/ssh_config) will be ignored. The default for the per-user configuration file is ~/.ssh/config.




            Source: https://linux.die.net/man/1/ssh






            share|improve this answer




















            • This works but every time I need to enter the config file path. Is it possible to store this option as default somewhere?
              – motam79
              yesterday










            • @motam79 quoting: "[...] the system-wide configuration file (/etc/ssh/ssh_config) will be ignored.". Without system-wide file, you can't store this anywhere. (This is my own assumption without any hard evidence and testing!)
              – Ismael Miguel
              yesterday











            • @motam79 If you're only starting ssh manually from the command line, you can make a shell alias. If you use other stuff (scripts, binaries, whatever) that look for ssh on the path, you could drop a wrapper script somewhere that has a higher priority than the real binary.
              – pt314
              yesterday














            up vote
            4
            down vote



            accepted











            -F configfile



            Specifies an alternative per-user configuration file. If a configuration file is given on the command line, the system-wide configuration file (/etc/ssh/ssh_config) will be ignored. The default for the per-user configuration file is ~/.ssh/config.




            Source: https://linux.die.net/man/1/ssh






            share|improve this answer




















            • This works but every time I need to enter the config file path. Is it possible to store this option as default somewhere?
              – motam79
              yesterday










            • @motam79 quoting: "[...] the system-wide configuration file (/etc/ssh/ssh_config) will be ignored.". Without system-wide file, you can't store this anywhere. (This is my own assumption without any hard evidence and testing!)
              – Ismael Miguel
              yesterday











            • @motam79 If you're only starting ssh manually from the command line, you can make a shell alias. If you use other stuff (scripts, binaries, whatever) that look for ssh on the path, you could drop a wrapper script somewhere that has a higher priority than the real binary.
              – pt314
              yesterday












            up vote
            4
            down vote



            accepted







            up vote
            4
            down vote



            accepted







            -F configfile



            Specifies an alternative per-user configuration file. If a configuration file is given on the command line, the system-wide configuration file (/etc/ssh/ssh_config) will be ignored. The default for the per-user configuration file is ~/.ssh/config.




            Source: https://linux.die.net/man/1/ssh






            share|improve this answer













            -F configfile



            Specifies an alternative per-user configuration file. If a configuration file is given on the command line, the system-wide configuration file (/etc/ssh/ssh_config) will be ignored. The default for the per-user configuration file is ~/.ssh/config.




            Source: https://linux.die.net/man/1/ssh







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered yesterday









            Steven

            23k1074109




            23k1074109











            • This works but every time I need to enter the config file path. Is it possible to store this option as default somewhere?
              – motam79
              yesterday










            • @motam79 quoting: "[...] the system-wide configuration file (/etc/ssh/ssh_config) will be ignored.". Without system-wide file, you can't store this anywhere. (This is my own assumption without any hard evidence and testing!)
              – Ismael Miguel
              yesterday











            • @motam79 If you're only starting ssh manually from the command line, you can make a shell alias. If you use other stuff (scripts, binaries, whatever) that look for ssh on the path, you could drop a wrapper script somewhere that has a higher priority than the real binary.
              – pt314
              yesterday
















            • This works but every time I need to enter the config file path. Is it possible to store this option as default somewhere?
              – motam79
              yesterday










            • @motam79 quoting: "[...] the system-wide configuration file (/etc/ssh/ssh_config) will be ignored.". Without system-wide file, you can't store this anywhere. (This is my own assumption without any hard evidence and testing!)
              – Ismael Miguel
              yesterday











            • @motam79 If you're only starting ssh manually from the command line, you can make a shell alias. If you use other stuff (scripts, binaries, whatever) that look for ssh on the path, you could drop a wrapper script somewhere that has a higher priority than the real binary.
              – pt314
              yesterday















            This works but every time I need to enter the config file path. Is it possible to store this option as default somewhere?
            – motam79
            yesterday




            This works but every time I need to enter the config file path. Is it possible to store this option as default somewhere?
            – motam79
            yesterday












            @motam79 quoting: "[...] the system-wide configuration file (/etc/ssh/ssh_config) will be ignored.". Without system-wide file, you can't store this anywhere. (This is my own assumption without any hard evidence and testing!)
            – Ismael Miguel
            yesterday





            @motam79 quoting: "[...] the system-wide configuration file (/etc/ssh/ssh_config) will be ignored.". Without system-wide file, you can't store this anywhere. (This is my own assumption without any hard evidence and testing!)
            – Ismael Miguel
            yesterday













            @motam79 If you're only starting ssh manually from the command line, you can make a shell alias. If you use other stuff (scripts, binaries, whatever) that look for ssh on the path, you could drop a wrapper script somewhere that has a higher priority than the real binary.
            – pt314
            yesterday




            @motam79 If you're only starting ssh manually from the command line, you can make a shell alias. If you use other stuff (scripts, binaries, whatever) that look for ssh on the path, you could drop a wrapper script somewhere that has a higher priority than the real binary.
            – pt314
            yesterday












            up vote
            3
            down vote













            As of OpenSSH 7.3p1, you can Include other config files in ssh_config.



            So, you could add to /etc/ssh/ssh_config:



            Include ~/custom_ssh.conf


            Don't think this will stop the default ~/.ssh/config from being loaded, however.






            share|improve this answer








            New contributor




            C. Furlani is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





















              up vote
              3
              down vote













              As of OpenSSH 7.3p1, you can Include other config files in ssh_config.



              So, you could add to /etc/ssh/ssh_config:



              Include ~/custom_ssh.conf


              Don't think this will stop the default ~/.ssh/config from being loaded, however.






              share|improve this answer








              New contributor




              C. Furlani is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.



















                up vote
                3
                down vote










                up vote
                3
                down vote









                As of OpenSSH 7.3p1, you can Include other config files in ssh_config.



                So, you could add to /etc/ssh/ssh_config:



                Include ~/custom_ssh.conf


                Don't think this will stop the default ~/.ssh/config from being loaded, however.






                share|improve this answer








                New contributor




                C. Furlani is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                As of OpenSSH 7.3p1, you can Include other config files in ssh_config.



                So, you could add to /etc/ssh/ssh_config:



                Include ~/custom_ssh.conf


                Don't think this will stop the default ~/.ssh/config from being loaded, however.







                share|improve this answer








                New contributor




                C. Furlani is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                share|improve this answer



                share|improve this answer






                New contributor




                C. Furlani is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                answered yesterday









                C. Furlani

                311




                311




                New contributor




                C. Furlani is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





                New contributor





                C. Furlani is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






                C. Furlani is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1357394%2fnon-default-location-for-ssh-config-file-in-linux%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    What does second last employer means? [closed]

                    List of Gilmore Girls characters

                    Confectionery