ssh config depending on interactive mode

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











up vote
2
down vote

favorite












I've some rules in .ssh/config file which I would like activate only in interactive mode (ie. terminal background change). Is that possible?










share|improve this question

























    up vote
    2
    down vote

    favorite












    I've some rules in .ssh/config file which I would like activate only in interactive mode (ie. terminal background change). Is that possible?










    share|improve this question























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I've some rules in .ssh/config file which I would like activate only in interactive mode (ie. terminal background change). Is that possible?










      share|improve this question













      I've some rules in .ssh/config file which I would like activate only in interactive mode (ie. terminal background change). Is that possible?







      bash ssh configuration






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 hours ago









      ts01

      1501211




      1501211




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote













          You can alias ssh if using a non-interactive shell as follows in your ~/.bashrc file:



           if [ -z "$PS1" ]; then
          alias ssh='ssh -F ~/.ssh/config-non-interactive'
          fi


          ... then copy the non-interactive configuration you'd like to use to ~/.ssh/config-non-interactive and you should be set.






          share|improve this answer








          New contributor




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

















          • When this is combined with Include I think it will be a flexible way of utilising config files. superuser.com/a/1142813 . There were many times I gave up on certain config features because it wasn’t compatible across my workstations.
            – sdkks
            1 hour ago










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          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%2faskubuntu.com%2fquestions%2f1076915%2fssh-config-depending-on-interactive-mode%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          3
          down vote













          You can alias ssh if using a non-interactive shell as follows in your ~/.bashrc file:



           if [ -z "$PS1" ]; then
          alias ssh='ssh -F ~/.ssh/config-non-interactive'
          fi


          ... then copy the non-interactive configuration you'd like to use to ~/.ssh/config-non-interactive and you should be set.






          share|improve this answer








          New contributor




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

















          • When this is combined with Include I think it will be a flexible way of utilising config files. superuser.com/a/1142813 . There were many times I gave up on certain config features because it wasn’t compatible across my workstations.
            – sdkks
            1 hour ago














          up vote
          3
          down vote













          You can alias ssh if using a non-interactive shell as follows in your ~/.bashrc file:



           if [ -z "$PS1" ]; then
          alias ssh='ssh -F ~/.ssh/config-non-interactive'
          fi


          ... then copy the non-interactive configuration you'd like to use to ~/.ssh/config-non-interactive and you should be set.






          share|improve this answer








          New contributor




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

















          • When this is combined with Include I think it will be a flexible way of utilising config files. superuser.com/a/1142813 . There were many times I gave up on certain config features because it wasn’t compatible across my workstations.
            – sdkks
            1 hour ago












          up vote
          3
          down vote










          up vote
          3
          down vote









          You can alias ssh if using a non-interactive shell as follows in your ~/.bashrc file:



           if [ -z "$PS1" ]; then
          alias ssh='ssh -F ~/.ssh/config-non-interactive'
          fi


          ... then copy the non-interactive configuration you'd like to use to ~/.ssh/config-non-interactive and you should be set.






          share|improve this answer








          New contributor




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









          You can alias ssh if using a non-interactive shell as follows in your ~/.bashrc file:



           if [ -z "$PS1" ]; then
          alias ssh='ssh -F ~/.ssh/config-non-interactive'
          fi


          ... then copy the non-interactive configuration you'd like to use to ~/.ssh/config-non-interactive and you should be set.







          share|improve this answer








          New contributor




          Gray 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




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









          answered 1 hour ago









          Gray

          312




          312




          New contributor




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





          New contributor





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






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











          • When this is combined with Include I think it will be a flexible way of utilising config files. superuser.com/a/1142813 . There were many times I gave up on certain config features because it wasn’t compatible across my workstations.
            – sdkks
            1 hour ago
















          • When this is combined with Include I think it will be a flexible way of utilising config files. superuser.com/a/1142813 . There were many times I gave up on certain config features because it wasn’t compatible across my workstations.
            – sdkks
            1 hour ago















          When this is combined with Include I think it will be a flexible way of utilising config files. superuser.com/a/1142813 . There were many times I gave up on certain config features because it wasn’t compatible across my workstations.
          – sdkks
          1 hour ago




          When this is combined with Include I think it will be a flexible way of utilising config files. superuser.com/a/1142813 . There were many times I gave up on certain config features because it wasn’t compatible across my workstations.
          – sdkks
          1 hour ago

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1076915%2fssh-config-depending-on-interactive-mode%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          Long meetings (6-7 hours a day): Being “babysat” by supervisor

          What does second last employer means? [closed]

          One-line joke