gpg does not ask for password

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











up vote
5
down vote

favorite












I encrypted one file with gpg -c <file> and closed the terminal. After a while, I tried to decrypt it with gpg <file> and it decrypted it, without asking for a password. Is that normal? How to guarantee that gpg will ask for a password, even in my same computer?










share|improve this question





















  • How long was it since you last entered you GnuPG password at that point? The gpg-agent caches it for 10 minutes by default (GnuPG 2.2).
    – Kusalananda
    Oct 3 '17 at 15:37










  • Was gpg-agent running? If so it would have cached the credentials (just tested this on my Mac with gpg-agent in memory).
    – Petro
    Oct 3 '17 at 15:49














up vote
5
down vote

favorite












I encrypted one file with gpg -c <file> and closed the terminal. After a while, I tried to decrypt it with gpg <file> and it decrypted it, without asking for a password. Is that normal? How to guarantee that gpg will ask for a password, even in my same computer?










share|improve this question





















  • How long was it since you last entered you GnuPG password at that point? The gpg-agent caches it for 10 minutes by default (GnuPG 2.2).
    – Kusalananda
    Oct 3 '17 at 15:37










  • Was gpg-agent running? If so it would have cached the credentials (just tested this on my Mac with gpg-agent in memory).
    – Petro
    Oct 3 '17 at 15:49












up vote
5
down vote

favorite









up vote
5
down vote

favorite











I encrypted one file with gpg -c <file> and closed the terminal. After a while, I tried to decrypt it with gpg <file> and it decrypted it, without asking for a password. Is that normal? How to guarantee that gpg will ask for a password, even in my same computer?










share|improve this question













I encrypted one file with gpg -c <file> and closed the terminal. After a while, I tried to decrypt it with gpg <file> and it decrypted it, without asking for a password. Is that normal? How to guarantee that gpg will ask for a password, even in my same computer?







gpg






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 3 '17 at 15:31









Pierre B

5382522




5382522











  • How long was it since you last entered you GnuPG password at that point? The gpg-agent caches it for 10 minutes by default (GnuPG 2.2).
    – Kusalananda
    Oct 3 '17 at 15:37










  • Was gpg-agent running? If so it would have cached the credentials (just tested this on my Mac with gpg-agent in memory).
    – Petro
    Oct 3 '17 at 15:49
















  • How long was it since you last entered you GnuPG password at that point? The gpg-agent caches it for 10 minutes by default (GnuPG 2.2).
    – Kusalananda
    Oct 3 '17 at 15:37










  • Was gpg-agent running? If so it would have cached the credentials (just tested this on my Mac with gpg-agent in memory).
    – Petro
    Oct 3 '17 at 15:49















How long was it since you last entered you GnuPG password at that point? The gpg-agent caches it for 10 minutes by default (GnuPG 2.2).
– Kusalananda
Oct 3 '17 at 15:37




How long was it since you last entered you GnuPG password at that point? The gpg-agent caches it for 10 minutes by default (GnuPG 2.2).
– Kusalananda
Oct 3 '17 at 15:37












Was gpg-agent running? If so it would have cached the credentials (just tested this on my Mac with gpg-agent in memory).
– Petro
Oct 3 '17 at 15:49




Was gpg-agent running? If so it would have cached the credentials (just tested this on my Mac with gpg-agent in memory).
– Petro
Oct 3 '17 at 15:49










2 Answers
2






active

oldest

votes

















up vote
5
down vote













This is normal, gpg now uses gpg-agent to manage private keys, and the agent caches keys for a certain amount of time (up to two hours by default, with a ten minute inactivity timeout).



To change the defaults, create or edit a file named ~/.gnupg/gpg-agent.conf, and use the following entries:




  • default-cache-ttl specifies the amount of time a cache entry is kept after its last use, in seconds (600 by default);


  • max-cache-ttl specifies the maximum amount of time a cache entry is kept, in seconds (7200 by default).

After changing these, you’ll need to reload the configuration (try sending SIGHUP to gpg-agent, or killing it outright).






