How to use openconnect with username and password at a line in terminal?

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








up vote
0
down vote

favorite
1












I use openconnect in Ubuntu 16.04 terminally, when I want to enable it, I need to enter three phases that contain the:



  • "yes/no"

  • "username"

  • "password"

How can I bypass these phases by using openconnect at a line (e.g. using openconnect options)?

Is there any options for that such as following?



sudo openconnect <server-name> --user=<'username'> --pass=<'password'>


I used openconnect --help and found a way for username, but for password and ssl verification have problem yet.







share|improve this question

























    up vote
    0
    down vote

    favorite
    1












    I use openconnect in Ubuntu 16.04 terminally, when I want to enable it, I need to enter three phases that contain the:



    • "yes/no"

    • "username"

    • "password"

    How can I bypass these phases by using openconnect at a line (e.g. using openconnect options)?

    Is there any options for that such as following?



    sudo openconnect <server-name> --user=<'username'> --pass=<'password'>


    I used openconnect --help and found a way for username, but for password and ssl verification have problem yet.







    share|improve this question























      up vote
      0
      down vote

      favorite
      1









      up vote
      0
      down vote

      favorite
      1






      1





      I use openconnect in Ubuntu 16.04 terminally, when I want to enable it, I need to enter three phases that contain the:



      • "yes/no"

      • "username"

      • "password"

      How can I bypass these phases by using openconnect at a line (e.g. using openconnect options)?

      Is there any options for that such as following?



      sudo openconnect <server-name> --user=<'username'> --pass=<'password'>


      I used openconnect --help and found a way for username, but for password and ssl verification have problem yet.







      share|improve this question













      I use openconnect in Ubuntu 16.04 terminally, when I want to enable it, I need to enter three phases that contain the:



      • "yes/no"

      • "username"

      • "password"

      How can I bypass these phases by using openconnect at a line (e.g. using openconnect options)?

      Is there any options for that such as following?



      sudo openconnect <server-name> --user=<'username'> --pass=<'password'>


      I used openconnect --help and found a way for username, but for password and ssl verification have problem yet.









      share|improve this question












      share|improve this question




      share|improve this question








      edited Jul 20 at 8:44
























      asked Jun 2 at 19:43









      Benyamin Jafari

      17012




      17012




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          If you type man openconnect in a terminal you will get a manual page describing usage.



          Relevant sections:




          -u,--user=NAME

          Set login username to NAME



          --passwd-on-stdin

          Read password from standard input




          Additionally, you may need to disable certificate warnings:




          --no-cert-check

          Do not require server SSL certificate to be valid. Checks will still happen and failures will cause a warning message, but the connection will continue anyway. You should not need to use this option - if your servers have SSL certificates which are not signed by a trusted Certificate Authority, you can still add them (or your private CA) to a local file and use that file with the --cafile option.




          Or you could add the certificate to a file.



          All this can be combined:



          echo "password" | sudo openconnect server --user=username --passwd-on-stdin --no-cert-check





          share|improve this answer























          • Thanks, it works, but needed the sudo.
            – Benyamin Jafari
            Jun 2 at 20:55










          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%2f1043024%2fhow-to-use-openconnect-with-username-and-password-at-a-line-in-terminal%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
          1
          down vote



          accepted










          If you type man openconnect in a terminal you will get a manual page describing usage.



          Relevant sections:




          -u,--user=NAME

          Set login username to NAME



          --passwd-on-stdin

          Read password from standard input




          Additionally, you may need to disable certificate warnings:




          --no-cert-check

          Do not require server SSL certificate to be valid. Checks will still happen and failures will cause a warning message, but the connection will continue anyway. You should not need to use this option - if your servers have SSL certificates which are not signed by a trusted Certificate Authority, you can still add them (or your private CA) to a local file and use that file with the --cafile option.




          Or you could add the certificate to a file.



          All this can be combined:



          echo "password" | sudo openconnect server --user=username --passwd-on-stdin --no-cert-check





          share|improve this answer























          • Thanks, it works, but needed the sudo.
            – Benyamin Jafari
            Jun 2 at 20:55














          up vote
          1
          down vote



          accepted










          If you type man openconnect in a terminal you will get a manual page describing usage.



          Relevant sections:




          -u,--user=NAME

          Set login username to NAME



          --passwd-on-stdin

          Read password from standard input




          Additionally, you may need to disable certificate warnings:




          --no-cert-check

          Do not require server SSL certificate to be valid. Checks will still happen and failures will cause a warning message, but the connection will continue anyway. You should not need to use this option - if your servers have SSL certificates which are not signed by a trusted Certificate Authority, you can still add them (or your private CA) to a local file and use that file with the --cafile option.




          Or you could add the certificate to a file.



          All this can be combined:



          echo "password" | sudo openconnect server --user=username --passwd-on-stdin --no-cert-check





          share|improve this answer























          • Thanks, it works, but needed the sudo.
            – Benyamin Jafari
            Jun 2 at 20:55












          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          If you type man openconnect in a terminal you will get a manual page describing usage.



          Relevant sections:




          -u,--user=NAME

          Set login username to NAME



          --passwd-on-stdin

          Read password from standard input




          Additionally, you may need to disable certificate warnings:




          --no-cert-check

          Do not require server SSL certificate to be valid. Checks will still happen and failures will cause a warning message, but the connection will continue anyway. You should not need to use this option - if your servers have SSL certificates which are not signed by a trusted Certificate Authority, you can still add them (or your private CA) to a local file and use that file with the --cafile option.




          Or you could add the certificate to a file.



          All this can be combined:



          echo "password" | sudo openconnect server --user=username --passwd-on-stdin --no-cert-check





          share|improve this answer















          If you type man openconnect in a terminal you will get a manual page describing usage.



          Relevant sections:




          -u,--user=NAME

          Set login username to NAME



          --passwd-on-stdin

          Read password from standard input




          Additionally, you may need to disable certificate warnings:




          --no-cert-check

          Do not require server SSL certificate to be valid. Checks will still happen and failures will cause a warning message, but the connection will continue anyway. You should not need to use this option - if your servers have SSL certificates which are not signed by a trusted Certificate Authority, you can still add them (or your private CA) to a local file and use that file with the --cafile option.




          Or you could add the certificate to a file.



          All this can be combined:



          echo "password" | sudo openconnect server --user=username --passwd-on-stdin --no-cert-check






          share|improve this answer















          share|improve this answer



          share|improve this answer








          edited Jun 2 at 20:59









          Benyamin Jafari

          17012




          17012











          answered Jun 2 at 20:39









          vidarlo

          6,98042139




          6,98042139











          • Thanks, it works, but needed the sudo.
            – Benyamin Jafari
            Jun 2 at 20:55
















          • Thanks, it works, but needed the sudo.
            – Benyamin Jafari
            Jun 2 at 20:55















          Thanks, it works, but needed the sudo.
          – Benyamin Jafari
          Jun 2 at 20:55




          Thanks, it works, but needed the sudo.
          – Benyamin Jafari
          Jun 2 at 20:55












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1043024%2fhow-to-use-openconnect-with-username-and-password-at-a-line-in-terminal%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          pylint3 and pip3 broken

          Missing snmpget and snmpwalk

          How to enroll fingerprints to Ubuntu 17.10 with VFS491