{"id":2928,"date":"2019-03-14T18:53:41","date_gmt":"2019-03-14T15:53:41","guid":{"rendered":"https:\/\/sysdba.org\/?p=2928"},"modified":"2019-03-14T18:53:41","modified_gmt":"2019-03-14T15:53:41","slug":"encrypted-partition-2","status":"publish","type":"post","link":"https:\/\/sysdba.org\/en\/encrypted-partition-2\/","title":{"rendered":"Encrypted Partition"},"content":{"rendered":"<p>Encrypted Partition<br \/>\nCreate a partition using fdisk \/dev\/sdb.<br \/>\nFirst check to see if &#8220;dm_crypt&#8221; has been installed, install if it hasn&#8217;t.<br \/>\n[crayon]lsmod |grep dm_crypt<br \/>\nmodprobe dm_crypt[\/crayon]<br \/>\nIf it hasn&#8217;t been loaded<br \/>\n[crayon]yum install cryptsetup-luks[\/crayon]<\/p>\n<p>[crayon]cryptsetup luksFormat \/dev\/sdb1 # Enter YES (uppercase) when prompted and enter the passphrase<br \/>\ncryptsetup luksOpen \/dev\/sdb1 encdisk # enter a name for the encdisk<br \/>\nmkfs.ext4 \/dev\/mapper\/encdisk[\/crayon]<\/p>\n<p>[crayon]mkdir \/data<br \/>\nmount \/dev\/mapper\/encdisk \/data\/[\/crayon]<br \/>\nTo check:<br \/>\n[crayon]df -h<br \/>\nmount[\/crayon]<br \/>\nThe line to be entered into \/etc\/fstab<br \/>\n[crayon]\/dev\/mapper\/encdisk \/data ext4 defaults 0 0[\/crayon]<br \/>\nTo check:<br \/>\n[crayon]umount \/data<br \/>\nmount -a[\/crayon]<br \/>\nLine to be entered into \/etc\/crypttab<br \/>\n[crayon]encdisk \/dev\/sdb1[\/crayon]<br \/>\nWhen the OS loads it prompts for a password, for it to prompt for a password it needs a keyfile, which can be created as shown here:<br \/>\n[crayon]touch \/etc\/keyfile<br \/>\nchmod 0400 \/etc\/keyfile<br \/>\ncryptsetup luksAddKey \/dev\/mapper\/VG_sda1-LV00 \/etc\/keyfile[\/crayon]<br \/>\n\/etc\/crypttab<br \/>\n[crayon]cryptsetup luksAddKey \/dev\/mapper\/VG_sda1-LV00 \/etc\/keyfile[\/crayon]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Encrypted Partition<\/p>\n","protected":false},"author":1,"featured_media":3554,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[358],"tags":[119],"class_list":["post-2928","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-linux"],"_links":{"self":[{"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/posts\/2928","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/comments?post=2928"}],"version-history":[{"count":0,"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/posts\/2928\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sysdba.org\/en\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/media?parent=2928"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/categories?post=2928"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/tags?post=2928"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}