본문 바로가기
조회 수 3589 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print

http://reviews.cnet.com/8301-13727_7-57598167-263/how-to-encrypt-a-file-from-the-os-x-command-line/


If you would like to encrypt a file or two on your Mac to keep it secure, there are several options available to you. There are a number of third-party tools, such as GPGTools' GPG Suite, which offer encryption options for files (more details here), but Apple also offers built-in encryption support with disk images.

While securely wrapping files in disk images generally requires using Disk Utility, you can do so through the command line as well, which may be useful if you are accessing a system remotely through SSH, or scripting a routine where you would like to encrypt files.

To do this, you would simply need to run the following command in the Terminal:

hdiutil create -srcfolder SOURCEPATH -encryption AES-128 DESTINATIONDMG

The "hdiutil" command is Apple's included program for managing disk images, and in the syntax above, replacing SOURCEPATH with the path to the desired file or folder will include that file or folder in the encryption.


For example, if I have a folder called "privatefiles" in my Documents folder, I can encrypt it in a disk image called "encryptedimage.dmg" on my desktop by running the following command (all on one line):
The encryption scheme used in this example is AES-128, though you can also use AES-256 for a greater encryption level. The last component here is "DESTINATIONDMG," where you specify the full path to the final disk image file.

hdiutil create -srcfolder ~/Documents/privatefiles/ -encryption AES-128 ~/Desktop/encryptedimage.dmg

When run, the command will ask for a password to secure the disk image, and prompt for a confirmation. It will then create the disk image to be the exact size of the files being encrypted, so it will not take up unnecessary space. You can then delete the private files from your system, so they will only be in the disk image.




Title
List of Articles
번호 제목 글쓴이 날짜 조회 수
57 Tomcat start/stop scripts Hojung 2015.07.31 2237
56 Generate PDF with text file on OS X file Hojung 2015.07.30 1759
55 Install JDK7, Tomcat7 and MySQL on OS X file Hojung 2015.07.28 1681
54 Keyboard Symbol List Hojung 2015.07.02 1543
53 How to create a bootable USB stick from iso on OS X file Hojung 2014.12.14 1845
52 Mount volume read-only with Disk-Arbitrator file Hojung 2014.11.05 2180
51 How to check and fix drive in OS X from CLI (diskutil, fsck_hfs) file Hojung 2014.11.05 2599
50 FileVault 2 not working correctly in OS X VMs with VM disks set to Bus Type: SATA file Hojung 2014.11.05 1975
49 Create an encrypted archive file Hojung 2014.11.04 1768
48 Encrypt external hdd file Hojung 2014.11.04 1841
47 Finder 특정 디렉토리에서 디렉토리도 사이즈 보기 ('du -sh *' 와 동일) file Hojung 2014.11.04 2065
46 Don't delete files when copying file Hojung 2014.11.04 1838
45 안전하게 파일 삭제하기 (파일 완전삭제) file Hojung 2014.11.04 3520
44 editor에서 ^M가 나오는 문제 (unix - mac 호환성 문제시) Hojung 2014.11.04 1771
43 How to get file info (file, GetFileInfo, mdls, mdfind) Hojung 2014.11.04 1883
42 Create bootable USB stick from ISO in Mac OS X file Hojung 2014.09.07 3026
41 Create an OS X 10.9 Mavericks ISO file Hojung 2014.09.01 2906
40 Install command line RAR and UnRAR for Mac OS Hojung 2014.05.26 2830
» How to encrypt a file from the OS X command line Hojung 2014.03.03 3589
38 Going from MacPorts to Homebrew (how to remove macports) Hojung 2014.02.19 4614
Board Pagination ‹ Prev 1 2 3 Next ›
/ 3

Designed by sketchbooks.co.kr / sketchbook5 board skin

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5