share|improve this answer



























    up vote
    0
    down vote













    Is your private key tied to a password? This is something you set at key creation time.



    If not, GPG won't ask for a password, as none is required. It will simply rely on the key you provide.



    And if so, should you have entered your password during another operation right before, GPG will not ask for this password again until a few minutes have passed.






    share|improve this answer






















      Your Answer







      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "106"
      ;
      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: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      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%2funix.stackexchange.com%2fquestions%2f395875%2fgpg-does-not-ask-for-password%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
      5
      down vote













      This is normal, gpg now uses gpg-agent to manage private keys, and the agent caches keys for a certain amount of time (up to two hours by default, with a ten minute inactivity timeout).



      To change the defaults, create or edit a file named ~/.gnupg/gpg-agent.conf, and use the following entries:




      • default-cache-ttl specifies the amount of time a cache entry is kept after its last use, in seconds (600 by default);


      • max-cache-ttl specifies the maximum amount of time a cache entry is kept, in seconds (7200 by default).

      After changing these, you’ll need to reload the configuration (try sending SIGHUP to gpg-agent, or killing it outright).






      share|improve this answer
























        up vote
        5
        down vote













        This is normal, gpg now uses gpg-agent to manage private keys, and the agent caches keys for a certain amount of time (up to two hours by default, with a ten minute inactivity timeout).



        To change the defaults, create or edit a file named ~/.gnupg/gpg-agent.conf, and use the following entries:




        • default-cache-ttl specifies the amount of time a cache entry is kept after its last use, in seconds (600 by default);


        • max-cache-ttl specifies the maximum amount of time a cache entry is kept, in seconds (7200 by default).

        After changing these, you’ll need to reload the configuration (try sending SIGHUP to gpg-agent, or killing it outright).






        share|improve this answer






















          up vote
          5
          down vote










          up vote
          5
          down vote









          This is normal, gpg now uses gpg-agent to manage private keys, and the agent caches keys for a certain amount of time (up to two hours by default, with a ten minute inactivity timeout).



          To change the defaults, create or edit a file named ~/.gnupg/gpg-agent.conf, and use the following entries:




          • default-cache-ttl specifies the amount of time a cache entry is kept after its last use, in seconds (600 by default);


          • max-cache-ttl specifies the maximum amount of time a cache entry is kept, in seconds (7200 by default).

          After changing these, you’ll need to reload the configuration (try sending SIGHUP to gpg-agent, or killing it outright).






          share|improve this answer












          This is normal, gpg now uses gpg-agent to manage private keys, and the agent caches keys for a certain amount of time (up to two hours by default, with a ten minute inactivity timeout).



          To change the defaults, create or edit a file named ~/.gnupg/gpg-agent.conf, and use the following entries:




          • default-cache-ttl specifies the amount of time a cache entry is kept after its last use, in seconds (600 by default);


          • max-cache-ttl specifies the maximum amount of time a cache entry is kept, in seconds (7200 by default).

          After changing these, you’ll need to reload the configuration (try sending SIGHUP to gpg-agent, or killing it outright).







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Oct 3 '17 at 15:37









          Stephen Kitt

          145k22317382




          145k22317382






















              up vote
              0
              down vote













              Is your private key tied to a password? This is something you set at key creation time.



              If not, GPG won't ask for a password, as none is required. It will simply rely on the key you provide.



              And if so, should you have entered your password during another operation right before, GPG will not ask for this password again until a few minutes have passed.






              share|improve this answer


























                up vote
                0
                down vote













                Is your private key tied to a password? This is something you set at key creation time.



                If not, GPG won't ask for a password, as none is required. It will simply rely on the key you provide.



                And if so, should you have entered your password during another operation right before, GPG will not ask for this password again until a few minutes have passed.






                share|improve this answer
























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  Is your private key tied to a password? This is something you set at key creation time.



                  If not, GPG won't ask for a password, as none is required. It will simply rely on the key you provide.



                  And if so, should you have entered your password during another operation right before, GPG will not ask for this password again until a few minutes have passed.






                  share|improve this answer














                  Is your private key tied to a password? This is something you set at key creation time.



                  If not, GPG won't ask for a password, as none is required. It will simply rely on the key you provide.



                  And if so, should you have entered your password during another operation right before, GPG will not ask for this password again until a few minutes have passed.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Oct 3 '17 at 16:32









                  Faheem Mitha

                  22.2k1676133




                  22.2k1676133










                  answered Oct 3 '17 at 15:37









                  Shlublu

                  1737




                  1737



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f395875%2fgpg-does-not-ask-for-password%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

                      Peggy Mitchell

                      Palaiologos

                      The Forum (Inglewood, California)