11.Nas_1


새창 작성 수정 목록 링크 Edit G카랜다 HDD HDD HDD 게시물 주소 복사


★★★2 lets encrypt 인증서 acme.sh 시놀로지 자동 업데이트 만들기 ★★★

♨ 카랜더 일정 : 2024년06월29일
  • 링크

  • 첨부

  • 컨텐츠 정보

    본문

    ★★★2 lets encrypt 인증서 acme.sh 시놀로지 자동 업데이트 만들기 ★★★

    ★★★ lets encrypt 인증서 재설치 acme.sh 시놀로지 멀티 인증서 만들기 ★★★

    https://11q.kr/www/bbs/board.php?bo_table=s11&wr_id=12740

    이어

    자동 데이트 입니다



     주어진 명령어들을 매주 1회 자동으로 실행되도록 crontab을 설정하는 방법을 설명드리겠습니다.

    단계별 설명:

    1. 인증서 갱신 명령어:

      sh
      코드 복사
      /root/.acme.sh/./acme.sh --renew --dns --force -d 11q.kr -d *.11q.kr --yes-I-know-dns-manual-mode-enough-go-ahead-please --server letsencrypt
    2. 복사 명령어:

      sh
      코드 복사
      /bin/cp /root/.acme.sh/11q.kr_ecc/11q.kr.cer /usr/syno/etc/certificate/_archive/DcrTDg/cert.pem /bin/cp /root/.acme.sh/11q.kr_ecc/11q.kr.key /usr/syno/etc/certificate/_archive/DcrTDg/privkey.pem /bin/cp /root/.acme.sh/11q.kr_ecc/ca.cer /usr/syno/etc/certificate/_archive/DcrTDg/chain.pem /bin/cp /root/.acme.sh/11q.kr_ecc/fullchain.cer /usr/syno/etc/certificate/_archive/DcrTDg/fullchain.pem
    3. 스크립트 생성: 위 명령어들을 실행하는 스크립트를 만듭니다. 예를 들어, /root/renew_and_copy.sh 파일로 저장합니다:

      sh
      코드 복사
      #!/bin/bash # 인증서 갱신 /root/.acme.sh/./acme.sh --renew --dns --force -d 11q.kr -d *.11q.kr --yes-I-know-dns-manual-mode-enough-go-ahead-please --server letsencrypt # 갱신된 인증서 복사 /bin/cp /root/.acme.sh/11q.kr_ecc/11q.kr.cer /usr/syno/etc/certificate/_archive/DcrTDg/cert.pem /bin/cp /root/.acme.sh/11q.kr_ecc/11q.kr.key /usr/syno/etc/certificate/_archive/DcrTDg/privkey.pem /bin/cp /root/.acme.sh/11q.kr_ecc/ca.cer /usr/syno/etc/certificate/_archive/DcrTDg/chain.pem /bin/cp /root/.acme.sh/11q.kr_ecc/fullchain.cer /usr/syno/etc/certificate/_archive/DcrTDg/fullchain.pem

      스크립트를 실행 가능하게 만듭니다:

      sh
      코드 복사
      chmod +x /root/renew_and_copy.sh
    4. Crontab 항목 추가: 스크립트를 매주 1회 실행하도록 crontab에 항목을 추가합니다. crontab 편집기를 엽니다:

      sh
      코드 복사
      crontab -e

      매주 일요일 오전 2시에 스크립트를 실행하도록 다음 줄을 추가합니다:

      sh
      코드 복사
      0 2 * * 0 /root/renew_and_copy.sh

    전체 구현 과정:

    1. 스크립트 파일 생성:

      sh
      코드 복사
      nano /root/renew_and_copy.sh

      다음 내용을 붙여 넣습니다:

      sh
      코드 복사
      #!/bin/bash # 인증서 갱신 /root/.acme.sh/./acme.sh --renew --dns --force -d 11q.kr -d *.11q.kr --yes-I-know-dns-manual-mode-enough-go-ahead-please --server letsencrypt # 갱신된 인증서 복사 /bin/cp /root/.acme.sh/11q.kr_ecc/11q.kr.cer /usr/syno/etc/certificate/_archive/DcrTDg/cert.pem /bin/cp /root/.acme.sh/11q.kr_ecc/11q.kr.key /usr/syno/etc/certificate/_archive/DcrTDg/privkey.pem /bin/cp /root/.acme.sh/11q.kr_ecc/ca.cer /usr/syno/etc/certificate/_archive/DcrTDg/chain.pem /bin/cp /root/.acme.sh/11q.kr_ecc/fullchain.cer /usr/syno/etc/certificate/_archive/DcrTDg/fullchain.pem
    2. 스크립트 실행 가능하게 설정:

      sh
      코드 복사
      chmod +x /root/renew_and_copy.sh
    3. Crontab 편집:

      sh
      코드 복사
      crontab -e

      다음 줄 추가:

      sh
      코드 복사
      0 2 * * 0 /root/renew_and_copy.sh

    이렇게 설정하면 인증서가 매주 자동으로 갱신되고 지정된 디렉토리로 복사됩니다.


    자동 데이트

    3232235521_1719673289.633.png

    cat acme_renew_and_copy.sh 작성

    chmod a+x acme_renew_and_copy.sh

    nano  acme_renew_and_copy.sh

    #!/bin/bash
    # nano acme_renew_and_copy.sh 작성
    # acme.sh install
    #opkg update
    #opkg install nano
    #opkg install cron
    #/opt/etc/init.d/S10cron start
    #ln -s /opt/etc/init.d/S10cron /opt/etc/init.d/S99cron
    #export VISUAL=nano crontab -e
    # */5 * * * * echo "cron test: $(date)" >> /tmp/test.txt
    #cat /tmp/test.txt
    #wget -O - https://get.acme.sh | sh
    # txt 값생성
    #/root/.acme.sh/acme.sh --issue --dns --force -d 11q.kr -d *.11q.kr --yes-I-know-dns-manual-mode-enough-go-ahead-please --server letsencrypt
    # /root/.acme.sh/acme.sh --issue --dns --force -d 123q.me -d *.123q.me  --yes-I-know-dns-manual-mode-enough-go-ahead-please --server letsencrypt
    #ssh txt 적용 확인
    #nslookup
    #> set type=txt
    #> _acme-challenge.11q.kr
    # ===============================================
    # 인증서 생성 갱신
    /root/.acme.sh/./acme.sh --renew --dns --force -d 11q.kr -d *.11q.kr --yes-I-know-dns-manual-mode-enough-go-ahead-please --server letsencrypt
    /root/.acme.sh/./acme.sh --renew --dns --force -d 123q.me -d *.123q.me --yes-I-know-dns-manual-mode-enough-go-ahead-please --server letsencrypt
    # 인증서 위치
    #ls /usr/syno/etc/certificate/_archive/
    #기본인증서 확인
    #cat /usr/syno/etc/certificate/_archive/DEFAULT
     
    # 11q.kr 갱신된 인증서 복사 ============================================
    /bin/cp /root/.acme.sh/11q.kr_ecc/11q.kr.cer /usr/syno/etc/certificate/_archive/DcrTDg/cert.pem
    /bin/cp /root/.acme.sh/11q.kr_ecc/11q.kr.key /usr/syno/etc/certificate/_archive/DcrTDg/privkey.pem
    /bin/cp /root/.acme.sh/11q.kr_ecc/ca.cer /usr/syno/etc/certificate/_archive/DcrTDg/chain.pem
    /bin/cp /root/.acme.sh/11q.kr_ecc/fullchain.cer /usr/syno/etc/certificate/_archive/DcrTDg/fullchain.pem
    # 123q.me
    /bin/cp /root/.acme.sh/123q.me_ecc/123q.me.cer /usr/syno/etc/certificate/_archive/lrrp3f/cert.pem
    /bin/cp /root/.acme.sh/123q.me_ecc/123q.me.key /usr/syno/etc/certificate/_archive/lrrp3f/privkey.pem
    /bin/cp /root/.acme.sh/123q.me_ecc/ca.cer /usr/syno/etc/certificate/_archive/lrrp3f/chain.pem
    /bin/cp /root/.acme.sh/123q.me_ecc/fullchain.cer /usr/syno/etc/certificate/_archive/lrrp3f/fullchain.pem
    #crontab -e
    # 0 2 * * 0 /root/renew_and_copy.sh
    # end

    123Q.ME는 lrrp3f 로 설정 
    3232235521_1719674277.8497.png


    자동화 적용 > 자동 데이트

     crontab -e


    # (/tmp/crontab.XXXX8PaLqt installed on Sat Jun 29 17:56:01 2024)
    # (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
    # */5 * * * * echo "cron test: $(date)" >> /tmp/test.txt

    9 10 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" > /dev/null
    0 2 * * 0 /root/renew_and_copy.sh
    ============================================


    인증서 2일후 재발급  테스트
    3232235521_1719801596.1984.png

    3232235521_1719801547.7232.png

    자동 업데이트 확인 9/27
    3232235521_1719801328.4021.png
    123q 까지 

    2일후 생성 화인 > 9/27 ===> 9/29 로 변경


    3232235521_1719801226.5412.png

    3232235521_1719801922.7458.png

    ☞ https://11q.kr 에 등록된 자료 입니다. ♠ 정보찾아 공유 드리며 출처는 링크 참조 바랍니다♠1.png

    [ 추가 정보 ... 더보기) ]
    뷰PDF 1,2



    office view

    관련자료

    댓글목록

    profile_image

    11qkr님의 댓글

    11qkr 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 아이피 (192.♡.0.1) 작성일

    #!/bin/bash
    # nano acme_renew_and_copy.sh 작성
    # acme.sh install
    #opkg update
    #opkg install nano
    #opkg install cron
    #/opt/etc/init.d/S10cron start
    #ln -s /opt/etc/init.d/S10cron /opt/etc/init.d/S99cron
    #export VISUAL=nano crontab -e
    # */5 * * * * echo "cron test: $(date)" >> /tmp/test.txt
    #cat /tmp/test.txt
    #wget -O - https://get.acme.sh | sh
    # txt 값생성
    #/root/.acme.sh/acme.sh --issue --dns --force -d 11q.kr -d *.11q.kr --yes-I-know-dns-manual-mode-enough-go-ahead-please --server letsencrypt
    # /root/.acme.sh/acme.sh --issue --dns --force -d 123q.me -d *.123q.me  --yes-I-know-dns-manual-mode-enough-go-ahead-please --server letsencrypt
    #ssh txt 적용 확인
    #nslookup
    #> set type=txt
    #> _acme-challenge.11q.kr
    # ===============================================
    # 인증서 생성 갱신
    /root/.acme.sh/./acme.sh --renew --dns --force -d 11q.kr -d *.11q.kr --yes-I-know-dns-manual-mode-enough-go-ahead-please --server letsencrypt
    /root/.acme.sh/./acme.sh --renew --dns --force -d 123q.me -d *.123q.me --yes-I-know-dns-manual-mode-enough-go-ahead-please --server letsencrypt
    # 인증서 위치
    #ls /usr/syno/etc/certificate/_archive/
    #기본인증서 확인
    #cat /usr/syno/etc/certificate/_archive/DEFAULT
     
    # 11q.kr 갱신된 인증서 복사 ============================================
    /bin/cp /root/.acme.sh/11q.kr_ecc/11q.kr.cer /usr/syno/etc/certificate/_archive/DcrTDg/cert.pem
    /bin/cp /root/.acme.sh/11q.kr_ecc/11q.kr.key /usr/syno/etc/certificate/_archive/DcrTDg/privkey.pem
    /bin/cp /root/.acme.sh/11q.kr_ecc/ca.cer /usr/syno/etc/certificate/_archive/DcrTDg/chain.pem
    /bin/cp /root/.acme.sh/11q.kr_ecc/fullchain.cer /usr/syno/etc/certificate/_archive/DcrTDg/fullchain.pem
    # 123q.me
    /bin/cp /root/.acme.sh/123q.me_ecc/123q.me.cer /usr/syno/etc/certificate/_archive/lrrp3f/cert.pem
    /bin/cp /root/.acme.sh/123q.me_ecc/123q.me.key /usr/syno/etc/certificate/_archive/lrrp3f/privkey.pem
    /bin/cp /root/.acme.sh/123q.me_ecc/ca.cer /usr/syno/etc/certificate/_archive/lrrp3f/chain.pem
    /bin/cp /root/.acme.sh/123q.me_ecc/fullchain.cer /usr/syno/etc/certificate/_archive/lrrp3f/fullchain.pem
    # 자동업데이트
    # crontab -e
    # 0 2 * * 0 /root/renew_and_copy.sh
    # end

    profile_image

    11qkr님의 댓글

    11qkr 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 아이피 (192.♡.0.1) 작성일

    # 인증서 생성 갱신
    /root/.acme.sh/./acme.sh --renew --dns --force -d 11q.kr -d *.11q.kr --yes-I-know-dns-manual-mode-enough-go-ahead-please --server letsencrypt
    /root/.acme.sh/./acme.sh --renew --dns --force -d 123q.me -d *.123q.me --yes-I-know-dns-manual-mode-enough-go-ahead-please --server letsencrypt
    # 인증서 위치
    #ls /usr/syno/etc/certificate/_archive/
    #기본인증서 확인
    #cat /usr/syno/etc/certificate/_archive/DEFAULT
     
    # 11q.kr 갱신된 인증서 복사 ============================================
    /bin/cp /root/.acme.sh/11q.kr_ecc/11q.kr.cer /usr/syno/etc/certificate/_archive/DcrTDg/cert.pem
    /bin/cp /root/.acme.sh/11q.kr_ecc/11q.kr.key /usr/syno/etc/certificate/_archive/DcrTDg/privkey.pem
    /bin/cp /root/.acme.sh/11q.kr_ecc/ca.cer /usr/syno/etc/certificate/_archive/DcrTDg/chain.pem
    /bin/cp /root/.acme.sh/11q.kr_ecc/fullchain.cer /usr/syno/etc/certificate/_archive/DcrTDg/fullchain.pem
    # 123q.me
    /bin/cp /root/.acme.sh/123q.me_ecc/123q.me.cer /usr/syno/etc/certificate/_archive/lrrp3f/cert.pem
    /bin/cp /root/.acme.sh/123q.me_ecc/123q.me.key /usr/syno/etc/certificate/_archive/lrrp3f/privkey.pem
    /bin/cp /root/.acme.sh/123q.me_ecc/ca.cer /usr/syno/etc/certificate/_archive/lrrp3f/chain.pem
    /bin/cp /root/.acme.sh/123q.me_ecc/fullchain.cer /usr/syno/etc/certificate/_archive/lrrp3f/fullchain.pem
    #crontab -e
    # 0 2 * * 0 /root/renew_and_copy.sh
    # end

    profile_image

    11qkr님의 댓글

    11qkr 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 아이피 (192.♡.0.1) 작성일
    profile_image

    11qkr님의 댓글

    11qkr 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 아이피 (192.♡.0.1) 작성일
    목록

    새창 작성 수정 목록 링크 Edit G카랜다 HDD HDD HDD 게시물 주소 복사




    Total 388 / 4 Page
    [ ● 동기화 Syncthing를 시놀로지 도커에서 설치 pc 핸드폰 폴더 공유하기 ] 댓글 2

    ● 동기화Syncthing를 시놀로지도커에서 설치 pc 핸드폰 photo 폴더 공유하기Syncthing은 기존의 사유(私有) 동기화 / 클라우드…

    [ ● 시놀로지 포토스테이션 사진 폴더 DSM7 photo에 사진 초기 설정 추가 하기 ]

    ● 시놀로지 포토스테이션 사진 폴더 DSM7 photo에 사진 초기 설정 추가 하기dsm7에서 사진 관리 방법을 정리 합니다 기본 초기 설치후 …

    [ ● 듀얼랜 활용법 참고자료 활용 테스트(저의 esxi 서버에서는 효과가 없다) ]

    ●듀얼랜 활용법 참고자료 활용 테스트1차 설정저의 esxi 서버에서는 효과가 없다입니다2차 점검esxi 서버의 랜설정 다른 카드이름으로 필요처음…

    [ ● DSM 7.1 Active Backup for Business 패키지설치 activated 활성화 작… ] 댓글 3

    ● DSM 7.1 Active Backup for Business 패키지설치 activated 활성화1) 패키지 설치 2) 실행열기히면 시놀로지…

    [ ● 트랜스코딩 활성화하는방법 >> ds3622xs+ dsm 7.1.1 성공 ] 댓글 3

    ●트랜스코딩 활성화하는방법 >> ds3622xs+ dsm 7.1.1 성공 https://svrforum.com/nas/91602참조 …

    [ v26★★★ dsm7.1만능 부트로더 Ver 0.4.6 버전과 tr_st.sh 업데이트)tinycore_re… ] 댓글 82

    ● 만능 부트로더Ver 0.4.6.0 버전업)tinycore_redpill_v046_by_11qkr_v22 구성파일자료 이동합니다https://…

    [ ● 최적의 Esxi 7.0.2 서버에서 redpill tinycore boot loader 생성 설치 방법 … ] 댓글 1

    ● 최적의 Esxi 7.0.2 서버에서 redpill tinycore boot loader 생성 방법 정리 기존 사용주인 서버에 Test 서버 …

    [ ● 시놀로지 usb/esata 저장소 내부저장소로 인식시키기 작업 ] 댓글 2

    ●시놀로지 usb/esata 저장소 내부저장소로 인식시키기 작업,,,,,정보 ,,,,,,,,,,,,https://www.2cpu.co.kr/na…

    [ ● xpenology cpu information 정상적인 정보로 수정하기 및 cpu 사용량 정보 ] 댓글 1

    ● xpenology cpu information 정상적인 정보로 수정하기 및저의 11q.kr 시놀로지 서버 cpu 사용량 입니다.https:/…

    [ ● 영상정보) 시놀로지 도커에 plex 설치방법 ]

    ● 영상정보) 시놀로지 도커에 plex 설치방법How to Install Plex on a Synology NAS using Docker ☞ht…

    [ 추천● 작업성공[Docker추천-14] GPS위치 추적 traccar서버 사용방법및 ] 댓글 10

    ● 작업)[Docker추천-14] GPS위치 추적traccar서버 사용방법및 트래커 이동경로보고서 마커표시 이동경로 확인하기 무료위치추적. 구글…

    [ ★ Portainer 설치 및 설정 (Docker Web UI 관리툴) Docker를 사용하여 Portain… ] 댓글 3

    Docker를 사용하여 Portainer 설치 실행 설정 작업https://siane.tistory.com/296기존 돌아다니는 설명글은 por…

    [ ● 시놀로지 알림 설정으로 이밴트 카톡으로 받기 지메일/카카오메일 설정하기 ]

    ● 시놀로지 알림 설정으로 이밴트 카톡으로 받기 (1) 이밴트에 지메일 설정 > 이메일 수신 테스트 설정입니다(2) 구글 이메일 2단계 인…

    [ ● 시놀로지 dsm 7.0에서 그누보드 5.4.5.5 초기 그누보드 설치 gd 라이브러리 설정 ] 댓글 2

    ● 시놀로지 dsm 7.0에서그누보드 5.4.5.12 초기 그누보드 설치 gd 라이브러리 설정 그누보드 설치조건 : 다른 시스템에서 2번째 설치…

    [ ● Proxmox ( PVE) 기본 설치는 간단한 설치 과정 사진 및 시놀로지 설치 메뉴얼 영상 정보 ] 댓글 13

    ●Proxmox ( PVE) 기본 설치는 간단한 설치 과정 사진처음 부타 다시 설치 스샷 합니다다운로드https://www.proxmox.com…


    ♥간단_메모글♥


    최근글


    새댓글



    PHP 안에 HTML ☞ 홈페이지 화면갱신 시간은 ♨
    ▶ 2024-07-02 12:55:53

    오늘의 홈 현황


    • 현재 접속자♨ 654 명
    • 오늘 가입자※ 0 명
    • 어제 가입자※ 2 명
    • 주간 가입자※ 13 명
    • 오늘 방문자 1,541 명
    • 어제 방문자 2,079 명
    • 최대 방문자 13,042 명
    • 전체 방문자 4,408,670 명
    • 전체 게시물※ 8,672 개
    • 전체 댓글수※ 24,813 개
    • 전체 회원수 11,079 명

    QR코드


    ☞ QR코드 스캔은 kakao앱 자체 QR코드

    알림 0








    최신글↑