qcow2의 encryption 사용해 보기

- qcow/qcow2는 Encryption 지원

1. Create an encrypted disk (empty password)
- $ qemu-img create -o encryption -f qcow2 image.qcow2 10G

2. "set a password" or "convert an encrypted qcow2"
- $ qemu-img convert -o encryption -O qcow2 image.qcow2 encrypted.qcow2

3. Determine if you qcow image is encrypted
- $ qemu-img info encrypted.qcow2

4. Using the images
- rootfs를 암호화 해서 부팅해 보면 
- Step1: Ctrl-Alt-2 to access the qemu monitor.
- Step2: (qemu monitor) cont [입력]
- Step3: password 입력
- Step4: 다시 화면으로 돌아오기 위해 Ctrl-Alt-1
5. 미리 입력된 password로 부팅 시키기
- 위의 4번과 같이 password를 monitor 세션에서 주는 방식이 아니라 
임시로 qemu 소스를 수정해서 password를 미리 주려면 어떻게?
- block/qcow2.c 파일의 qcow2_open 함수에서 bdrv_set_key로 미리 password 전달되도록 수정
- if (s->crypt_method_header) {
- bs->encrypted = 1;
- bdrv_set_key(bs, "testpwd"); // 추가된 라인
- }

댓글

이 블로그의 인기 게시물

SSH 연결 Delay 해결

[ELK] search guard를 이용한 보안 설정 (사용자 권한)

공공데이터(openapi) 사용법 (특정 정류소, 버스의 남은 좌석 확인 하기)