{"id":1579,"date":"2006-02-24T23:22:00","date_gmt":"2006-02-24T23:22:00","guid":{"rendered":"http:\/\/gleamynode.net\/articles\/1579\/signing-files-recursively-using-gnupg"},"modified":"2022-12-28T01:47:45","modified_gmt":"2022-12-27T16:47:45","slug":"signing-files-recursively-using-gnupg","status":"publish","type":"post","link":"https:\/\/vault.motd.kr\/wordpress\/posts\/1579\/signing-files-recursively-using-gnupg\/","title":{"rendered":"Signing Files Recursively Using GnuPG"},"content":{"rendered":"
GnuPG<\/a> is a great privacy tool; it makes sure that the software distribution you deployed is identical with what you deployed originally. In the Apache Software Foundation<\/a>, committers have to sign all their distributions before they are mirrored to other servers such as Ibiblio.org<\/a> for security reasons. However, signing each file one by one takes too much time. There has to be an easier way, and I created a shell script which signs all files recursively in one shot.<\/p>\n GnuPG<\/a>\ub294 \ud6cc\ub96d\ud55c \ud504\ub77c\uc774\ubc84\uc2dc \ud234\uc785\ub2c8\ub2e4. \uc774\uac83\uc744 \uc0ac\uc6a9\ud558\uba74 \uc5c5\ub85c\ub4dc\ud55c \uc18c\ud504\ud2b8\uc6e8\uc5b4 \ubc30\ud3ec\ubcf8\uc774 \uc815\ub9d0 \uc5ec\ub7ec\ubd84\uc774 \ubc30\ud3ec\ud55c \uac83\uacfc \uc77c\uce58\ud558\ub294\uc9c0 \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc544\ud30c\uce58 \uc18c\ud504\ud2b8\uc6e8\uc5b4 \uc7ac\ub2e8<\/a>\uc5d0\uc11c\ub294 \ubcf4\uc548\uc0c1\uc758 \uc774\uc720\ub85c \uac1c\ubc1c\uc790\uac00 \ubaa8\ub4e0 \uc18c\ud504\ud2b8\uc6e8\uc5b4 \ubc30\ud3ec\ubcf8\uc5d0 \uc11c\uba85\ud558\uae30 \uc804\uae4c\uc9c0\ub294 Ibiblio.org<\/a>\uc640 \uac19\uc740 \ub2e4\ub978 \uc11c\ubc84\ub85c \ubbf8\ub7ec\ub9c1\uc774 \ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. \uadf8\ub7ec\ub098, \uac01\uac01\uc758 \ud30c\uc77c\uc744 \ud558\ub098 \ud558\ub098 \uc11c\uba85\ud558\ub294 \uac83\uc740 \uc2dc\uac04\uc774 \ub108\ubb34 \uc624\ub798 \uac78\ub9bd\ub2c8\ub2e4. \uc880 \ub354 \uc26c\uc6b4 \ubc29\ubc95\uc774 \uc788\uc5b4\uc57c \ud560 \uac83 \uac19\uc544\uc11c \ud55c \ubc29\uc5d0 \uc11c\ube0c\ub514\ub809\ud1a0\ub9ac\uc5d0 \uc788\ub294 \ubaa8\ub4e0 \ud30c\uc77c\uc744 \uc11c\uba85\ud558\ub294 \uc258 \uc2a4\ud06c\ub9bd\ud2b8\ub97c \uc791\uc131\ud588\uc2b5\ub2c8\ub2e4.<\/p>\n #!\/bin\/sh<\/p>\n DEFAULT_KEY=”john.doe@gmail.com”<\/p>\n echo -n “PGP Key Password: “ for FILE in $(find . -not ‘(‘ -name “*.md5\u2033 -or -name “*.sha1\u2033 -or -name “*.asc” ‘)’ -and -type f) ; do echo -n “Signing: $FILE … “<\/p>\n md5sum “$FILE” | cut “-d ” -f1 > “$FILE.md5\u2033 echo “$PASSWORD” | gpg –default-key “$DEFAULT_KEY” –detach-sign –armor –no-tty –yes –passphrase-fd 0 “$FILE” && echo done. GnuPG is a great privacy tool; it makes sure that the software distribution you deployed is identical with what you deployed originally. In the Apache Software Foundation, committers have to sign all their distributions before they are mirrored to other servers such as Ibiblio.org for security reasons. However, signing each file one by one takes… Continue reading
\nstty -echo
\nread PASSWORD
\nstty echo
\necho “”<\/p>\n
\n if [ -f “$FILE.asc” ]; then
\n echo “Skipping: $FILE”
\n continue
\n fi<\/p>\n
\n sha1sum “$FILE” | cut “-d ” -f1 > “$FILE.sha1\u2033<\/p>\n
\ndone\n<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"