How can I encrypt a folder in linux using only the command line?












3















I need to encrypt a folder with documents (about 560kb if that makes any difference) and I was wondering whether it was possible to accomplish that using the command line?



I am searching for something like this:



encrypt /path/to/folder encryption_method password


than can be decrypted the same way



decrypt /path/to/folder encryption_method password









share|improve this question
















bumped to the homepage by Community 35 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • What counts as "unnecessary software"? The software to encrypt and decrypt would probably be necessary for this sort of problem, right?

    – Eric Renouf
    Nov 20 '16 at 12:31











  • I was referring to bloat-ware and it would be preferable to use the software that is pre-installed if there are any. Sorry if that was unclear. I will edit the question and remove that part completely.

    – Clone
    Nov 20 '16 at 12:36








  • 1





    Have a look at encfsto have directories encrypted and used as filesystem to mount, even automatically with libpam-encfs.

    – ridgy
    Nov 20 '16 at 12:54
















3















I need to encrypt a folder with documents (about 560kb if that makes any difference) and I was wondering whether it was possible to accomplish that using the command line?



I am searching for something like this:



encrypt /path/to/folder encryption_method password


than can be decrypted the same way



decrypt /path/to/folder encryption_method password









share|improve this question
















bumped to the homepage by Community 35 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • What counts as "unnecessary software"? The software to encrypt and decrypt would probably be necessary for this sort of problem, right?

    – Eric Renouf
    Nov 20 '16 at 12:31











  • I was referring to bloat-ware and it would be preferable to use the software that is pre-installed if there are any. Sorry if that was unclear. I will edit the question and remove that part completely.

    – Clone
    Nov 20 '16 at 12:36








  • 1





    Have a look at encfsto have directories encrypted and used as filesystem to mount, even automatically with libpam-encfs.

    – ridgy
    Nov 20 '16 at 12:54














3












3








3








I need to encrypt a folder with documents (about 560kb if that makes any difference) and I was wondering whether it was possible to accomplish that using the command line?



I am searching for something like this:



encrypt /path/to/folder encryption_method password


than can be decrypted the same way



decrypt /path/to/folder encryption_method password









share|improve this question
















I need to encrypt a folder with documents (about 560kb if that makes any difference) and I was wondering whether it was possible to accomplish that using the command line?



I am searching for something like this:



encrypt /path/to/folder encryption_method password


than can be decrypted the same way



decrypt /path/to/folder encryption_method password






linux kali-linux encryption






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 '16 at 12:38







Clone

















asked Nov 20 '16 at 12:21









CloneClone

1183




1183





bumped to the homepage by Community 35 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 35 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • What counts as "unnecessary software"? The software to encrypt and decrypt would probably be necessary for this sort of problem, right?

    – Eric Renouf
    Nov 20 '16 at 12:31











  • I was referring to bloat-ware and it would be preferable to use the software that is pre-installed if there are any. Sorry if that was unclear. I will edit the question and remove that part completely.

    – Clone
    Nov 20 '16 at 12:36








  • 1





    Have a look at encfsto have directories encrypted and used as filesystem to mount, even automatically with libpam-encfs.

    – ridgy
    Nov 20 '16 at 12:54



















  • What counts as "unnecessary software"? The software to encrypt and decrypt would probably be necessary for this sort of problem, right?

    – Eric Renouf
    Nov 20 '16 at 12:31











  • I was referring to bloat-ware and it would be preferable to use the software that is pre-installed if there are any. Sorry if that was unclear. I will edit the question and remove that part completely.

    – Clone
    Nov 20 '16 at 12:36








  • 1





    Have a look at encfsto have directories encrypted and used as filesystem to mount, even automatically with libpam-encfs.

    – ridgy
    Nov 20 '16 at 12:54

















What counts as "unnecessary software"? The software to encrypt and decrypt would probably be necessary for this sort of problem, right?

– Eric Renouf
Nov 20 '16 at 12:31





What counts as "unnecessary software"? The software to encrypt and decrypt would probably be necessary for this sort of problem, right?

– Eric Renouf
Nov 20 '16 at 12:31













I was referring to bloat-ware and it would be preferable to use the software that is pre-installed if there are any. Sorry if that was unclear. I will edit the question and remove that part completely.

– Clone
Nov 20 '16 at 12:36







I was referring to bloat-ware and it would be preferable to use the software that is pre-installed if there are any. Sorry if that was unclear. I will edit the question and remove that part completely.

– Clone
Nov 20 '16 at 12:36






1




1





Have a look at encfsto have directories encrypted and used as filesystem to mount, even automatically with libpam-encfs.

– ridgy
Nov 20 '16 at 12:54





Have a look at encfsto have directories encrypted and used as filesystem to mount, even automatically with libpam-encfs.

– ridgy
Nov 20 '16 at 12:54










2 Answers
2






active

oldest

votes


















0














You are looking for dm-crypt and cryptsetup.



Basically you encrypt a block device and mount it as directory






share|improve this answer

































    0














    You are looking for encfs: It mounts a dir on another dir, so that the files are stored encrypted as normal files. This way you do not need to make a block device.






    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',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      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%2f324687%2fhow-can-i-encrypt-a-folder-in-linux-using-only-the-command-line%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      You are looking for dm-crypt and cryptsetup.



      Basically you encrypt a block device and mount it as directory






      share|improve this answer






























        0














        You are looking for dm-crypt and cryptsetup.



        Basically you encrypt a block device and mount it as directory






        share|improve this answer




























          0












          0








          0







          You are looking for dm-crypt and cryptsetup.



          Basically you encrypt a block device and mount it as directory






          share|improve this answer















          You are looking for dm-crypt and cryptsetup.



          Basically you encrypt a block device and mount it as directory







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 20 '16 at 12:54









          Rui F Ribeiro

          41.5k1482140




          41.5k1482140










          answered Nov 20 '16 at 12:43









          NilsNils

          12.7k73670




          12.7k73670

























              0














              You are looking for encfs: It mounts a dir on another dir, so that the files are stored encrypted as normal files. This way you do not need to make a block device.






              share|improve this answer




























                0














                You are looking for encfs: It mounts a dir on another dir, so that the files are stored encrypted as normal files. This way you do not need to make a block device.






                share|improve this answer


























                  0












                  0








                  0







                  You are looking for encfs: It mounts a dir on another dir, so that the files are stored encrypted as normal files. This way you do not need to make a block device.






                  share|improve this answer













                  You are looking for encfs: It mounts a dir on another dir, so that the files are stored encrypted as normal files. This way you do not need to make a block device.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 20 '16 at 13:56









                  Ole TangeOle Tange

                  12.7k1455107




                  12.7k1455107






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f324687%2fhow-can-i-encrypt-a-folder-in-linux-using-only-the-command-line%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Loup dans la culture

                      How to solve the problem of ntp “Unable to contact time server” from KDE?

                      ASUS Zenbook UX433/UX333 — Configure Touchpad-embedded numpad on Linux