<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>伺服器 &#8211; 記下來</title>
	<atom:link href="https://noter.tw/server/feed/" rel="self" type="application/rss+xml" />
	<link>https://noter.tw</link>
	<description>一路上踩到的坑、遇到的問題，一點一滴記下來，希望能幫助到需要的人~</description>
	<lastBuildDate>Sun, 27 Jul 2025 03:16:28 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.3</generator>

<image>
	<url>https://noter.tw/wp-content/uploads/cropped-old-1130742_1920-1-32x32.jpg</url>
	<title>伺服器 &#8211; 記下來</title>
	<link>https://noter.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>gdrive3 : Google Drive CLI Client</title>
		<link>https://noter.tw/12951/gdrive3-google-drive-cli-client/</link>
					<comments>https://noter.tw/12951/gdrive3-google-drive-cli-client/#respond</comments>
		
		<dc:creator><![CDATA[黃小蛙]]></dc:creator>
		<pubDate>Sun, 27 Jul 2025 03:14:56 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[技巧分享]]></category>
		<category><![CDATA[設定 Oauth 同意畫面]]></category>
		<category><![CDATA[啟用 API]]></category>
		<category><![CDATA[文字介面 Google Drive 工具]]></category>
		<category><![CDATA[Google Drive]]></category>
		<category><![CDATA[自動化流程]]></category>
		<category><![CDATA[gdrive]]></category>
		<category><![CDATA[新增資料存取權]]></category>
		<category><![CDATA[API Console]]></category>
		<category><![CDATA[gdrive3]]></category>
		<category><![CDATA[Google Drive API]]></category>
		<category><![CDATA[Google Drive CLI]]></category>
		<category><![CDATA[啟用 Google Drive API]]></category>
		<guid isPermaLink="false">https://noter.tw/?p=12951</guid>

					<description><![CDATA[<p>小蛙照著之前 gdirve 讓你在 Linux 文字介面也能好好使用 Google Drive 來設定新機器使用 gdrive，結果發現在 gdrive about 要進行授權時一直顯示被 block&#46;&#46;&#46;</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/12951/gdrive3-google-drive-cli-client/" data-wpel-link="internal">gdrive3 : Google Drive CLI Client</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>小蛙照著之前 <a href="https://noter.tw/4267/gdirve-%e8%ae%93%e4%bd%a0%e5%9c%a8-linux-%e6%96%87%e5%ad%97%e4%bb%8b%e9%9d%a2%e4%b9%9f%e8%83%bd%e5%a5%bd%e5%a5%bd%e4%bd%bf%e7%94%a8-google-drive/" target="_blank" rel="noreferrer noopener" data-wpel-link="internal">gdirve 讓你在 Linux 文字介面也能好好使用 Google Drive</a> 來設定新機器使用 gdrive，結果發現在 gdrive about 要進行授權時一直顯示被 block 無法使用，查了之後才發現 gdrive 已經更新到 gdrive3 了，舊的方法已經沒辦法正常使用，這篇文章記錄如何使用 gdrive3: Google Drive CLI Client，透過文字命令列使用的 Google Drive 工具。</p>



<span id="more-12951"></span>



<p>gdrive3 要設定的部分比較多也比較麻煩，不像前一版只要下載回來，<code>gdrive about</code>授權完成就可以了，跟著小蛙來一步一步設定吧。</p>



<h2 class="wp-block-heading para">下載 gdrive 套件</h2>



<p><a href="https://github.com/glotlabs/gdrive" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">gdrive3 套件連結下載<span class="wpel-icon wpel-image wpel-icon-6"></span></a>。</p>



<p>點進去之後找到 <a href="https://github.com/glotlabs/gdrive/releases" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">the release section<span class="wpel-icon wpel-image wpel-icon-6"></span></a>，小蛙寫這篇文章的時候最新版本是 3.9.1，下載對應自己作業系統的版本</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczNYGCVrMPw553P6PmskDplhKBzRY79R8oRxpZDvvq_HgWCE0ZFBBWL_zCxXg_kAKBwIIzqLjeHGSeWYVP5qcO1v5Uwcke_LlawDMwPdOtCOY-HG72LY-V4AtnELjDGR-OR7iE-R6RCYU8gfyMm7tmgz=w602-h398-rw" alt="gdrive3 : Google Drive CLI Client - 下載 gdrive3 套件" title="gdrive3 : Google Drive CLI Client"></figure></div>


<p>在 shell 環境中下，下載 gdrive、解壓縮，並移動到 <code>/usr/sbin/</code> 讓他可以全域執行</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">wget https://github.com/glotlabs/gdrive/releases/download/3.9.1/gdrive_linux-x64.tar.gz
tar -xzvf gdrive_linux-x64.tar.gz
mv ./gdrive /usr/sbin/</pre>



<h2 class="wp-block-heading para">設定 Google 帳號授權</h2>



<p>這版本的 Google 授權跟上一版比較起來真的超級麻煩，github 主頁上也有完整且詳細授權教學 <a href="https://github.com/glotlabs/gdrive/blob/main/docs/create_google_api_credentials.md" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">Create Google API credentials in 50 easy steps<span class="wpel-icon wpel-image wpel-icon-6"></span></a>，有 50 個步驟看起來真的是超級麻煩 &#8230; 不過點進去看的話就會發現其實不到 50 個步驟啦！大約只有 28 個 (&#8230;. 還是很多啊！！！)</p>



<h3 class="wp-block-heading para">建立 Google Cloud 專案</h3>



<p>首先<a href="https://console.cloud.google.com/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">進入到 Google Clound 控制台<span class="wpel-icon wpel-image wpel-icon-6"></span></a>，第一次使用的話點擊左上角「選取專案」，然後「新增專案」，如果原本就有專案存在的話，使用既有的專案也可以。</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczP0fl0a86H4MfeOh6GaZ5ERMdRMF83rk5qz0agX-X8pcif-TXzCQPb5vmg7hr13tUoKQzSY80hzROQQ4649mWRQCb8WKwffZWKxB61IrVqyaxnkljW9AFAhR7oFEU00evNotLxQfsZKiOkQvZL69foP=w841-h260-rw" alt="gdrive3 : Google Drive CLI Client - Google Cloud 建立專案 1" title="gdrive3 : Google Drive CLI Client"></figure></div>


<p>輸入可以辨識的專案名稱，點擊建立，建立完成後右上角會跳出通知，點擊選取專案進入專案頁面</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-1 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow"><div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczNrnf_bFPLl5E4QeJGkkdN1RCm1Eyux0e8lfr44oUZ4Bt77KFuWR4KlRsaSyAs4qrYkj7pdOR4biuoOfwXajiLu9f48VvMhSWfx2r3LpCfgH560WU5jEBQ7iU6GZETL3FCivNolSKUJLc9UVIG_CsSB=w551-h399-rw" alt="gdrive3 : Google Drive CLI Client - Google Cloud 建立專案 2" title="gdrive3 : Google Drive CLI Client"></figure></div></div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow"><div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczNAiS6uv8WDQfVv8dnILSXKRhmtnOhOq5w8Qo7WOTrdhQNgxvVWvJ8PXCoOgLRzr59zNCZHtkWjOO0UJAGeJyqRRrWAdTXJGE28vi0cBO0kqKK-7RvQGkXNiVZX64X3StL4zL11zWHrmWa862Mr_bH7=w410-h179-rw" alt="gdrive3 : Google Drive CLI Client - Google Cloud 建立專案 3" title="gdrive3 : Google Drive CLI Client"></figure></div></div>
</div>



<h3 class="wp-block-heading para">啟用 Google Drive API</h3>



<p>在上方搜尋欄輸入「drive api」，點擊第一個搜尋結果「Google Drive API」，點擊「啟用」來使用 Google Drive API</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-2 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczOqLBQSVz3N2daUjVJsa0ltc0KdImgBST5T93F_rMZY_efzNxOY-7r08u7J6A4ZJbBwoR6-JTIryfBthoOFtfUQizbaCOf5XJoZ3E_x_yQSBlZhFAoTIYGK8GujLohiuJrW7VoCV5HHcGa828qzTXt4=w416-h278-rw" alt="gdrive3 : Google Drive CLI Client - 啟用 Google Drive API 1" title="gdrive3 : Google Drive CLI Client"></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczMVGVUfhMRdh17XNe_UlMGU3Csrsmh0tFdhmpzvbCV4smmqCvpCSgb6leFmnxdx-k92AXGByCIu7F1byeNRQtZ2XTZRA6gXOq5u3MarP5Cco7nCGCcfUwHD_JD9cINosoag_wJgJ1Vy3nYY2tdouK5-=w455-h217-rw" alt="gdrive3 : Google Drive CLI Client - 啟用 Google Drive API 2" title="gdrive3 : Google Drive CLI Client"></figure>
</div>
</div>



<h3 class="wp-block-heading para">設定 OAuth 同意畫面</h3>



<p>成功啟用 Google Drive API 後，點擊左側選單「憑證」，點擊「設定同意畫面」</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczM8VZJ2vkRhb6YpzcHJ3o3d2MwaTFiGO75nD2EQMsmURNcmhU_v34nDyGtQ6dq1041vrDMdFaErp7HpMvRSTG7blXxm1X-_g7Bp-qLsbdxLnl1UXCDXtgEyItOIuQ5L9mQ9e-B51hWIzTqRoebbMo7H=w954-h346-rw" alt="gdrive3 : Google Drive CLI Client - 設定 OAuth 同意畫面 1" title="gdrive3 : Google Drive CLI Client"></figure></div>


<p>點擊「開始」設定 Google 驗證平台，輸入應用程式名稱及使用者支援電子郵件</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-3 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczOYSM6asBcoMrW-0o15VZ8PVp5ze5NjZQeiMD8iDMf_8w9xWghjnhcciIPGihLjOOWtPuabPEo4ozjUM4gNjzgWpd59wNwtrdtjl5EofedlrdAkupr3ZOP75ro-wEZWAtnpCC1Lcg4vOGQzp8c-MXiq=w542-h445-rw" alt="gdrive3 : Google Drive CLI Client - 設定 OAuth 同意畫面 2" title="gdrive3 : Google Drive CLI Client"></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczNoQt-RvfeX5GloxfFnfXx7Mb3dytWCZlEz83Abf3RdQ4vMVqYKXvqXMt7I4RwIxjuJOu8pr0Tkt2aBzqQYLGfoLxwWWmQYf3wn-gBO28OrZksck30ByOgJRH-K-3gTGbW68Z7Y8NeyPzaMDQ1IrsjO=w576-h355-rw" alt="gdrive3 : Google Drive CLI Client - 設定 OAuth 同意畫面 3" title="gdrive3 : Google Drive CLI Client"></figure>
</div>
</div>



<p>目標對象選擇「外部」，填入聯絡資訊，同意條款後點擊「建立」</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-5 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczNLR_1S9o3ED6tFNo6Su6a9S3UzvMkHFuAoc1HrMApZB2GuenHAZHyHxEIrKuCv82I7zsfEvfEJYfaGKMedSW_46xR27ooNqGv8dIDjM3MJCUiV8z5InbVxQNwPLyjzEaD2bB29UJRt7sGuNV_9iPzM=w565-h393-rw" alt="gdrive3 : Google Drive CLI Client - 設定 OAuth 同意畫面 4" title="gdrive3 : Google Drive CLI Client"></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-4 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczN-irV9NqSHPOXvVWQAJRTxBEtkfeqYVzmDQ6G7Va95Iw8zEtioK4WFoTxEgeJM4NgYOq3JEMkB03LR5QjU1zHy35OIx8kJatocgjwo8kvunm3LzI0pfK_7JXJCJ6gGJikMPDK7f-NVvSqng1nT_Fe8=w613-h329-rw" alt="gdrive3 : Google Drive CLI Client - 設定 OAuth 同意畫面 5" title="gdrive3 : Google Drive CLI Client"></figure>
</div>
</div>
</div>
</div>



<h3 class="wp-block-heading para">新增資料存取權</h3>



<p>點擊「資料存取權」-&gt;「新增或移除範圍」</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczPvSO-Epve8DVslM0S9SUx-zOZd8GDrolC6UhRNp1owEtyTjk56MWqmfPeoTiI8c00_Ns5fhYPqFjCsURsXtQWfbvxKD14W46Xk00vYTeFqeLTvxI_0dwadhsr6MdqTu9eaZrCCOhm-XyfngiUFjnw9=w792-h348-rw" alt="gdrive3 : Google Drive CLI Client - 新增資料存取權 1" title="gdrive3 : Google Drive CLI Client"></figure></div>


<p>篩選條件輸入「Google Drive API」，下方範圍選擇 <mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color"><strong>&#8230;/auth/drive</strong></mark> 及 <mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color"><strong>&#8230;/auth/drive.metadata.readonly</strong></mark> 兩個，選完後點擊最下方「更新」</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczMzKE-BM9NyW0cUpgeD8iMNxPjEPvI6bG_0O4dyQhvINp6TIuVSlzv1fj3QxKNMacNPp7tlfXxZlldGLtkv28uxQlLZh-P5WnqIC9RBImcEdBMseTOY7vv_9KkeJdli3x6YoWuQv_aWBc1LplgpzKlh=w725-h635-rw" alt="gdrive3 : Google Drive CLI Client - 新增資料存取權 2" title="gdrive3 : Google Drive CLI Client"></figure></div>


<p>接著畫面會顯示剛剛選擇的那兩個，點擊 Save 儲存</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczMqS5L81SnhDeBo_9FpoKQRnAF4wtuchykCW92Oiv-fnVgQUJmNnCBXxpgBS2ZUL2fU8yXoX-saKHQUUxHVj_liw9bH8dlGdgJ62WLFp-xiQG6DysPA0bDHLb3EeI401mu9KHj9NmQhXv4uqOvp5O2s=w537-h372-rw" alt="gdrive3 : Google Drive CLI Client - 新增資料存取權 3" title="gdrive3 : Google Drive CLI Client"></figure></div>


<h3 class="wp-block-heading para">新增目標對象</h3>



<p>接著點擊「目標對象」-&gt;「Add users」</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczN5LlpqroLq6SMmPnlxVGtBr1sk9gQymiaqhWGuXGC6Z-pLq1h2F-kxdnqZq6c2fIce71tLcG6fWCp085d4xb1CHWVu9rqLh-mxQm4cuTCIsb_l26U1KdnoCVpSATg0mVkR8omqF18YiMkKRnFeltPT=w865-h686-rw" alt="gdrive3 : Google Drive CLI Client - 新增目標對象 1" title="gdrive3 : Google Drive CLI Client"></figure></div>


<p>輸入要使用 gdrive3 的使用者</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczNuqBAtgoT82GQc23Fyw81Tab3aiG2rDSKOoRa3y8j_TH9i08nh2BYD6EbwGKQTCJ6gYPSYKEjn_YKFBcLRLzL2TOPz95T9lKKmGDN09vOvvKgHoU1j6nWgEZ-9mfTjzQfZr3g6D7oWKnqKms8TsBel=w735-h320-rw" alt="gdrive3 : Google Drive CLI Client - 新增目標對象 2" title="gdrive3 : Google Drive CLI Client"></figure></div>


<h3 class="wp-block-heading para">建立 Oauth 用戶端</h3>



<p>點擊「用戶端」-&gt;「建立用戶端」，應用程式類型選擇「電腦版應用程式」，接著輸入自己可以辨認的名稱即可</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-6 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczOMvrV0LjbXZBK7jRy8zmev1fVORHPKsS2nimuyDXT3Cevva6S0pWuV_jmQrcIXfcKROeDTsYREvouRtozdh8OO9nSk4kKRSJ59LhBKjMjvTgdWI3lBy1KKXiBXPGFsy1-g5Va_p2HyZ4_q1uXRvBgY=w585-h305-rw" alt="gdrive3 : Google Drive CLI Client - 建立 Oauth 用戶端 1" title="gdrive3 : Google Drive CLI Client"></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczPQgzwcgrd_GP09lwKTxd81OQTYB1FG6mK_IUqGUXKM68YQQJALdsHjCxH9LUUgBsXj-bAdU9N4M99TrF2wIbw9W8sQ-zk0HWa0JJgA52CYGjrWqp0FSc0oy_XRq0VrSN5rY3ukJeISAhf4MMJ3JFvS=w555-h410-rw" alt="gdrive3 : Google Drive CLI Client - 建立 Oauth 用戶端 2" title="gdrive3 : Google Drive CLI Client"></figure>
</div>
</div>



<p>建立完成，點擊「下載 JSON」可以把密鑰下載下來，要注意這邊的密碼要記起來，關閉這視窗之後就再也看不到這個密碼了，只能刪除重建一個新的喔。</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczP50ROlmnjFVVtV8-IOKQw3phcLk8IpM-4F-XP55K3stWTDsFr3V7_5zT9K2MiPM7mCoSwqLONiXQDsBPrhmKEUFcW1ocQVM4waxNPfDUU00MO_MC_yYmj6ES3pkyZGO-9ZZGJK3DcdPRt1ApWMBf0p=w503-h512-rw" alt="gdrive3 : Google Drive CLI Client - 建立 Oauth 用戶端 3" title="gdrive3 : Google Drive CLI Client"></figure></div>


<h3 class="wp-block-heading para">發布應用程式</h3>



<p>點擊左側「目標對象」->「發布應用程式」</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczOm8jL9_IeXoDK7dURzsWYm5zJsG4uqBuxv_uyshbAI-86TfdMB5CJqCTEkvKP6pGSEy3AfsWpIpUaOiau63P4QP8eXPtoqlm4a0F0KUaJlbHF0apJrUNERNjV6USrPdCIm1qyNHH5Icx2GHvQtKPKe=w435-h303-rw" alt="gdrive3 : Google Drive CLI Client - 發布應用程式 1" title="gdrive3 : Google Drive CLI Client"></figure></div>


<p>確認後就完成 Google Drive API 的設定囉 ~</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczMusqFYBxlEMnD5aOEpuLl9Y4wDdiWYSjHG2HclKyo2BapTcg1UehDRszGdF60wbhkTdjt0VQQAuHF6gK_wrgo41EFis7_0uIu-vSInWl0RPP8S8MeiFEDxxYlbp8NSQbkYvn998XzWt3QHUHqAsDoP=w549-h207-rw" alt="gdrive3 : Google Drive CLI Client - 發布應用程式 2" title="gdrive3 : Google Drive CLI Client"></figure></div>


<h2 class="wp-block-heading para">gdrive3 認證</h2>



<p>這部分要依照「本機是否可以開啟瀏覽器」來區分，因為小蛙安裝在 VPS 上沒有辦法開啟瀏覽器來驗證，也不像前一版可以遠端驗證</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczOpkuwA4LWDNYEi_vCS2d6__w4A1bKlHe5C4JIaLYSip2dqKlb4zpkKUiHfBxgNtnTJW2M63H5TVcdx47rdjPAHHigBHeHQficR8MH2BrKE4NpWPiNVK58E4FBRrXPo3_9-PgZLKvCx64d2cx0uzKRB=w641-h419-rw" alt="gdrive3 : Google Drive CLI Client - 認證 失敗" title="gdrive3 : Google Drive CLI Client"></figure></div>


<p>因此這邊需要在 Windows 本機也安裝 gdrive，在本機驗證成功後，把設定檔匯出，在到 VPS 上匯入設定檔，這樣就能讓不能開瀏覽器的主機也能正常使用 gdrive，下面小蛙就示範怎麼執行這些步驟。</p>



<p>下載 Windows 版本的 gdrive，解壓縮後進入到目錄，接著執行<code>gdrive account add</code>，輸入上面取得的用戶端編號與用戶端密碼後，會得到一個連結，複製貼到瀏覽器進行認證</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczO5PxeKR3gqSzNs3AE2Brh3hL53ijfdb45o3HzeLEx8PH9G_mBCfwrwnqrMsBpt7NEpsLKxK_qXku-8BIVoTQr4bvZuYzobDlxd9JvgUohAmSY0tEHX4UvwaN93KaZKsU50HxHIVY07Ot1BS8wSXWN2=w981-h456-rw" alt="gdrive3 : Google Drive CLI Client - 驗證、匯出" title="gdrive3 : Google Drive CLI Client"></figure></div>


<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">gdrive account add
# Client ID (輸入用戶端編號)
# Client secrent (輸入用戶端密碼)
# 取得驗證連結 (貼到瀏覽器進行認證)
# 驗證成功顯示 Logged in as xxxxx@gmail.com</pre>



<p>輸入剛剛上面 Add user 中輸入的 gmail 帳號</p>



<figure class="wp-block-image size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczNQ0tlovd_Lx_offLztnGAzhPwueEn1Q-c63Shi0G3L3fkB8ZJbC-htu_blKIKlpDj4klyD6NlVH1AfOYl2LHIza66OqPIokwVWVVIXor86179TL7x5MDSrLCeOgXIaZmm2FZAPJzv8SE2ZjCRNxdqb=w1051-h441-rw" alt="gdrive3 : Google Drive CLI Client - 驗證 Google Drive API 1" title="gdrive3 : Google Drive CLI Client"></figure>



<p>遇到下面這個畫面沒關係，點擊顯示進階設定，點擊下方前往「GDrive3」(不安全)</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczMwiuWQZKGEtOsgTev8dVkSkUM5e_ZHYmuJKBjywOSiiBTlijIjuQnYSVROat5ihi4SEYA5iVm-br-g5jWkE6zD72cgcYlKbARXXM9IIzk_uH8DoaHx4G-u_0T83uJHTlyfibTB92ItCB2v7LBAR26W=w644-h448-rw" alt="gdrive3 : Google Drive CLI Client - 驗證 Google Drive API 2" title="gdrive3 : Google Drive CLI Client"></figure></div>


<p>兩個權限都勾選後點擊繼續</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczMvkcr94IMCBGcZ3_1EFP3rMH7HCFyLyJ4J7Efk6KSZ_MIullJCWw6rBVctY1p3jf9TqOOYQozKCgdNKQGYoQVA6H0keU4ACWRVZmL_h26WryCg9puHYiJNJ5uzUXz5d5BNe2B-4Theg7fO0S7CvZM1=w1044-h739-rw" alt="gdrive3 : Google Drive CLI Client - 驗證 Google Drive API 3" title="gdrive3 : Google Drive CLI Client"></figure></div>


<p>驗證成功</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczM1j3v0kab7tsCubxZzph7ttvJarHfEaazkYUQal5E_mUIq7-4Bur73y5FO7Q4bCqmKJDQbpwmQmyRYBAwnQThxk38pskwge36Vvq49EuP-66KkjPV2Mb-gwxdqGCPdZ57ICr9oHaejs0axh09-e8sF=w336-h97-rw" alt="gdrive3 : Google Drive CLI Client - 驗證 Google Drive API 4" title="gdrive3 : Google Drive CLI Client"></figure></div>


<p>接著將驗證成功的檔案匯出，輸入<code>gdrive export</code>剛驗證成功的 gmail 帳號</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczNcbmyAoI7ERJDNqlDpUDuTnVVF5OetKG31Y0ryxTsnbxiaaoyFiueUIoOK7Kd7ZV8ej9RNfxGxfywrdavxJxXTwGjA-VlDj8eflJhPPZdSI4jz9EFQKmHxLDzeOujy2HOwzJn981lWXeU0opNjKhRz=w706-h130-rw" alt="gdrive3 : Google Drive CLI Client - 匯出 gdrive 驗證檔" title="gdrive3 : Google Drive CLI Client"></figure></div>


<p>把上面產生的檔案上傳到 VPS 主機上，使用<code>gdrive account import</code>匯入就成功囉~</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczOLk8tqKSEU0-NcgWgSeb1KOYulLXzphCPJcM8foQXR-P1IMat7l2X0e0pssW7JbBhq5MyqOzzX8dXn4v7F82qlw1LiO-a1KHOJ-B-Ggig7Ua3LizCqr8lJh9YS0VOaN8tOnTmH9l8xfL-kYnOcjNSX=w1141-h109-rw" alt="gdrive3 : Google Drive CLI Client - 匯入 gdrive 驗證檔" title="gdrive3 : Google Drive CLI Client"></figure></div>


<h2 class="wp-block-heading para">gdrive3 基本使用</h2>



<p>只要輸入<code>gdrive</code>就可以看到使用說明</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># gdrive
Usage: gdrive &lt;COMMAND>

Commands:
  about        Print information about gdrive
  account      Commands for managing accounts
  drives       Commands for managing drives
  files        Commands for managing files
  permissions  Commands for managing file permissions
  version      Print version information
  help         Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help information</pre>



<p>輸入<code>gdrive files mkdir 資料夾名稱</code>可建立資料夾，小蛙要用來放備份的，因此輸入<code>gdrive files mkdir backup</code>，建立一個名稱為 backup 的資料夾，接著會回傳一個 directory id，之後存取這個資料夾都是認這個 directory id 而不是資料夾名稱喔。</p>



<h3 class="wp-block-heading para">建立資料夾</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># gdrive files mkdir backup
Created directory 'backup' with id: 1MuLg1nlmZwudTdW4MJqhNO1z88i9Vur2</pre>



<p>到 Google 雲端硬碟可以看到成功建立了 backup 資料夾</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AP1GczPALj9qNEhjP_nUQVGBjfl_sjS8N2DwI9xt6jWgF-QRgqnC4jPavznsOC4GuwV-Woydo5Wt7zFfeBAh1cZfd85FFKRGYqrfNbHFraatBoct7yE4m3raEPpgND72DAcR1g_HVmjV11NXNHvnStyn_-61=w505-h252-rw" alt="gdrive3 : Google Drive CLI Client - 我的雲端硬碟" title="gdrive3 : Google Drive CLI Client"></figure></div>


<h3 class="wp-block-heading para">上傳檔案</h3>



<p>這一版不支援前一版可以<code>gdrive sync upload 本機資料夾 雲端資料夾id</code>直接同步整個本機資料夾內的檔案，只能透過以下指另一個一個上傳</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">gdrive files upload --parent 1MuLg1nlmZwudTdW4MJqhNO1z88i9Vur2 1.txt
gdrive files upload --parent 1MuLg1nlmZwudTdW4MJqhNO1z88i9Vur2 2.txt
...</pre>



<p>或者是批量把資料夾下的資料都上傳可透過以下指令，不過這樣會在原本要上傳的 backup 資料夾下又在建立一個 backup 資料夾 &#8230; </p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">~/backup# gdrive files upload --parent 1MuLg1nlmZwudTdW4MJqhNO1z88i9Vur2 --recursive ./
Found 2 files in 1 directories with a total size of 70 B
Creating directory 'backup' with id: 1elbAeqJGIA_h8VeKSGveWWuyVL_vZevp
Uploading file 'backup/1.txt' with id: 1HuMgkjhnLwWnCkub3hwfU2WVXvC-o3IQ
Uploading file 'backup/2.txt' with id: 1S76vQWzWtR1AzR-IzxDMPBh2RBzNAvOB
Uploaded 2 files in 1 directories with a total size of 70 B</pre>



<p>大概 gdrive 的教學就到這邊，如果遇到參數不知道怎麼下的時候，只要在最後面加上<code>-h</code>就可以看到指令教學。</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/12951/gdrive3-google-drive-cli-client/" data-wpel-link="internal">gdrive3 : Google Drive CLI Client</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://noter.tw/12951/gdrive3-google-drive-cli-client/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ubuntu 安裝及設定 vsftp</title>
		<link>https://noter.tw/10572/ubuntu-%e5%ae%89%e8%a3%9d%e5%8f%8a%e8%a8%ad%e5%ae%9a-vsftp/</link>
					<comments>https://noter.tw/10572/ubuntu-%e5%ae%89%e8%a3%9d%e5%8f%8a%e8%a8%ad%e5%ae%9a-vsftp/#respond</comments>
		
		<dc:creator><![CDATA[黃小蛙]]></dc:creator>
		<pubDate>Wed, 14 Dec 2022 14:22:51 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[技術相關]]></category>
		<category><![CDATA[FTP 架設]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[FTP Server]]></category>
		<category><![CDATA[VSFTPD]]></category>
		<guid isPermaLink="false">https://noter.tw/?p=10572</guid>

					<description><![CDATA[<p>好久沒有設定 FTP 了，最近遇到需要架設 FTP 的情況，這篇文章參考自：How to Setup FTP Server with VSFTPD on Ubuntu 20.04，小蛙把自己實際使用流程記錄下來。</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/10572/ubuntu-%e5%ae%89%e8%a3%9d%e5%8f%8a%e8%a8%ad%e5%ae%9a-vsftp/" data-wpel-link="internal">Ubuntu 安裝及設定 vsftp</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>好久沒有設定 FTP 了，最近遇到需要架設 FTP 的情況，這篇文章參考自：<a href="https://linuxize.com/post/how-to-setup-ftp-server-with-vsftpd-on-ubuntu-20-04/" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external" class="wpel-icon-right">How to Setup FTP Server with VSFTPD on Ubuntu 20.04<span class="wpel-icon wpel-image wpel-icon-6"></span></a>，小蛙把自己實際使用流程記錄下來。</p>



<span id="more-10572"></span>



<p>小蛙收到的需求是要架設 FTP Sever ，建立一個特定使用帳號，並將該帳號的家目錄設定在特定路徑下，該文章完全符合小蛙的需求，照著做之後把過程中文化並記錄下來，開始吧！</p>



<h2 class="para wp-block-heading">安裝 vsftp</h2>



<p>這邊使用較輕巧且設定簡單的 vsftp，透過以下指令進行安裝</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">sudo apt update
sudo apt install vsftpd</pre>



<p>安裝完成後可輸入<code>systemctl status vsftpd</code>查看是否正常安裝及運作</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AL9nZEV3AgG8GoL9_WGoPcykIL-ymilahtGTXvqcfUXeNM0LEoixhPME-Vz3llgaX1xKm2hhcZcMBKYOap-BgzQAqQ-rmeW9ooWA_Nowtss-iNLwed2kYzd4h0B-TXSts0qVhHtN6zA21SAV5NqYVaXWeDuH=w2585-h570-no?authuser=2" alt="AL9nZEV3AgG8GoL9 WGoPcykIL ymilahtGTXvqcfUXeNM0LEoixhPME Vz3llgaX1xKm2hhcZcMBKYOap BgzQAqQ rmeW9ooWA Nowtss iNLwed2kYzd4h0B TXSts0qVhHtN6zA21SAV5NqYVaXWeDuH=w2585 h570 no?authuser=2 Ubuntu 安裝及設定 vsftp" title="Ubuntu 安裝及設定 vsftp"></figure></div>


<h2 class="para wp-block-heading">設定 vsftp</h2>



<p>vsftp 的設定檔在<code>/etc/vsftpd.conf</code>，小蛙這邊將進行以下 5 項設定，第 6 項傳輸加密部份因為沒有要用到，這邊就不另外提了。</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">sudo vim /etc/vsftpd.conf</pre>



<h3 class="para wp-block-heading">1. 存取限制</h3>



<p>設定禁止匿名者登入，以及本地帳號皆可使用</p>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">anonymous_enable=NO
local_enable=YES</pre>



<h3 class="para wp-block-heading">2. 允許上傳</h3>



<p>若要讓使用者上傳檔案，須將以下設定開啟</p>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">write_enable=YES</pre>



<h3 class="para wp-block-heading">3. 限制目錄切換</h3>



<p>基於安全性問題，想將使用者限制在特定區域，避免有心人士的非法行為，加上以下這兩項設定</p>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">chroot_local_user=YES
allow_writeable_chroot=YES</pre>



<h3 class="para wp-block-heading">4. 被動連線 (PASV)</h3>



<p>FTP Server 可以設定 (1) <strong>主動模式</strong> 及 (2) <strong>被動模式</strong>，在設定檔加入<code>pasv_min_port</code>及<code>pasv_max_port</code>兩個參數可限縮被動模式使用的 port 區間。</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>兩種模式各有優缺點，主動模式對伺服器來說比較安全，但對用戶端來說卻是可能帶來危險，因此很可能被用戶端的防火牆所阻擋了。使用被動模式雖然解決了用戶端的問題，但相對的伺服器必須開啟一定範圍的通訊埠供用戶端連線，好在目前絕大部分的 FTP 伺服器軟體，皆可以由管理者決定開啟哪些範圍的通訊埠。</p><cite><a href="https://matis.pixnet.net/blog/post/22918494" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">FTP 主動模式與被動模式<span class="wpel-icon wpel-image wpel-icon-6"></span></a></cite></blockquote>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">pasv_min_port=30000
pasv_max_port=31000</pre>



<h3 class="para wp-block-heading">5. 限制登入</h3>



<p>除了上面設定的本機使用者可以登入外，也可以使用下面這些設定，僅讓清單上的使用者登入 FTP，我們將設定檔放在<code>/etc/vsftpd.user_list</code>內，檔案內一行為一個使用者帳號</p>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">userlist_enable=YES
userlist_file=/etc/vsftpd.user_list
userlist_deny=NO</pre>



<h3 class="para wp-block-heading">6. 傳輸加密</h3>



<p>小蛙這次設定沒有要用到，可參考<a href="https://linuxize.com/post/how-to-setup-ftp-server-with-vsftpd-on-ubuntu-20-04/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">原文<span class="wpel-icon wpel-image wpel-icon-6"></span></a>進行設定。</p>



<h2 class="para wp-block-heading">設定防火牆</h2>



<p>設定好 vsftp 之後，安全起見還是要把防火牆設定起來，FTP 需要開啟 port 20, port 21 以及上面設定的被動模式 port 區間</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">sudo ufw allow 20:21/tcp
sudo ufw allow 30000:31000/tcp</pre>



<h2 class="para wp-block-heading">建立及設定 FTP 使用者</h2>



<p>剛剛我們設定了只有<code>/etc/vsftpd.user_list</code>清單上的使用者才可以登入 FTP，現在就來新增一個 FTP 專用帳號</p>



<h3 class="para wp-block-heading">1. 新增使用者</h3>



<p>使用<code>adduser</code>建立一個使用者 <strong>newftpuser</strong> (帳號換成自己要的)，並且把該使用者加入到允許登入清單中</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">sudo adduser newftpuser
echo "newftpuser" | sudo tee -a /etc/vsftpd.user_list</pre>



<h2 class="para wp-block-heading">禁止 Shell 登入</h2>



<p>由於只想讓該帳號使用 FTP 的功能，不希望該帳號透過 SSH 的方式登入進主機，新增一個名為 ftponly 的 Shell</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">echo -e '#!/bin/sh\necho "This account is limited to FTP access only."' | sudo tee -a  /bin/ftponly
sudo chmod a+x /bin/ftponly</pre>



<p>將我們建立的<code>/bin/ftponly</code>加入到 shell 清單中</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">echo "/bin/ftponly" | sudo tee -a /etc/shells</pre>



<p>接著把 newftpuser 的 shell 指定為<code>/bin/ftponly</code></p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">sudo usermod newftpuser -s /bin/ftponly</pre>



<p>完成後如果嘗試使用該帳號登入 SSH，就會看到以下訊息 ~</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AL9nZEV2P6iHyGzhhoM3cYHRI4fKRncPUuLSCN2BKdVtY4uU3EKP7Lr1ugBZMF9YxX46KlpWUkzupDWKPlBVY_OJkhsQ9ei6sPmZjQytTaHh6uAp-6as18oigcFpIbBPUJEWXLPYgZAugbXJN_aR5k59X3Qf=w1499-h523-no?authuser=2" alt="AL9nZEV2P6iHyGzhhoM3cYHRI4fKRncPUuLSCN2BKdVtY4uU3EKP7Lr1ugBZMF9YxX46KlpWUkzupDWKPlBVY OJkhsQ9ei6sPmZjQytTaHh6uAp 6as18oigcFpIbBPUJEWXLPYgZAugbXJN aR5k59X3Qf=w1499 h523 no?authuser=2 Ubuntu 安裝及設定 vsftp" width="375" height="131" title="Ubuntu 安裝及設定 vsftp"></figure></div>


<p>打完收工！同場加映，因為小蛙還要重新設定使用者家目錄，透過以下指令即可完成。</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">sudo usermod -d /my/new/path newftpuser</pre>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/10572/ubuntu-%e5%ae%89%e8%a3%9d%e5%8f%8a%e8%a8%ad%e5%ae%9a-vsftp/" data-wpel-link="internal">Ubuntu 安裝及設定 vsftp</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://noter.tw/10572/ubuntu-%e5%ae%89%e8%a3%9d%e5%8f%8a%e8%a8%ad%e5%ae%9a-vsftp/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>W: GPG error: 由於無法取得它們的公鑰，以下簽章無法進行驗證： NO_PUBKEY 4EB27DB2A3B88B8B</title>
		<link>https://noter.tw/10525/w-gpg-error-%e7%94%b1%e6%96%bc%e7%84%a1%e6%b3%95%e5%8f%96%e5%be%97%e5%ae%83%e5%80%91%e7%9a%84%e5%85%ac%e9%91%b0%ef%bc%8c%e4%bb%a5%e4%b8%8b%e7%b0%bd%e7%ab%a0%e7%84%a1%e6%b3%95%e9%80%b2%e8%a1%8c/</link>
					<comments>https://noter.tw/10525/w-gpg-error-%e7%94%b1%e6%96%bc%e7%84%a1%e6%b3%95%e5%8f%96%e5%be%97%e5%ae%83%e5%80%91%e7%9a%84%e5%85%ac%e9%91%b0%ef%bc%8c%e4%bb%a5%e4%b8%8b%e7%b0%bd%e7%ab%a0%e7%84%a1%e6%b3%95%e9%80%b2%e8%a1%8c/#respond</comments>
		
		<dc:creator><![CDATA[黃小蛙]]></dc:creator>
		<pubDate>Tue, 22 Nov 2022 12:37:59 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[GPG error]]></category>
		<category><![CDATA[Linux 系統]]></category>
		<category><![CDATA[NO_PUBKEY]]></category>
		<category><![CDATA[軟體更新]]></category>
		<category><![CDATA[以下簽章無法進行驗證]]></category>
		<category><![CDATA[套件管理]]></category>
		<category><![CDATA[is not signed]]></category>
		<category><![CDATA[更新錯誤解決]]></category>
		<category><![CDATA[GPG 錯誤]]></category>
		<category><![CDATA[Linux 安全性]]></category>
		<category><![CDATA[公鑰驗證]]></category>
		<category><![CDATA[安裝軟體錯誤解決]]></category>
		<category><![CDATA[NO_PUBKEY 4EB27DB2A3B88B8B]]></category>
		<category><![CDATA[數位簽章]]></category>
		<category><![CDATA[加密安全]]></category>
		<category><![CDATA[系統管理]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Ubuntu 指令]]></category>
		<guid isPermaLink="false">https://noter.tw/?p=10525</guid>

					<description><![CDATA[<p>小蛙有一台最早期的 VPS 已經不讓人重裝新版本作業系統，小蛙異想天開想直接從系統裡安裝升級，「事情絕對沒有憨蛙想得那麼簡單」，升級升到一半就哭了 ... </p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/10525/w-gpg-error-%e7%94%b1%e6%96%bc%e7%84%a1%e6%b3%95%e5%8f%96%e5%be%97%e5%ae%83%e5%80%91%e7%9a%84%e5%85%ac%e9%91%b0%ef%bc%8c%e4%bb%a5%e4%b8%8b%e7%b0%bd%e7%ab%a0%e7%84%a1%e6%b3%95%e9%80%b2%e8%a1%8c/" data-wpel-link="internal">W: GPG error: 由於無法取得它們的公鑰，以下簽章無法進行驗證： NO_PUBKEY 4EB27DB2A3B88B8B</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>小蛙有一台最早期的 VPS 已經不讓人重裝新版本作業系統，小蛙異想天開想直接從系統裡安裝升級，「事情絕對沒有憨蛙想得那麼簡單」，升級升到一半就哭了 &#8230; </p>



<span id="more-10525"></span>



<p>升到一半狂噴錯，但已回不了頭，之後下 <code>apt update</code> 都會噴以下錯誤</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">W: GPG error: http://dl.google.com/linux/chrome/deb stable InRelease: 由於無法取得它們的公鑰，以下簽章無法進行驗證： NO_PUBKEY 4EB27DB2A3B88B8B
W: The repository 'http://dl.google.com/linux/chrome/deb stable InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.</pre>



<p>根據這篇文章 <a href="https://askubuntu.com/questions/131601/gpg-error-release-the-following-signatures-were-invalid-badsig" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">GPG error: Release: The following signatures were invalid: BADSIG<span class="wpel-icon wpel-image wpel-icon-6"></span></a> 的方法嘗試回復 apt-get</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">sudo apt-get clean
sudo mv /var/lib/apt/lists /tmp
sudo mkdir -p /var/lib/apt/lists/partial
sudo apt-get clean
sudo apt-get update</pre>



<p>錯誤訊息變成這個</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://dl.google.com/linux/chrome/deb stable InRelease: 由於無法取得它們的公鑰，以下簽章無法進行驗證： NO_PUBKEY 4EB27DB2A3B88B8B
W: 無法取得 http://dl.google.com/linux/chrome/deb/dists/stable/InRelease，由於無法取得它們的公鑰，以下簽章無法進行驗證： NO_PUBKEY 4EB27DB2A3B88B8B
W: Some index files failed to download. They have been ignored, or old ones used instead.</pre>



<p>看起來好像是因為公鑰過期，查了該討論串裡的其他方法，發現下面這指令像是可以更新公鑰，死馬當活馬醫的心態試試看居然成功了！</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com</pre>



<p> 可喜可賀～！但 VPS 還是沒辦法升上去 >&lt; (殘念)，不過至少讓 apt-get 恢復正常了！</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/10525/w-gpg-error-%e7%94%b1%e6%96%bc%e7%84%a1%e6%b3%95%e5%8f%96%e5%be%97%e5%ae%83%e5%80%91%e7%9a%84%e5%85%ac%e9%91%b0%ef%bc%8c%e4%bb%a5%e4%b8%8b%e7%b0%bd%e7%ab%a0%e7%84%a1%e6%b3%95%e9%80%b2%e8%a1%8c/" data-wpel-link="internal">W: GPG error: 由於無法取得它們的公鑰，以下簽章無法進行驗證： NO_PUBKEY 4EB27DB2A3B88B8B</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://noter.tw/10525/w-gpg-error-%e7%94%b1%e6%96%bc%e7%84%a1%e6%b3%95%e5%8f%96%e5%be%97%e5%ae%83%e5%80%91%e7%9a%84%e5%85%ac%e9%91%b0%ef%bc%8c%e4%bb%a5%e4%b8%8b%e7%b0%bd%e7%ab%a0%e7%84%a1%e6%b3%95%e9%80%b2%e8%a1%8c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>關閉 Ubuntu 自動更新</title>
		<link>https://noter.tw/10518/%e9%97%9c%e9%96%89-ubuntu-%e8%87%aa%e5%8b%95%e6%9b%b4%e6%96%b0/</link>
					<comments>https://noter.tw/10518/%e9%97%9c%e9%96%89-ubuntu-%e8%87%aa%e5%8b%95%e6%9b%b4%e6%96%b0/#respond</comments>
		
		<dc:creator><![CDATA[黃小蛙]]></dc:creator>
		<pubDate>Tue, 22 Nov 2022 12:25:58 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu 更新自動關閉]]></category>
		<category><![CDATA[Ubuntu 系統更新關閉]]></category>
		<category><![CDATA[Ubuntu 關閉自動更新]]></category>
		<category><![CDATA[Ubuntu 停用自動更新]]></category>
		<category><![CDATA[Ubuntu 系统自動更新關閉]]></category>
		<category><![CDATA[關閉 Ubuntu 自動升级]]></category>
		<category><![CDATA[禁用 Ubuntu 自動升级]]></category>
		<category><![CDATA[Ubuntu 自動更新禁止]]></category>
		<category><![CDATA[關閉 Ubuntu 自動更新]]></category>
		<category><![CDATA[Ubuntu 自動更新關閉]]></category>
		<category><![CDATA[禁用 Ubuntu 自動更新]]></category>
		<guid isPermaLink="false">https://noter.tw/?p=10518</guid>

					<description><![CDATA[<p>前幾天一大早就收到通知網站掛了，上去看了 log 之後發現錯誤竟然是找不到 pagespeed 模組 ... 查了一下發現是自動更新造成，這裡把關閉 Ubuntu 自動更新的方法記下來。</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/10518/%e9%97%9c%e9%96%89-ubuntu-%e8%87%aa%e5%8b%95%e6%9b%b4%e6%96%b0/" data-wpel-link="internal">關閉 Ubuntu 自動更新</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>前幾天一大早就收到通知網站掛了，上去看了 log 之後發現錯誤竟然是找不到 pagespeed 模組 &#8230; 查了一下發現是自動更新造成，這裡把關閉 Ubuntu 自動更新的方法記下來。</p>



<span id="more-10518"></span>



<p>某次遇到 Ubuntu 20.04 安裝完一切後，過不久發現原本好好的功能突然出問題，查了一下才發現原本的設定不一樣了，到底發生什麼事？一度懷疑被其他工程師更新了，只好硬著頭皮快點把問題修復，讓網站上線，之後就忘記這件事情。</p>



<p>直到最近有一台新機器也是安裝完畢後，過不久使用 nginx + phpfpm 的網站自己突然就掛了，一直噴 <code>pagespeed module not found</code> 的錯誤 &#8230;？一度懷疑是不是主機被入侵 &#8230; 經過仔細盤查後才發現原來這台也是 Ubuntu 20.04，預設會開啟自動更新 &#8230;</p>



<p>根據 <a href="https://shengyu7697.github.io/ubuntu-disable-auto-update/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">Ubuntu 關閉自動更新<span class="wpel-icon wpel-image wpel-icon-6"></span></a> 及 <a href="https://idroot.us/disable-automatic-updates-on-ubuntu-20-04/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">How To Disable Automatic Updates on Ubuntu 20.04 LTS<span class="wpel-icon wpel-image wpel-icon-6"></span></a> 這兩篇文章，關閉自動更新很簡單，只要把以下設定都改為 0 就可以了！</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">vim /etc/apt/apt.conf.d/20auto-upgrades

APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "0";
APT::Periodic::Unattended-Upgrade "0";</pre>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/10518/%e9%97%9c%e9%96%89-ubuntu-%e8%87%aa%e5%8b%95%e6%9b%b4%e6%96%b0/" data-wpel-link="internal">關閉 Ubuntu 自動更新</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://noter.tw/10518/%e9%97%9c%e9%96%89-ubuntu-%e8%87%aa%e5%8b%95%e6%9b%b4%e6%96%b0/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Notepad++ NppFTP 使用 key 登入的問題</title>
		<link>https://noter.tw/10503/notepad-nppftp-%e4%bd%bf%e7%94%a8-key-%e7%99%bb%e5%85%a5%e7%9a%84%e5%95%8f%e9%a1%8c/</link>
					<comments>https://noter.tw/10503/notepad-nppftp-%e4%bd%bf%e7%94%a8-key-%e7%99%bb%e5%85%a5%e7%9a%84%e5%95%8f%e9%a1%8c/#respond</comments>
		
		<dc:creator><![CDATA[黃小蛙]]></dc:creator>
		<pubDate>Thu, 03 Nov 2022 14:07:34 +0000</pubDate>
				<category><![CDATA[伺服器]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[技巧分享]]></category>
		<category><![CDATA[技術相關]]></category>
		<category><![CDATA[Invalid private key file or incorrect passphrase]]></category>
		<category><![CDATA[登入技巧]]></category>
		<category><![CDATA[MobaKeyGen]]></category>
		<category><![CDATA[NppFTP使用教學]]></category>
		<category><![CDATA[Conversions]]></category>
		<category><![CDATA[Notepad++ FTP登入問題]]></category>
		<category><![CDATA[設定]]></category>
		<category><![CDATA[Key登入Notepad++ FTP]]></category>
		<category><![CDATA[使用key登入]]></category>
		<category><![CDATA[NppFTP key設定]]></category>
		<category><![CDATA[PuTTYgen]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[NppFTP key登入教學]]></category>
		<category><![CDATA[登入問題]]></category>
		<category><![CDATA[NppFTP key登入設定]]></category>
		<category><![CDATA[解決方案]]></category>
		<category><![CDATA[Notepad++]]></category>
		<category><![CDATA[Key登入]]></category>
		<category><![CDATA[NppFTP]]></category>
		<category><![CDATA[Notepad++ FTP]]></category>
		<category><![CDATA[Private Key]]></category>
		<category><![CDATA[使用教學]]></category>
		<guid isPermaLink="false">https://noter.tw/?p=10503</guid>

					<description><![CDATA[<p>Notepad++ NppFTP 模組從小蛙的主機關閉密碼登入之後，就一直登不進去了，經過一番查找才發現解法，這篇文章記錄 Notepad++ NppFTP 使用 key 登入的方法。</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/10503/notepad-nppftp-%e4%bd%bf%e7%94%a8-key-%e7%99%bb%e5%85%a5%e7%9a%84%e5%95%8f%e9%a1%8c/" data-wpel-link="internal">Notepad++ NppFTP 使用 key 登入的問題</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>Notepad++ NppFTP 模組從小蛙的主機關閉密碼登入之後，就一直登不進去了，經過一番查找才發現解法，這篇文章記錄 Notepad++ NppFTP 使用 key 登入的方法。</p>



<span id="more-10503"></span>



<p>開啟 Notepad++ 後，切換到 Authentication 頁籤 -> 勾選「Try private key file authentication」-> 選取透過 <a href="https://noter.tw/278/%e7%99%bb%e5%85%a5-ssh-%e5%85%8d%e8%bc%b8%e5%85%a5%e5%b8%b3%e8%99%9f%e5%af%86%e7%a2%bc/" target="_blank" rel="noreferrer noopener" data-wpel-link="internal">登入 ssh 免輸入帳號密碼</a> 產生的 Private Key (小蛙的例子是 test.key.ppk)</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img fetchpriority="high" decoding="async" src="https://lh3.googleusercontent.com/pw/AL9nZEWc4Avalzhbp-LOjoH9W3dB6xBjhaGF3PGSXnWlvOIVaaUInjZISy_Kzw79kTYUHiRTigLd0Dt4fA299ngLaVY4ptlh74-LvzwDGhDRwj6K_M9swfCRffoe3YbQjwbDlALIsHqcGIhL5hUIQpzAfE_y=w1054-h813-no?authuser=2" alt="AL9nZEWc4Avalzhbp LOjoH9W3dB6xBjhaGF3PGSXnWlvOIVaaUInjZISy Kzw79kTYUHiRTigLd0Dt4fA299ngLaVY4ptlh74 LvzwDGhDRwj6K M9swfCRffoe3YbQjwbDlALIsHqcGIhL5hUIQpzAfE y=w1054 h813 no?authuser=2 Notepad++ NppFTP 使用 key 登入的問題" width="527" height="407" title="Notepad++ NppFTP 使用 key 登入的問題"></figure></div>


<p>點擊連線後會發生以下錯誤</p>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Connecting
[SFTP] Host key accepted
[SFTP] Invalid private key file or incorrect passphrase
[SFTP] Error during authentication: Access denied for 'none'. Authentication that can continue: publickey
Unable to connect
Disconnected</pre>



<p>原因是 Notepad++ 不支援預設產出的 ppk 這種格式，只要再開啟 PuTTYgen 或 MobaKeyGen (可參考 <a href="https://noter.tw/278/%e7%99%bb%e5%85%a5-ssh-%e5%85%8d%e8%bc%b8%e5%85%a5%e5%b8%b3%e8%99%9f%e5%af%86%e7%a2%bc/" target="_blank" rel="noreferrer noopener" data-wpel-link="internal">登入 ssh 免輸入帳號密碼</a>)，點擊 Load 載入要轉換的 ppk (例如 test.key.ppk) -> Conversions -> Export OpenSSH Key</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AL9nZEV17ZJYGcfIK8d4bre1TCEVA248VP0pxUKHiTlKJHrJ_MWBVCiFNGFeCb46CgShQzC8G7nGy5vL04S0T_VjIIF9CYAYBhXnO2c8P9FTXHf1el_LJyy2CbMi0_eBpGNMLcJ9OcTMNqFIklXcBXKpCSar=w958-h894-no?authuser=2" alt="AL9nZEV17ZJYGcfIK8d4bre1TCEVA248VP0pxUKHiTlKJHrJ MWBVCiFNGFeCb46CgShQzC8G7nGy5vL04S0T VjIIF9CYAYBhXnO2c8P9FTXHf1el LJyy2CbMi0 eBpGNMLcJ9OcTMNqFIklXcBXKpCSar=w958 h894 no?authuser=2 Notepad++ NppFTP 使用 key 登入的問題" width="479" height="447" title="Notepad++ NppFTP 使用 key 登入的問題"></figure></div>


<p>轉換後的 Private Key 會長類似這樣，在 Notepad++ 使用這把私鑰就可以正常連線了。</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">-----BEGIN RSA PRIVATE KEY-----
...
...
...
-----END RSA PRIVATE KEY-----</pre>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/10503/notepad-nppftp-%e4%bd%bf%e7%94%a8-key-%e7%99%bb%e5%85%a5%e7%9a%84%e5%95%8f%e9%a1%8c/" data-wpel-link="internal">Notepad++ NppFTP 使用 key 登入的問題</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://noter.tw/10503/notepad-nppftp-%e4%bd%bf%e7%94%a8-key-%e7%99%bb%e5%85%a5%e7%9a%84%e5%95%8f%e9%a1%8c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>向 TWCA 申請 SSL 憑證 (Ubuntu, Apache)</title>
		<link>https://noter.tw/10420/%e5%90%91-twca-%e7%94%b3%e8%ab%8b-ssl-%e6%86%91%e8%ad%89-ubuntu-apache/</link>
					<comments>https://noter.tw/10420/%e5%90%91-twca-%e7%94%b3%e8%ab%8b-ssl-%e6%86%91%e8%ad%89-ubuntu-apache/#respond</comments>
		
		<dc:creator><![CDATA[黃小蛙]]></dc:creator>
		<pubDate>Fri, 07 Oct 2022 12:43:49 +0000</pubDate>
				<category><![CDATA[Web Server]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[TWCA]]></category>
		<category><![CDATA[如何生成 private key]]></category>
		<category><![CDATA[SSL 憑證申請]]></category>
		<category><![CDATA[CSR]]></category>
		<category><![CDATA[TWCA 憑證申請教學]]></category>
		<category><![CDATA[TWCA 憑證]]></category>
		<category><![CDATA[TWCA SSL Apache]]></category>
		<category><![CDATA[Ubuntu Apache SSL]]></category>
		<category><![CDATA[TWCA CSR]]></category>
		<category><![CDATA[TWCA CER]]></category>
		<category><![CDATA[產生 TWCA CSR]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[Private Key]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[如何生成 CSR]]></category>
		<guid isPermaLink="false">https://noter.tw/?p=10420</guid>

					<description><![CDATA[<p>因為某些特殊緣故必須要向 TWCA (臺灣網路認證) 申請 SSL 憑證，已經申請好幾次了，每次做都還要去查資料，這篇文章把向 TWCA 申請 SSL 憑證的流程記下來。</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/10420/%e5%90%91-twca-%e7%94%b3%e8%ab%8b-ssl-%e6%86%91%e8%ad%89-ubuntu-apache/" data-wpel-link="internal">向 TWCA 申請 SSL 憑證 (Ubuntu, Apache)</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>因為某些特殊緣故必須要向 <a href="https://www.twca.com.tw/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">TWCA<span class="wpel-icon wpel-image wpel-icon-6"></span></a> (臺灣網路認證) 申請 SSL 憑證，已經申請好幾次了，每次做都還要去查資料，這篇文章把向 TWCA 申請 SSL 憑證的流程記下來。</p>



<span id="more-10420"></span>



<p><a href="https://www.twca.com.tw/service_detail/7d08f851-9415-4dd7-92cc-91ee37fb7b69" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">TWCA 官網<span class="wpel-icon wpel-image wpel-icon-6"></span></a>列出申請 SSL 憑證總共有 6 個步驟，接下來小蛙會著重在第 3 步：<strong>上傳 CSR (WEB)</strong> 以及第 6 步：<strong>安裝與設定 1.電子憑證 2.認證標章</strong> (但不會使用認證標章)</p>



<h2 class="wp-block-heading para">申請 TWCA SSL 憑證：上傳 CSR (WEB)</h2>



<h3 class="wp-block-heading para">產生主機 KEY 及 CSR 憑證請求檔</h3>



<p>首先進到 /etc/ssl/ 產生金鑰 (private key)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cd /etc/ssl/
openssl genrsa -out server.key 2048</pre>



<p>使用這把金鑰產生 CSR 憑證請求檔</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">openssl req -new -key ./server.key -out server.csr

You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]: TW (國家縮寫)
State or Province Name (full name) [Some-State]:Taiwan (國家名稱全名)
Locality Name (eg, city) []:Taichung (城市名稱)
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Noter (公司名稱) 
Organizational Unit Name (eg, section) []:IT (部門名稱)
Common Name (e.g. server FQDN or YOUR name) []:noter.tw (網域名稱)
Email Address []:noter.tw@gmail.com (電子郵件)

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:Noter (選用的公司名稱)</pre>



<p>2024-05-21 補充，因為每年都要產生一次，有時候忘記 CSR 要輸入的東西，就可以使用以下指令來看查看之前產生 CSR 時填入的資訊</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">openssl req -in example.csr -noout -text</pre>



<h3 class="wp-block-heading para">上傳 CSR</h3>



<p>經過上述步驟後，在 <code>/etc/ssl/</code> 下會多出 <code>server.key</code> 及 <code>server.csr</code>，回到 <a href="https://www.twca.com.tw/service_detail/7d08f851-9415-4dd7-92cc-91ee37fb7b69" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">TWCA 官網<span class="wpel-icon wpel-image wpel-icon-6"></span></a> 第 3 點的描述</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>請將CSR檔案中的內容複製到下方的空欄中，注意複製的範圍應包括「&#8212;&#8211;BEGIN NEW CERTIFICATE REQUEST&#8212;&#8211;」到「&#8212;&#8211;END NEW CERTIFICATE REQUEST&#8212;&#8211;」的宣告文字。</p>
</blockquote>



<p>透過 cat 印出剛剛產生的 CSR</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cat server.csr

-----BEGIN CERTIFICATE REQUEST-----
...
...
...
-----END CERTIFICATE REQUEST-----</pre>



<p>複製「&#8212;&#8211;BEGIN NEW CERTIFICATE REQUEST&#8212;&#8211;」到「&#8212;&#8211;END NEW CERTIFICATE REQUEST&#8212;&#8211;」範圍的文字，貼到 TWCA 官網中點擊繼續</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AL9nZEUii6S1K0_-GAxZTQ4PT-RTlxjCuLFkpe0VAvFwfpE3q-pmUMS82NLzMZ2EFsIqYzIdmvBthfhNlrBwzdp4ZaPJ_-EO8dD-UrJXL9i3N8OVr6_0InU84JukzuF3U7-NRe6klxRdVJmd6_Im7_qySb_5=w1045-h542-no?authuser=1" alt="TWCA SSL 憑證：上傳 CSR 1" style="width:784px;height:407px" title="向 TWCA 申請 SSL 憑證 (Ubuntu, Apache)"></figure></div>


<p>確認紅框內的資訊後，輸入密碼、選擇驗證網域的方式、及表單編號</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AL9nZEUqolhtYlj23TU_asHRoGOkYyLZmY0q1f9IvsjnYS55DsJ6EXJ_g8Id2rfakMgph2jwTvRMeYCobOnt9aFObIzIpfaXtEzkp4FkCwmmLJGGqe2-1o80Rk97cSPzuNNHBsDYtGfHbNsTAObyCkZbefFI=w1108-h1023-no?authuser=1" alt="TWCA SSL 憑證：上傳 CSR 2" title="向 TWCA 申請 SSL 憑證 (Ubuntu, Apache)"></figure></div>


<p>點擊繼續後即上傳完成</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AL9nZEXQAtelMnZH8S-ITRuLhOr_yzNo6nLJJxRRNiIJO5kY_QpojlFzhT28LG7o6d86OqZO_3UsYZhqy6zzmF-VaMOpcD8rSz11S1rDIGYbdjthRH0dahHm_3d5MOAOdGERglUcxgj85jDs9raoXsL5OK2p=w684-h245-no?authuser=1" alt="TWCA SSL 憑證：上傳 CSR 3" style="width:513px;height:184px" title="向 TWCA 申請 SSL 憑證 (Ubuntu, Apache)"></figure></div>


<h3 class="wp-block-heading para">驗證網域所有權</h3>



<p>小蛙這邊使用的是「網站檔案驗證」(上一步選擇的)，收到操作手冊與驗證檔</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AL9nZEX4VoKr55HSOfIw9uQM_tnFTnwFi66y-mKKKeoMZ7nGDLhSXbn-W7-zYebDhdnOroC_NaWLwg2WgTPrSsC1szr1c3FyAi8pKZpzme3eZ4uCcSxXKtgjjb28m3z-pcRDHLxPsMiJkWQL8fb62ziSOZEi=w944-h664-no?authuser=1" alt="TWCA SSL 憑證：驗證網域" style="width:708px;height:498px" title="向 TWCA 申請 SSL 憑證 (Ubuntu, Apache)"></figure></div>


<p>在網站根目錄建立對應的資料夾及 <code>whois.txt</code> 檔案，並將 email 附件中的 whois.txt 貼上，也可以直接把附件中的檔案解壓縮後，直接上傳到網站根目錄中。例如小蛙的網站根目錄是 <code>/var/www/html/</code> </p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">mkdir -p /var/www/html/.well-known/pki-validation/
vim /var/www/html/.well-known/pki-validation/whois.txt</pre>



<p>完成後確定從 email 給的連結可以看到剛剛的 whois.txt 檔案，即可與 TWCA 聯繫進行下一步。</p>



<h2 class="wp-block-heading para">安裝與設定 1.電子憑證 2.認證標章</h2>



<p>等待 TWCA 審核完成後收到一封 email 及一個壓縮檔，解壓縮後包含我們前面產生的檔案，共有以下</p>



<ol class="my-li bg-darkblue wp-block-list">
<li>server.key 伺服器金鑰</li>



<li>server.csr TWCA CSR 憑證申請檔</li>



<li>root.cer 根憑證</li>



<li>server.cer 伺服器憑證</li>



<li>uca.cer 中繼憑證</li>
</ol>



<p>這邊會用到的為 1, 4, 5 三個檔案，如果收到的檔案是 <code>uca_1.cer</code> 跟 <code>uca_2.cer</code>，可先透過 <code>cat uca_2.cer uca_1.cer &gt; uca.cer</code> 將檔案合併成一個。</p>



<p>以小蛙自己的環境 Apache2.4 為例，首先複製一份預設的檔案出來改</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-default-le-ssl.conf
vim /etc/apache2/sites-available/000-default-le-ssl.conf</pre>



<pre class="EnlighterJSRAW" data-enlighter-language="ini" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">&lt;IfModule mod_ssl.c>
&lt;VirtualHost *:443>
        ServerName 改成 TWCA 申請 SSL 的網址
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        Include /etc/letsencrypt/options-ssl-apache.conf  # 這個是因為小蛙有使用 letsencrypt
        SSLCertificateFile /etc/ssl/server.cer            # 加上這個
        SSLCertificateKeyFile /etc/ssl/server.key         # 加上這個
        SSLCertificateChainFile /etc/ssl/uca.cer          # 加上這個
&lt;/VirtualHost>
&lt;/IfModule></pre>



<p>儲存後啟用該站點，檢查沒問題後重起 apache 就完成囉！</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">a2ensite 000-default-le-ssl.conf
apache2ctl configtest
Syntax OK
service apache2 graceful</pre>



<p><strong>增加安全性系列：</strong></p>



<ul class="my-li bg-darkblue wp-block-list"><li><a href="https://noter.tw/10420/向-twca-申請-ssl-憑證-ubuntu-apache/" data-wpel-link="internal">向 TWCA 申請 SSL 憑證 (Ubuntu, Apache)</a></li><li><a href="https://noter.tw/34/ubuntu-16-04-%E5%8D%87%E7%B4%9A-phpmyadmin-%E4%B8%A6%E9%96%8B%E5%95%9F%E4%BA%8C%E9%9A%8E%E6%AE%B5%E9%A9%97%E8%AD%89-2fa/" data-wpel-link="internal">Ubuntu 16.04 升級 phpMyAdmin 並開啟二階段驗證( 2FA )</a></li><li><a href="https://noter.tw/255/ubuntu-16-04-安裝-fail2ban/" data-wpel-link="internal">Ubuntu 16.04 安裝 fail2ban</a></li></ul>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/10420/%e5%90%91-twca-%e7%94%b3%e8%ab%8b-ssl-%e6%86%91%e8%ad%89-ubuntu-apache/" data-wpel-link="internal">向 TWCA 申請 SSL 憑證 (Ubuntu, Apache)</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://noter.tw/10420/%e5%90%91-twca-%e7%94%b3%e8%ab%8b-ssl-%e6%86%91%e8%ad%89-ubuntu-apache/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>盤點那些曾經陪伴過小蛙的 VPS 虛擬主機</title>
		<link>https://noter.tw/10151/vps/</link>
					<comments>https://noter.tw/10151/vps/#respond</comments>
		
		<dc:creator><![CDATA[黃小蛙]]></dc:creator>
		<pubDate>Sun, 14 Aug 2022 14:10:17 +0000</pubDate>
				<category><![CDATA[伺服器]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[開箱、使用心得]]></category>
		<category><![CDATA[DesiVPS]]></category>
		<category><![CDATA[Artic Host]]></category>
		<category><![CDATA[Liveinhost]]></category>
		<category><![CDATA[HiFormance]]></category>
		<category><![CDATA[Hostflyte]]></category>
		<category><![CDATA[DirectSpace]]></category>
		<category><![CDATA[虛擬主機評價]]></category>
		<category><![CDATA[ChicagoVPS]]></category>
		<category><![CDATA[虛擬主機租用]]></category>
		<category><![CDATA[虛擬主機 心得分享]]></category>
		<category><![CDATA[VPS 虛擬主機]]></category>
		<category><![CDATA[linode]]></category>
		<category><![CDATA[Racknerd]]></category>
		<category><![CDATA[Pacificrack]]></category>
		<guid isPermaLink="false">https://noter.tw/?p=10151</guid>

					<description><![CDATA[<p>第一次使用 VPS 是前同事把他不要的 VPS 給小蛙玩，用了之後決定自己也買一台，從以前到現在總共用過 DirectSpace、linode、ChicagoVPS、HiFormance、Racknerd、Pacificrack、DesiVPS、Artic Host、Liveinhost、Hostflyte ... 等，這些裡面有些過程很慘痛，有些到現在小蛙還在使用，大部份都是較低價的虛擬主機，不過低價主機真的要靠運氣，聽小蛙娓娓道來～</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/10151/vps/" data-wpel-link="internal">盤點那些曾經陪伴過小蛙的 VPS 虛擬主機</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>小蛙從使用虛擬主機 VPS 到現在，換過好多不同廠牌的 VPS，這篇大概把小蛙租用過 VPS 的心得記下來。</p>



<span id="more-10151"></span>



<p>第一次使用 VPS 是前同事把他不要的 VPS 給小蛙玩，用了之後決定自己也買一台，從以前到現在總共用過 DirectSpace、linode、ChicagoVPS、HiFormance、Racknerd、Pacificrack、DesiVPS、Artic Host、Liveinhost、Hostflyte &#8230; 等，這些裡面有些過程很慘痛，有些到現在小蛙還在使用，大部份都是較低價的虛擬主機，不過低價主機真的要靠運氣，聽小蛙娓娓道來～</p>



<p>小蛙在下面這篇文章有分享一些心得，包括怎麼挑選以及怎麼買可以更便宜</p>



<figure class="wp-block-embed aligncenter is-type-wp-embed is-provider-記下來 wp-block-embed-記下來"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="1wUQJ5UujI"><a href="https://noter.tw/176/%e5%a6%82%e4%bd%95%e6%8c%91%e9%81%b8-vps-%e6%9c%80%e5%88%92%e7%ae%97%e7%9a%84%e8%b2%b7%e6%b3%95/" data-wpel-link="internal">如何挑選 VPS + 最划算的買法</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="如何挑選 VPS + 最划算的買法 &#8212; 記下來" src="https://noter.tw/176/%e5%a6%82%e4%bd%95%e6%8c%91%e9%81%b8-vps-%e6%9c%80%e5%88%92%e7%ae%97%e7%9a%84%e8%b2%b7%e6%b3%95/embed/#?secret=937rvgcP5x#?secret=1wUQJ5UujI" data-secret="1wUQJ5UujI" width="500" height="282" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>



<figure class="wp-block-embed is-type-wp-embed is-provider-記下來 wp-block-embed-記下來"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="41kbtFMmRx"><a href="https://noter.tw/406/%e6%89%8b%e6%8a%8a%e6%89%8b%e6%95%99%e4%bd%a0%e5%a6%82%e4%bd%95%e8%b3%bc%e8%b2%b7-vps/" data-wpel-link="internal">手把手教你如何購買 VPS</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="手把手教你如何購買 VPS &#8212; 記下來" src="https://noter.tw/406/%e6%89%8b%e6%8a%8a%e6%89%8b%e6%95%99%e4%bd%a0%e5%a6%82%e4%bd%95%e8%b3%bc%e8%b2%b7-vps/embed/#?secret=egXErTQSjs#?secret=41kbtFMmRx" data-secret="41kbtFMmRx" width="500" height="282" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>



<h2 class="para wp-block-heading">用過那麼多家，心得？</h2>



<p>小蛙回憶一下各家 VPS 的差別跟優缺點（有些是很久以前使用過的，以下為很主觀的感受）</p>



<h3 class="para wp-block-heading">DirectSpace</h3>



<p>官網：<a href="https://directspace.net/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">https://directspace.net/<span class="wpel-icon wpel-image wpel-icon-6"></span></a></p>



<p>是小蛙最早使用的 VPS 主機，有著便宜的價錢，小蛙在使用上沒有什麼問題，原本也覺得會一直用下去，直到有一次遇到主機不停斷線，每次斷線都維持一段時間，資料也救不回來，陷入了無限重灌地獄，於是放棄了這家。由於是非常早期使用的，小蛙不清楚現在品質有沒有改善，不過也不太敢再去嘗試了～</p>



<figure class="wp-block-embed is-type-wp-embed is-provider-記下來 wp-block-embed-記下來"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="ZDwddhTtBS"><a href="https://noter.tw/2217/%e8%ae%93%e4%ba%ba%e5%8f%88%e6%84%9b%e5%8f%88%e6%81%a8%e7%9a%84directspace/" data-wpel-link="internal">(改標題：令人憤怒的DirectSpace)讓人又愛又恨的DirectSpace</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="(改標題：令人憤怒的DirectSpace)讓人又愛又恨的DirectSpace &#8212; 記下來" src="https://noter.tw/2217/%e8%ae%93%e4%ba%ba%e5%8f%88%e6%84%9b%e5%8f%88%e6%81%a8%e7%9a%84directspace/embed/#?secret=ZBixd9IgCJ#?secret=ZDwddhTtBS" data-secret="ZDwddhTtBS" width="500" height="282" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>



<h3 class="para wp-block-heading">linode</h3>



<p>官網：<a href="https://www.linode.com/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">https://www.linode.com/<span class="wpel-icon wpel-image wpel-icon-6"></span></a></p>



<p>非常穩定又老牌的一家公司，網路上有非常多人使用以及推薦，小蛙之前都是買最低規格一年份方案，來跑一些負載量比較不重的服務，後來就不確定還有沒有這些方案了，不過 linode 的穩定性應該還是不容質疑的。</p>



<h3 class="para wp-block-heading">ChicagoVPS</h3>



<p>官網：<a href="https://www.chicagovps.net/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">https://www.chicagovps.net/<span class="wpel-icon wpel-image wpel-icon-6"></span></a></p>



<p>小蛙用最最最久的 VPS（看第一筆付費紀錄是在 2012 年），當時在 <a href="https://lowendbox.com/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">LowEndBox<span class="wpel-icon wpel-image wpel-icon-6"></span></a> 上看到不少人推薦，於是就買了下來，使用上大致上沒有遇到什麼大問題，用了那麼久偶爾還是會遇到無法連線的問題（這很難避免，再穩的主機都可能會遇到，重點是常不常以及容不容易出問題），曾幾次在 Black Friday 黑色星期五時看到更划算的方案果斷交換，目前小蛙使用 2014 年撿到的方案：<strong>記憶體 2GB、流量 2TB 及儲存空間 30GB</strong>，3 年只要 49 元美金（現在已經很難撿到這種優惠了，後續價格提高且提供更穩定的品質也是一件好事！）</p>



<h3 class="para wp-block-heading">HiFormance</h3>



<p>官網：無、掛了、跑路了。</p>



<p>HiFormance 曾經一度是小蛙非常喜歡的主機商，因為它規格高又非常便宜、連線速度各方面都很棒，當時小蛙在 LowEndBox 上看到 HiFormance 越來越便宜的方案，沒有警覺還很開心，現在想想真的是太笨了，直到有一天，本來都會回覆的客服面對一堆當機及無法連線時都沒有回應 &#8230; </p>



<figure class="wp-block-embed is-type-wp-embed is-provider-記下來 wp-block-embed-記下來"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="fTrKpPGIZf"><a href="https://noter.tw/4242/%e8%a1%80%e7%9a%84%e6%95%99%e8%a8%93-hiformance-%e8%b7%91%e8%b7%af%e4%ba%86/" data-wpel-link="internal">血的教訓 &#8211; HiFormance 跑路了 &#8230;</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="血的教訓 &#8211; HiFormance 跑路了 &#8230; &#8212; 記下來" src="https://noter.tw/4242/%e8%a1%80%e7%9a%84%e6%95%99%e8%a8%93-hiformance-%e8%b7%91%e8%b7%af%e4%ba%86/embed/#?secret=ZemZrwM859#?secret=fTrKpPGIZf" data-secret="fTrKpPGIZf" width="500" height="282" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>



<h3 class="para wp-block-heading">Hostflyte</h3>



<p>官網：<a href="https://hostflyte.com/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">https://hostflyte.com/<span class="wpel-icon wpel-image wpel-icon-6"></span></a></p>



<p>這是小蛙買的第一台 KVM 虛擬主機，之前都是 OpenVZ 架構，買這台是為了可以練習 docker，結果沒用幾個月這家又開始出狀況，上網查了一下才知道它跟 HiFormance 同一個金主，小蛙寫這篇文章的時候 Hostflyte 又復活了，不確定是有新的金主接盤了還是什麼狀況，不過小蛙當時因為整個 Hostflyte 跑路而也放棄這家主機</p>



<figure class="wp-block-embed is-type-wp-embed is-provider-記下來 wp-block-embed-記下來"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="GXLuZDYgzh"><a href="https://noter.tw/4463/%e7%ac%ac%e4%b8%80%e6%ac%a1%e8%b2%b7-kvm-%e8%99%9b%e6%93%ac%e4%b8%bb%e6%a9%9f/" data-wpel-link="internal">第一次買 KVM 虛擬主機</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="第一次買 KVM 虛擬主機 &#8212; 記下來" src="https://noter.tw/4463/%e7%ac%ac%e4%b8%80%e6%ac%a1%e8%b2%b7-kvm-%e8%99%9b%e6%93%ac%e4%b8%bb%e6%a9%9f/embed/#?secret=6Yoju5mYge#?secret=GXLuZDYgzh" data-secret="GXLuZDYgzh" width="500" height="282" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>



<h3 class="para wp-block-heading">Racknerd</h3>



<p>官網：<a href="https://www.racknerd.com/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">https://www.racknerd.com/<span class="wpel-icon wpel-image wpel-icon-6"></span></a></p>



<p>也是小蛙想要有 KVM 虛擬主機、加上在 LowEndBox 上看到這家超級便宜、規格又高，於是跳進去買的，現在在 LowEndBox 上還是可以看到 Racknerd 很活躍，經常推出便宜方案以及特殊活動方案，讓小蛙有種 HiFormance 的感覺（一朝被蛇咬，十年怕草繩），希望金主不要步上 HiFormance 的後塵。目前 Racknerd 仍在服役中，小蛙從台灣連美西的主機，使用起來有時有種卡頓的感覺，不清楚原因，小蛙同樣在美西的 ChicagoVPS 不會有這種感覺。</p>



<h3 class="para wp-block-heading">Pacificrack</h3>



<p>官網：<a href="https://pacificrack.com/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">https://pacificrack.com/<span class="wpel-icon wpel-image wpel-icon-6"></span></a></p>



<p>以下四個主機上是小蛙用來跑特定服務而租的主機，會買它們主要是便宜或是在「特定區域」，Pacificrack  在小蛙把服務設定好，就讓它放著固定跑，很少動到這台，目前仍正常服役中。</p>



<h3 class="para wp-block-heading">DesiVPS</h3>



<p>官網：<a href="https://www.desivps.com/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">https://www.desivps.com/<span class="wpel-icon wpel-image wpel-icon-6"></span></a></p>



<p>同 Pacificrack，因特殊目的而購買，使用上沒有什麼特別的感覺，可能因為租用距離台灣比較線路不友善的荷蘭，因此操作時的頓挫非常明顯。</p>



<h3 class="para wp-block-heading">Artic Host</h3>



<p>官網：https://www.artichost.com/</p>



<p>貌似跑路了，目前官網連不上，小蛙收到的最後一封信是 2021 年 7 月 2 日。</p>



<h3 class="para wp-block-heading">Liveinhost</h3>



<p>官網：https://www.liveinhost.com/</p>



<p>買了英國及法國的 Windows 主機，除了距離太遙遠之外，也可能是記憶體太少，遠端操作起來非常卡頓，台灣使用者要買的話要特別注意線路速度的問題。</p>



<p>以上是小蛙自己實際使用過的 VPS 以及主觀感受，希望對正好要租用 VPS 朋友們有幫助，最近正忙著把機器搬到 Vultr 上，之後再找時間補上 Vultr 的介紹。</p>



<p><strong>網站架設系列文章：</strong></p>



<ul class="my-li bg-darkblue wp-block-list"><li><a href="https://noter.tw/10151/%e7%9b%a4%e9%bb%9e%e9%82%a3%e4%ba%9b%e6%9b%be%e7%b6%93%e9%99%aa%e4%bc%b4%e9%81%8e%e5%b0%8f%e8%9b%99%e7%9a%84-vps-%e8%99%9b%e6%93%ac%e4%b8%bb%e6%a9%9f/" data-wpel-link="internal">盤點那些曾經陪伴過小蛙的 VPS 虛擬主機</a></li><li><a href="https://noter.tw/176/%e5%a6%82%e4%bd%95%e6%8c%91%e9%81%b8-vps-%e6%9c%80%e5%88%92%e7%ae%97%e7%9a%84%e8%b2%b7%e6%b3%95/" data-wpel-link="internal">如何挑選 VPS + 最划算的買法</a></li><li><a href="https://noter.tw/406/%E6%89%8B%E6%8A%8A%E6%89%8B%E6%95%99%E4%BD%A0%E5%A6%82%E4%BD%95%E8%B3%BC%E8%B2%B7-vps/" data-wpel-link="internal">手把手教你如何購買 VPS</a></li><li><a href="https://noter.tw/4463/第一次買-kvm-虛擬主機/" data-wpel-link="internal">第一次買 KVM 虛擬主機</a></li><li><a href="https://noter.tw/4242/%e8%a1%80%e7%9a%84%e6%95%99%e8%a8%93-hiformance-%e8%b7%91%e8%b7%af%e4%ba%86/" data-wpel-link="internal">血的教訓 &#8211; HiFormance 跑路了 &#8230;</a></li><li><a href="https://noter.tw/196/%e7%82%ba%e8%87%aa%e5%b7%b1%e7%94%b3%e8%ab%8b%e4%b8%80%e5%80%8b%e5%9f%9f%e5%90%8d-hinet-%e7%82%ba%e4%be%8b/" data-wpel-link="internal">為自己申請一個域名 – HiNet 為例</a></li><li><a href="https://noter.tw/117/cloudflare-%E8%B6%85%E5%BC%B7%E5%A4%A7%E7%9A%84%E5%85%8D%E8%B2%BB-cdn/" data-wpel-link="internal">Cloudflare – 超強大的免費 CDN (?)</a></li><li><a href="https://noter.tw/195/%e4%bd%bf%e7%94%a8-cloudflare-%e4%bb%a3%e7%ae%a1%e4%bd%a0%e7%9a%84%e5%9f%9f%e5%90%8d/" data-wpel-link="internal">使用 Cloudflare 代管你的域名</a></li><li><a href="https://noter.tw/396/ubuntu-16-04-設定環境語言編碼，讓中文可以正常顯示/" data-wpel-link="internal">Ubuntu 16.04 設定環境語言編碼，讓中文可以正常顯示</a></li><li><a href="https://noter.tw/255/ubuntu-16-04-%e5%ae%89%e8%a3%9d-fail2ban/" data-wpel-link="internal">Ubuntu 16.04 安裝 fail2ban</a></li><li><a href="https://noter.tw/436/%E4%B8%80%E5%80%8B%E8%85%B3%E6%9C%AC%E6%AF%8F%E5%A4%A9%E8%87%AA%E5%8B%95%E5%82%99%E4%BB%BD/" data-wpel-link="internal">一個腳本每天自動備份</a></li><li><a href="https://noter.tw/32/linux-tar-%E5%AE%8C%E6%95%B4%E5%82%99%E4%BB%BD%E3%80%81%E5%A2%9E%E9%87%8F%E5%82%99%E4%BB%BD%E5%8F%8A%E5%B7%AE%E7%95%B0%E5%82%99%E4%BB%BD%E6%AF%94%E8%BC%83/" data-wpel-link="internal">Linux tar 完整備份、增量備份及差異備份比較</a></li><li><a href="https://noter.tw/3704/nginx-ssl-certificate-%E8%AE%93-http-%E8%AE%8A%E8%BA%AB%E6%88%90%E7%82%BA-https/" data-wpel-link="internal">nginx + SSL Certificate – 讓 http 變身成為 https</a></li><li><a href="https://noter.tw/3695/ssl-for-free-%E5%85%8D%E8%B2%BB%E5%8F%88%E6%9C%89%E7%B6%A0%E8%89%B2%E9%8E%96%E9%A0%AD%E7%9A%84-ssl-certificates/" data-wpel-link="internal">SSL For Free – 免費又有綠色鎖頭的 SSL Certificates</a></li><li><a href="https://noter.tw/8596/certbot-error/" data-wpel-link="internal">Certbot 申請 SSL certificate 錯誤問題</a></li><li><a href="https://noter.tw/9107/certbot-error-acmev1-is-deprecated/" data-wpel-link="internal">Certbot 錯誤：ACMEv1 is deprecated and you can …</a></li><li><a href="https://noter.tw/5967/ubuntu-18-04-%e5%ae%89%e8%a3%9d-awstats-%e4%be%86%e7%b5%b1%e8%a8%88%e7%b6%b2%e7%ab%99%e6%b5%81%e9%87%8f/" data-wpel-link="internal">Ubuntu 18.04 安裝 AWStats 來統計網站流量</a></li><li><a href="https://noter.tw/9287/pchome-%e8%b2%b7%e7%b6%b2%e5%9d%80%e7%ba%8c%e7%b4%84%e6%b5%81%e7%a8%8b/" data-wpel-link="internal">PCHome 買網址續約流程</a></li></ul>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/10151/vps/" data-wpel-link="internal">盤點那些曾經陪伴過小蛙的 VPS 虛擬主機</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://noter.tw/10151/vps/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Unable to locally verify the issuer&#8217;s authority. To connect to &#8230; insecurely, use `&#8211;no-check-certificate&#8217;.</title>
		<link>https://noter.tw/10130/unable-to-locally-verify-the-issuers-authority-to-connect-to-insecurely-use-no-check-certificate/</link>
					<comments>https://noter.tw/10130/unable-to-locally-verify-the-issuers-authority-to-connect-to-insecurely-use-no-check-certificate/#respond</comments>
		
		<dc:creator><![CDATA[黃小蛙]]></dc:creator>
		<pubDate>Sun, 14 Aug 2022 06:54:03 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[伺服器]]></category>
		<category><![CDATA[--no-check-certificate]]></category>
		<category><![CDATA[wget]]></category>
		<guid isPermaLink="false">https://noter.tw/?p=10130</guid>

					<description><![CDATA[<p>從舊主機移機到新主機的過程中發現有些 crontab 裡的腳本不動了，檢查後發現「Unable to locally verify the issuer&#8217;s authority.」的錯誤，&#46;&#46;&#46;</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/10130/unable-to-locally-verify-the-issuers-authority-to-connect-to-insecurely-use-no-check-certificate/" data-wpel-link="internal">Unable to locally verify the issuer&#8217;s authority. To connect to &#8230; insecurely, use `&#8211;no-check-certificate&#8217;.</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>從舊主機移機到新主機的過程中發現有些 crontab 裡的腳本不動了，檢查後發現「Unable to locally verify the issuer&#8217;s authority.」的錯誤，這邊文章把解決的方法記下來。</p>



<span id="more-10130"></span>



<p>小蛙在新主機上使用 wget 的時候發現沒辦法正常使用，會出現以下訊息</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">root@vultr:~# wget https://www.google.com.tw/

ERROR: cannot verify www.goog.com.tw's certificate, issued by ‘....’:
  Unable to locally verify the issuer's authority.
To connect to www.google.com.tw insecurely, use `--no-check-certificate'.</pre>



<p>試了 <code>wget --no-check-certificate</code> 之後的確可以存取了，不過有些也有用到 wget 的套件內容就沒辦法這樣處理了，必須從根本上解決。例如：使用到 <a href="https://www.php.net/manual/en/function.file-get-contents.php" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">file_get_contents<span class="wpel-icon wpel-image wpel-icon-6"></span></a> 的 <a href="https://simplehtmldom.sourceforge.io/docs/1.9/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">simple_html_dom<span class="wpel-icon wpel-image wpel-icon-6"></span></a> 也沒辦法使用</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in simple_html_dom.php on line 82

Warning: file_get_contents(): Failed to enable crypto in simple_html_dom.php on line 82

Warning: file_get_contents(https://xxx...): failed to open stream: operation failed in simple_html_dom.php on line 82

Fatal error: Uncaught Error: Call to a member function find() on bool in parseC.php:106
Stack trace:
#0 {main}
  thrown in parseC.php on line 106</pre>



<p>上 <a href="https://serverfault.com/questions/314635/why-wget-doesnt-verify-ssl-certificates" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">serverfault.com<span class="wpel-icon wpel-image wpel-icon-6"></span></a> 查到以下這個方法：</p>



<ol class="my-li bg-darkblue wp-block-list"><li>下載 ca-certificates<br><code>sudo apt install ca-certificates</code></li><li>編輯使用 wget 的時候使用的設定檔<br><code>sudo vim /etc/wgetrc</code></li><li>在檔案最下面加入<br><code>ca_directory=/etc/ssl/certs</code></li></ol>



<p>打完收工，再試一次 wget 不會再噴錯了，留給有需要的人（感謝 <a href="https://serverfault.com/users/156244/jared" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">Jared<span class="wpel-icon wpel-image wpel-icon-6"></span></a> 大大，參考自：<a href="https://serverfault.com/questions/314635/why-wget-doesnt-verify-ssl-certificates" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">Why wget doesn&#8217;t verify SSL certificates? @ serverfault.com<span class="wpel-icon wpel-image wpel-icon-6"></span></a>）</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AL9nZEVYOgASjox_YUPIXuSmQilPYAIyB2dNKAFDKL_J0IqvcQx2_6byc1IWjJGKjOh7e_cE5tfccTIjmbQZkqVjN7EI4ynXcvokcUPyAZ1I_SI0SgrPCaV0yQJC46o2xi4MybayAoc13d1WDCzMoe5y3V45=w1457-h1024-no?authuser=2" alt="AL9nZEVYOgASjox YUPIXuSmQilPYAIyB2dNKAFDKL J0IqvcQx2 6byc1IWjJGKjOh7e cE5tfccTIjmbQZkqVjN7EI4ynXcvokcUPyAZ1I SI0SgrPCaV0yQJC46o2xi4MybayAoc13d1WDCzMoe5y3V45=w1457 h1024 no?authuser=2 Unable to locally verify the issuer&#039;s authority. To connect to ... insecurely, use `--no-check-certificate&#039;." width="729" height="512" title="Unable to locally verify the issuer&#039;s authority. To connect to ... insecurely, use `--no-check-certificate&#039;."></figure></div><p>這篇文章 <a rel="nofollow" href="https://noter.tw/10130/unable-to-locally-verify-the-issuers-authority-to-connect-to-insecurely-use-no-check-certificate/" data-wpel-link="internal">Unable to locally verify the issuer&#8217;s authority. To connect to &#8230; insecurely, use `&#8211;no-check-certificate&#8217;.</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://noter.tw/10130/unable-to-locally-verify-the-issuers-authority-to-connect-to-insecurely-use-no-check-certificate/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>如何將資料從 Linux 裝置 備份 至 Synology NAS</title>
		<link>https://noter.tw/9146/linux-rsync-to-synology-nas/</link>
					<comments>https://noter.tw/9146/linux-rsync-to-synology-nas/#respond</comments>
		
		<dc:creator><![CDATA[黃小蛙]]></dc:creator>
		<pubDate>Sat, 14 Aug 2021 07:00:32 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[技術相關]]></category>
		<category><![CDATA[Synology Drive]]></category>
		<category><![CDATA[公鑰登入]]></category>
		<category><![CDATA[版本控管]]></category>
		<category><![CDATA[PubkeyAuthentication]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[AuthorizedKeysFile]]></category>
		<category><![CDATA[同步檔案]]></category>
		<category><![CDATA[建立公私鑰]]></category>
		<category><![CDATA[Synology rsync]]></category>
		<category><![CDATA[ssh-keygen -t rsa]]></category>
		<category><![CDATA[administrators]]></category>
		<category><![CDATA[ssh key]]></category>
		<category><![CDATA[備份]]></category>
		<category><![CDATA[開啟家目錄服務]]></category>
		<category><![CDATA[ssh-copy-id]]></category>
		<category><![CDATA[教學]]></category>
		<category><![CDATA[資源回收桶]]></category>
		<category><![CDATA[Synology SSH]]></category>
		<category><![CDATA[分享]]></category>
		<category><![CDATA[免輸入帳號密碼登入]]></category>
		<category><![CDATA[Synology NAS]]></category>
		<category><![CDATA[免帳密登入]]></category>
		<guid isPermaLink="false">https://noter.tw/?p=9146</guid>

					<description><![CDATA[<p>這篇文章要記錄幫好友設定，將 Linux 的資料定時 備份 到 Synology NAS 上，試圖透過 Synology Drive 來幫忙做檔案版本的控管。 這篇文章查了一些資料，參考了 如何將資料&#46;&#46;&#46;</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/9146/linux-rsync-to-synology-nas/" data-wpel-link="internal">如何將資料從 Linux 裝置 備份 至 Synology NAS</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>這篇文章要記錄幫好友設定，將 Linux 的資料定時 備份 到 <a href="https://www.synology.com/zh-tw" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">Synology NAS<span class="wpel-icon wpel-image wpel-icon-6"></span></a> 上，試圖透過 Synology Drive 來幫忙做檔案版本的控管。</p>



<span id="more-9146"></span>



<p>這篇文章查了一些資料，參考了 <a href="https://kb.synology.com/zh-tw/DSM/tutorial/How_to_back_up_Linux_computer_to_Synology_NAS" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">如何將資料從 Linux 裝置備份至 Synology NAS？<span class="wpel-icon wpel-image wpel-icon-6"></span></a> <a href="https://blog.gtwang.org/linux/rsync-local-remote-file-synchronization-commands/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">Linux 使用 rsync 遠端檔案同步與備份工具教學與範例<span class="wpel-icon wpel-image wpel-icon-6"></span></a>、<a href="https://silica.io/using-ssh-key-authentification-on-a-synology-nas-for-remote-rsync-backups/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">Using SSH key authentification on a Synology NAS for remote rsync backups<span class="wpel-icon wpel-image wpel-icon-6"></span></a>、 <a href="https://www.theshell.guru/logging-rsync-output-to-file/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">Logging RSYNC output to file<span class="wpel-icon wpel-image wpel-icon-6"></span></a>、<a href="https://blog.gtwang.org/linux/linux-crontab-cron-job-tutorial-and-examples/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">Linux 設定 crontab 例行性工作排程教學與範例<span class="wpel-icon wpel-image wpel-icon-6"></span></a>，加上小蛙自己設定時候遇到的狀況，留給有需要的朋友參考。</p>



<h2 class="para wp-block-heading">Synology NAS？</h2>



<p>Synology NAS 提供了很方便的 client，在有 GUI 的環境裡直接設定好目錄，只要檔案有所變動就會自動同步到 NAS 上，而且跟 Google 雲端硬碟一樣，檔案每次變動的歷程都會記錄著，如果檔案改壞了要找回某個時間點的版本，超級方便！雖然 client 也支援 Linux，不過沒有 GUI 的 Sever 版本就沒有了，只適用於有桌面環境的 Linux。</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AM-JKLWDoCFFUBvKUzSvT567f5pQMGw4gu162LYrxDfidjp9Lp5A9PGepZfjoRfOJOQM2iU_GAw-iwBRn3PXl-QzIWa2PUHIb6RFROIw9IAZaN46crERE5iPN6ZqDRxZfh0VGmblXsHflAQsfPWkhOBMvDhicg=w801-h524-no?authuser=3" alt="Synology Drive History" title="如何將資料從 Linux 裝置 備份 至 Synology NAS"></figure></div>


<h2 class="para wp-block-heading">沒有桌面環境的 Linux 怎麼辦？</h2>



<p>沒有桌面環境的 Linux 也不用擔心，像小蛙今天要使用的就是沒有桌面環境的 Ubuntu 16.04 LTS，Synology 官方的文件提到可以用 CIFS 或 NFS 掛載的方式，或是不透過掛載，直接將資料 rsync 進 NAS 裡，雖然一樣可以將資料同步到 NAS 裡，但跟官方提供的 client 比起來，少了檔案變動會自動同步的功能，必須要自己設定 crontab 定期進行同步 (雖有一點不怎麼完美，但比完全用不了又好上不少！)</p>



<p>操作主要分成 NAS 環境上的設定以及要同步伺服器上的設定，有些步驟會交叉到，小蛙就順著流程講下去。</p>



<h2 class="para wp-block-heading">開啟 rsync 服務</h2>



<p class="withcode">首先開啟瀏覽器用在 <code>administrators</code> 群組內的使用者登入 NAS -&gt; 控制台 (1) -&gt; 檔案服務 (2) -&gt; 啟動 rsync 服務 (3) -&gt; 套用 (4)</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AM-JKLUt9Yfj05r_tYC7Y3x5wXS5F5yeRzBpCLlQIckz-2c0xrNG4bB1WShnrhneEIwYuHjrD2P_5hzCxrGRIYYEfZnQcXHKtC-35GEFZWogjR8tt5pKC9_GWoqXY5CToaPE97F2CpXSAhHq-LT0eAOsNS4P-A=w995-h571-no?authuser=3" alt="Synology NAS 啟動 rsync 服務" title="如何將資料從 Linux 裝置 備份 至 Synology NAS"></figure></div>


<h2 class="para wp-block-heading">指定 rsync 權限給特定使用者</h2>



<p>進入使用者帳號 (1) -&gt; 選取要使用 rsync 的使用者 (2) -&gt; 點擊編輯按鈕 (3)</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AM-JKLW0niFG3eHs8xtcZoIaCUF6ZZTbHqSpjNoGASLwnIr4XtJabgietIU58HBsz4sGtZEcOQRpWkFYJ1CuC1Hem4WseFEY4wv3x_3OXggo66P1aSjv5cAMI9QhP2qB1Gb82i3cKAZAsMW7fcnZhEP53gp8YA=w993-h569-no?authuser=3" alt="Synology NAS 指定權限 1" title="如何將資料從 Linux 裝置 備份 至 Synology NAS"></figure></div>


<p>設定可讀寫的資料夾，切換到權限頁籤 (1) -&gt; 找到要 rsync 的使用者，將可讀寫打勾 (2) -&gt; 按下確定</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AM-JKLXfRQ3a6O-F0-AcYBwgfEQlEyw7i-ahiV-aHIXJInz_OPmYjgYopml0tGB5h8Xn4IGTdLuxwXu5mXctLqBcdlrmh-Z3Fo84eimw_1XvZVB9jeg_03oHfgjfLPwTlzYHmbvPZgTxMe5bTA0ynOKbi3gcsg=w907-h517-no?authuser=3" alt="Synology NAS 指定權限 2" title="如何將資料從 Linux 裝置 備份 至 Synology NAS"></figure></div>


<p>為了要讓 rsync 免輸入帳號密碼，在這邊先暫時把要進行 rsync 的帳號加入 administrators 群組，等等完成設定後再還原設定。</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AM-JKLXrOIoLH8kza8vFs7XfRfbrzJMo20vyXLTKjNJCqskDzSYDqBu0bAoVHqHEPFcqB_qNJzHwxKW4lkFOewDJ3Uyz6TLBOu_thS5T-taAl1WNtIhRKjVFQakQXnWewI2r7iAhD8srPB_uAPWKiVB6ckqa4g=w911-h196-no?authuser=3" alt="Synology NAS 指定權限 3" title="如何將資料從 Linux 裝置 備份 至 Synology NAS"></figure></div>


<h2 class="para wp-block-heading">開啟家目錄與資源回收桶</h2>



<p>小蛙原本接手的時候這兩個都沒開，家目錄如果沒開的話會造成 SSH 沒辦法不輸入帳號密碼自動登入，而資源回收桶沒開的話則會無法留住刪除檔案的記錄，如果誤刪檔案時還能救回來，非常方便建議打開。</p>



<p>回到控制台 -&gt; 進入使用者帳號 (1) -&gt; 上方進階設定 (2) -&gt; 拉到最下面把啟動家目錄服務 (3) 及 啟動資源回收桶 (4) 都打勾，點選下方套用。</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AM-JKLWFt-3mjuij2vsySg0CPC71nahFl91-7U1w66FIquht40hTfOx1JqFutJkbc2fkiCsr49RLf2OppAioX9e_SDwTZ2VKA8DaC_SVLL7GKtnFrEtGFu7S2tRCDoVjk6ueNYoeDVkz1F9lg_GRPUFxts2h6g=w994-h571-no?authuser=3" alt="Synology NAS 啟動家目錄服務與啟動資源回收桶" title="如何將資料從 Linux 裝置 備份 至 Synology NAS"></figure></div>


<h2 class="para wp-block-heading">啟用 SSH 功能</h2>



<p>回到控制台左側選單拉到最下面的終端機 &amp; SNMP (1) -&gt; 啟動 SSH 功能 (2) -&gt; 套用 (3) 來開啟 SSH 功能 </p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AM-JKLX04LZjMAZYqlPxD103UDZmp9LEQwDxT-sPgBW9g4crnLhL_HKYFfmaS-R_1v33jStelZqW55A78iDtNjynh461aADzkZfR130qRhYZxkoCieI1cZxnkyJQhhELAqe4XaFibmQc7UpHNEsK6ZJwIyAzbg=w993-h566-no?authuser=3" alt="Synology NAS 啟動 SSH 功能" title="如何將資料從 Linux 裝置 備份 至 Synology NAS"></figure></div>


<h2 class="para wp-block-heading">測試使用 SSH 登入</h2>



<p class="withcode">現在到要進行檔案同步的 Ubuntu 中進行連線測試，此刻還是要輸入密碼的，如果剛剛沒有將此帳號加入 <code>administrators</code> 群組，這邊就會出現連線被拒絕無法連線的錯誤，如果畫面跟小蛙一樣可以連進去就表示以上的設定都是正確的。</p>



<pre class="wp-block-preformatted withcode">root@xxx:~# ssh myaccount@nas_domain
The authenticity of host 'nas_domain (xx.xx.xx.xx)' can't be established.
ECDSA key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'nas_domain,xx.xx.xx.xx' (ECDSA) to the list of known hosts.
myaccount@nas_domain's password:
myaccount@nas_domain:~$</pre>



<h2 class="para wp-block-heading">建立基本 SSH 所需檔案</h2>



<p class="withcode">NAS 一開始沒有 .ssh 資料夾，所以我們要建立一個 <code>.ssh</code> 資料夾跟 <code>authorized_keys</code> 檔案，並且設定正確的權限</p>



<pre class="wp-block-preformatted withcode"># 建立必須的檔案與資料夾
myaccount@nas_domain:~$ cd ~
myaccount@nas_domain:~$ mkdir .ssh
myaccount@nas_domain:~$ touch .ssh/authorized_keys

# 設定正確權限
myaccount@nas_domain:~$ chmod 0711 ~
myaccount@nas_domain:~$ chmod 0711 ~/.ssh
myaccount@nas_domain:~$ chmod 0600 ~/.ssh/authorized_keys</pre>



<h2 class="para wp-block-heading">設定讓 SSH 接受公鑰驗證登入</h2>



<p>預設 SSH 是透過帳號密碼登入的，這邊要免輸入帳號密碼的話，要將設定改成接受特定公鑰登入的方式</p>



<pre class="wp-block-preformatted withcode">myaccount@nas_domain:~$ sudo su
Password: 輸入 myaccount 的密碼
ash-4.3# vim /etc/ssh/sshd_config

# 把下面兩行前面的 # 拿掉後 :wq 存檔離開
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

# 重啟 sshd DSM 7 以前的
#ash-4.3# synoservicectl --restart sshd

# 重啟 sshd DSM 7 以後的要用這個
ash-4.3# /usr/syno/bin/synosystemctl restart sshd.service

# 退出回到要備份資料的伺服器上
ash-4.3# exit
exit
myaccount@nas_domain:~$ exit
logout
Connection to nas_domain closed.
root@xxxx:~#</pre>



<h2 class="para wp-block-heading">建立伺服器公私鑰</h2>



<p>回到要進行 rsync 的伺服器上，如果還沒有建立過 ssh key 的話，可以使用 <code>ssh-keygen -t rsa</code> 進行建立 (亦可參考 <a href="https://noter.tw/278/%e7%99%bb%e5%85%a5-ssh-%e5%85%8d%e8%bc%b8%e5%85%a5%e5%b8%b3%e8%99%9f%e5%af%86%e7%a2%bc/" target="_blank" rel="noreferrer noopener" data-wpel-link="internal">登入 ssh 免輸入帳號密碼</a> 建立金鑰的方式)</p>



<pre class="wp-block-preformatted withcode">root@xxxxxxx:~# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx root@xxxxxxx
The key's randomart image is:
+---[RSA 2048]----+
+----[SHA256]-----+</pre>



<h2 class="para wp-block-heading">將公鑰複製到 NAS 上</h2>



<p>成功建立金鑰後要把公鑰存入前面我們在 NAS 建立的 <code>authorized_keys</code> 裡面</p>



<pre class="wp-block-preformatted withcode">root@xxxxxxx:~# ssh-copy-id myaccount@nas_domain
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
myaccount@nas_domain's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'myaccount@nas_domain'"
and check to make sure that only the key(s) you wanted were added.</pre>



<p>到這邊就基本完成了，設定正確的話，再試一次真的不用輸入密碼了</p>



<pre class="wp-block-preformatted withcode">root@xxxxxxx:~# ssh myaccount@nas_domain
myaccount@nas_domain:~$</pre>



<h2 class="para wp-block-heading">關閉 SSH 及離開 administrators 群組</h2>



<p class="withcode">這時候可以把 <code>myaccount</code> 從 <code>administrators</code> 群組移除比較安全，除非這個帳號有其他需要用到較高權限的地方，別忘了也把 SSH 功能關閉，除非有必要用到才留著。</p>



<h2 class="para wp-block-heading">使用 rsync 同步</h2>



<p class="withcode">輸入以下指令 <code>--delete</code> 意思是同步的話也要把遠端檔案移到資源回收桶，不加 <code>--delete</code> 的話只會把有變動的檔案同步過去，移除的檔案還是會存在 NAS 上喔！<code>--exclude</code> 是要排除不加入同步的檔案 / 資料夾，NAS 上還要排除資源回收桶 <code>#recycle</code> 及 <code>@eaDir</code> 路徑，不然前者會造成刪除的檔案無法找回，後者則是會不停噴錯 (雖不影響使用但看起來很討厭)</p>



<p class="withcode"><code>-e ssh</code> 是用剛剛我們設定的私鑰進行連線，如此就可以不用輸入密碼，<code>/var/www/</code> 是要進行同步的路徑，最後面的 <code>mydir/</code> 是上面設定可讀寫的資料夾</p>



<pre class="wp-block-preformatted withcode">rsync -avh --delete --exclude '#recycle/' --exclude '@eaDir' -e ssh /var/www/ myaccount@nas_domain::mydir/</pre>



<p class="withcode"><a href="https://www.theshell.guru/logging-rsync-output-to-file/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">Logging RSYNC output to file<span class="wpel-icon wpel-image wpel-icon-6"></span></a> 提到可以加入 <code>--log-file=/path/file.log</code> 與 <code>--progress</code> 可以將執行過程輸出到檔案，不過如果檔案非常大的話，這個 log 檔也會非常大喔！小蛙提供這個做法，可以做完 <code>rsync</code> 之後有個參考依據，知道那些檔案成功哪些檔案出問題，自己視情況斟酌是否加入。</p>



<p>實際測試看看，修改的檔案跟刪除的都成功了！</p>



<pre class="wp-block-preformatted withcode">root@xxxxxxx:~# rsync -avh --delete --exclude '#recycle/' --exclude '@eaDir' -e ssh /root/backup/ myaccount@nas_domain::mydir/
sending incremental file list
./
deleting www1
deleting www
mod-pagespeed-stable_current_amd64.deb

sent 8,311,426 bytes  received 56 bytes  2,374,709.14 bytes/sec
total size is 8,309,240  speedup is 1.00</pre>



<p>正式跑起來看看</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AM-JKLU2luQpL0vUOEBp438JvM71nDh2mw_hLXa3BMSO7vb00J2bS4rsLPolCZL1hMO0Yvg0iapb1cze1ZQ4vLrkA-4q8lqEzW_272DqUKl6ydM5yKCO90vK3owj8mb9tiGI3XIqMkv2LnR435o_cCsgTzDp2w=w800-h726-no?authuser=3" alt="AM JKLU2luQpL0vUOEBp438JvM71nDh2mw hLXa3BMSO7vb00J2bS4rsLPolCZL1hMO0Yvg0iapb1cze1ZQ4vLrkA 4q8lqEzW 272DqUKl6ydM5yKCO90vK3owj8mb9tiGI3XIqMkv2LnR435o cCsgTzDp2w=w800 h726 no?authuser=3 如何將資料從 Linux 裝置 備份 至 Synology NAS" title="如何將資料從 Linux 裝置 備份 至 Synology NAS"></figure></div>


<p>儲存下來的 log 檔內容長這樣</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AM-JKLXgfEC4R-6gBbFPtwLLMGncdhEHnPkgGOd8286eZJY48999tZVnBFzBUH2Dji5vRcRKWzDMJW2pRNSrUlAw2eE5Tuw6n-_bEwBMSgC-EuoHLQgrx0m7KpfPebrk0LCkYSIXANbCgW3CmVIvCRqtCE33Nw=w1166-h602-no?authuser=3" alt="AM JKLXgfEC4R 6gBbFPtwLLMGncdhEHnPkgGOd8286eZJY48999tZVnBFzBUH2Dji5vRcRKWzDMJW2pRNSrUlAw2eE5Tuw6n bEwBMSgC EuoHLQgrx0m7KpfPebrk0LCkYSIXANbCgW3CmVIvCRqtCE33Nw=w1166 h602 no?authuser=3 如何將資料從 Linux 裝置 備份 至 Synology NAS" title="如何將資料從 Linux 裝置 備份 至 Synology NAS"></figure></div>


<h2 class="para wp-block-heading">找回刪掉的檔案</h2>



<p class="withcode">這個小蛙卡了半天 &#8230; 要找回刪除的檔案必須要是 <code>administrators</code> 群組內的人才可以，如果想要用原本執行 <code>rsync</code> 的那個帳號的話，就不要把上面的 <code>myaccount</code> 從 <code>administrators</code> 群組移除，或是考量安全性，維持從 <code>administrators</code> 群組中移除 <code>myaccount</code>，要找回刪除資料的時候再透過 <code>administrators</code> 的其他帳號處理了。</p>



<p class="withcode">而且要透過 Synology Drive (1)，進入資源回收桶 (2) -&gt; 右手邊有一個我的檔案 (3) -&gt; 選到剛剛設定的空間，就可以看到被刪除的檔案囉！</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" src="https://lh3.googleusercontent.com/pw/AM-JKLUaPQYX9zzR2bQFRAmMJEA81m8FkSHDk82KVyNzSq-tH2f-mxhWXNOMLkDO-DX0oiFo00gQ7J0IDWy_vpE6EK0cgiqsdU-H2GswOKSod5NrBgMqKKbxGZ8W_cOJF3vWiYpG0VzVI1ooDInCaL3lHUiDMQ=w796-h389-no?authuser=3" alt="Synology Drive 資源回收桶" title="如何將資料從 Linux 裝置 備份 至 Synology NAS"></figure></div>


<h2 class="para wp-block-heading">加入 crontab 定期執行</h2>



<p class="withcode">小蛙要備份的檔案非常多，第一次會跑很久，就先直接下上面提到的指令讓他跑，跑完之後視需求設定到 <code>crontab</code> 內，讓 <code>rysnc</code> 每 10 分鐘將小蛙 <code>/var/www/</code> 下有變動的檔案都同步到 Synology NAS 上，<code>crontab</code> 設定的方式如下 (更多使用方式與說明可參考 <a href="https://blog.gtwang.org/linux/linux-crontab-cron-job-tutorial-and-examples/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">Linux 設定 crontab 例行性工作排程教學與範例<span class="wpel-icon wpel-image wpel-icon-6"></span></a>)</p>



<pre class="wp-block-preformatted withcode">root@xxxxxx:~# crontab -e

*/10 * * * * rsync -avh --log-file=/path/file.log --delete --exclude '#recycle/' --exclude '@eaDir' -e ssh /root/backup/ --progress</pre>



<p>今天介紹的 如何將資料從 Linux 裝置 備份 至 Synology NAS ？ 就到這邊啦！記下來給有需要的朋友參考。</p>



<p><strong>網站架設系列文章：</strong></p>



<ul class="my-li bg-darkblue wp-block-list"><li><a href="https://noter.tw/10151/%e7%9b%a4%e9%bb%9e%e9%82%a3%e4%ba%9b%e6%9b%be%e7%b6%93%e9%99%aa%e4%bc%b4%e9%81%8e%e5%b0%8f%e8%9b%99%e7%9a%84-vps-%e8%99%9b%e6%93%ac%e4%b8%bb%e6%a9%9f/" data-wpel-link="internal">盤點那些曾經陪伴過小蛙的 VPS 虛擬主機</a></li><li><a href="https://noter.tw/176/%e5%a6%82%e4%bd%95%e6%8c%91%e9%81%b8-vps-%e6%9c%80%e5%88%92%e7%ae%97%e7%9a%84%e8%b2%b7%e6%b3%95/" data-wpel-link="internal">如何挑選 VPS + 最划算的買法</a></li><li><a href="https://noter.tw/406/%E6%89%8B%E6%8A%8A%E6%89%8B%E6%95%99%E4%BD%A0%E5%A6%82%E4%BD%95%E8%B3%BC%E8%B2%B7-vps/" data-wpel-link="internal">手把手教你如何購買 VPS</a></li><li><a href="https://noter.tw/4463/第一次買-kvm-虛擬主機/" data-wpel-link="internal">第一次買 KVM 虛擬主機</a></li><li><a href="https://noter.tw/4242/%e8%a1%80%e7%9a%84%e6%95%99%e8%a8%93-hiformance-%e8%b7%91%e8%b7%af%e4%ba%86/" data-wpel-link="internal">血的教訓 &#8211; HiFormance 跑路了 &#8230;</a></li><li><a href="https://noter.tw/196/%e7%82%ba%e8%87%aa%e5%b7%b1%e7%94%b3%e8%ab%8b%e4%b8%80%e5%80%8b%e5%9f%9f%e5%90%8d-hinet-%e7%82%ba%e4%be%8b/" data-wpel-link="internal">為自己申請一個域名 – HiNet 為例</a></li><li><a href="https://noter.tw/117/cloudflare-%E8%B6%85%E5%BC%B7%E5%A4%A7%E7%9A%84%E5%85%8D%E8%B2%BB-cdn/" data-wpel-link="internal">Cloudflare – 超強大的免費 CDN (?)</a></li><li><a href="https://noter.tw/195/%e4%bd%bf%e7%94%a8-cloudflare-%e4%bb%a3%e7%ae%a1%e4%bd%a0%e7%9a%84%e5%9f%9f%e5%90%8d/" data-wpel-link="internal">使用 Cloudflare 代管你的域名</a></li><li><a href="https://noter.tw/396/ubuntu-16-04-設定環境語言編碼，讓中文可以正常顯示/" data-wpel-link="internal">Ubuntu 16.04 設定環境語言編碼，讓中文可以正常顯示</a></li><li><a href="https://noter.tw/255/ubuntu-16-04-%e5%ae%89%e8%a3%9d-fail2ban/" data-wpel-link="internal">Ubuntu 16.04 安裝 fail2ban</a></li><li><a href="https://noter.tw/436/%E4%B8%80%E5%80%8B%E8%85%B3%E6%9C%AC%E6%AF%8F%E5%A4%A9%E8%87%AA%E5%8B%95%E5%82%99%E4%BB%BD/" data-wpel-link="internal">一個腳本每天自動備份</a></li><li><a href="https://noter.tw/32/linux-tar-%E5%AE%8C%E6%95%B4%E5%82%99%E4%BB%BD%E3%80%81%E5%A2%9E%E9%87%8F%E5%82%99%E4%BB%BD%E5%8F%8A%E5%B7%AE%E7%95%B0%E5%82%99%E4%BB%BD%E6%AF%94%E8%BC%83/" data-wpel-link="internal">Linux tar 完整備份、增量備份及差異備份比較</a></li><li><a href="https://noter.tw/3704/nginx-ssl-certificate-%E8%AE%93-http-%E8%AE%8A%E8%BA%AB%E6%88%90%E7%82%BA-https/" data-wpel-link="internal">nginx + SSL Certificate – 讓 http 變身成為 https</a></li><li><a href="https://noter.tw/3695/ssl-for-free-%E5%85%8D%E8%B2%BB%E5%8F%88%E6%9C%89%E7%B6%A0%E8%89%B2%E9%8E%96%E9%A0%AD%E7%9A%84-ssl-certificates/" data-wpel-link="internal">SSL For Free – 免費又有綠色鎖頭的 SSL Certificates</a></li><li><a href="https://noter.tw/8596/certbot-error/" data-wpel-link="internal">Certbot 申請 SSL certificate 錯誤問題</a></li><li><a href="https://noter.tw/9107/certbot-error-acmev1-is-deprecated/" data-wpel-link="internal">Certbot 錯誤：ACMEv1 is deprecated and you can …</a></li><li><a href="https://noter.tw/5967/ubuntu-18-04-%e5%ae%89%e8%a3%9d-awstats-%e4%be%86%e7%b5%b1%e8%a8%88%e7%b6%b2%e7%ab%99%e6%b5%81%e9%87%8f/" data-wpel-link="internal">Ubuntu 18.04 安裝 AWStats 來統計網站流量</a></li><li><a href="https://noter.tw/9287/pchome-%e8%b2%b7%e7%b6%b2%e5%9d%80%e7%ba%8c%e7%b4%84%e6%b5%81%e7%a8%8b/" data-wpel-link="internal">PCHome 買網址續約流程</a></li></ul>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/9146/linux-rsync-to-synology-nas/" data-wpel-link="internal">如何將資料從 Linux 裝置 備份 至 Synology NAS</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://noter.tw/9146/linux-rsync-to-synology-nas/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Certbot error: ACMEv1 is deprecated and you can &#8230;</title>
		<link>https://noter.tw/9107/certbot-error-acmev1-is-deprecated/</link>
					<comments>https://noter.tw/9107/certbot-error-acmev1-is-deprecated/#respond</comments>
		
		<dc:creator><![CDATA[黃小蛙]]></dc:creator>
		<pubDate>Fri, 13 Aug 2021 04:30:00 +0000</pubDate>
				<category><![CDATA[Web Server]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[技術相關]]></category>
		<category><![CDATA[ACMEv1 is deprecated]]></category>
		<category><![CDATA[upgrad certbot]]></category>
		<category><![CDATA[apt-get install upgrade]]></category>
		<category><![CDATA[免費 ssl]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[certbot]]></category>
		<guid isPermaLink="false">https://noter.tw/?p=9107</guid>

					<description><![CDATA[<p>今天好友說有一個網站的 SSL 過期了，請小蛙幫忙看一下，下指令更新會出現 Certbot error: ACMEv1 is deprecated 使用免費的 SSL 就要承受每三個月過期一次的麻煩，&#46;&#46;&#46;</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/9107/certbot-error-acmev1-is-deprecated/" data-wpel-link="internal">Certbot error: ACMEv1 is deprecated and you can &#8230;</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>今天好友說有一個網站的 SSL 過期了，請小蛙幫忙看一下，下指令更新會出現 Certbot error: ACMEv1 is deprecated </p>



<span id="more-9107"></span>



<p>使用<a href="https://noter.tw/3695/ssl-for-free-%e5%85%8d%e8%b2%bb%e5%8f%88%e6%9c%89%e7%b6%a0%e8%89%b2%e9%8e%96%e9%a0%ad%e7%9a%84-ssl-certificates/" target="_blank" rel="noreferrer noopener" data-wpel-link="internal">免費的 SSL</a> 就要承受每三個月過期一次的麻煩，但是想想三個月過期一次就可以省一大筆錢，似乎又還蠻划算的～之前遇到很多種奇怪的狀況，這篇記錄一下第一次遇到這種 ACMEv1。</p>



<p>小蛙覺得奇怪，怎麼去年三月到現在已經正常運行那麼久了，卻在這時候突然失靈，輸入 certbot run 的指令後出現 ACMEv1 is deprecated and you can bla bla bla 通常附上的連結點過去都沒什麼結果，直接把相關問題丟 Google 比較實在。</p>



<p>經過一番查詢後才知道原來是 certbot 的版本更新了，原本使用的 ACMEv1 已經不能使用，好友網站是 Ubuntu 16.04 LTS，<a href="https://askubuntu.com/questions/44122/how-to-upgrade-a-single-package-using-apt-get" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">更新<span class="wpel-icon wpel-image wpel-icon-6"></span></a>也很簡單</p>



<pre class="wp-block-preformatted withcode">apt-get install --only-upgrade certbot</pre>



<p>期間可能會連帶更新例如 python3 等相依的套件，等他跑完就完成了！</p>



<p><strong>網站架設系列文章：</strong></p>



<ul class="my-li bg-darkblue wp-block-list"><li><a href="https://noter.tw/10151/%e7%9b%a4%e9%bb%9e%e9%82%a3%e4%ba%9b%e6%9b%be%e7%b6%93%e9%99%aa%e4%bc%b4%e9%81%8e%e5%b0%8f%e8%9b%99%e7%9a%84-vps-%e8%99%9b%e6%93%ac%e4%b8%bb%e6%a9%9f/" data-wpel-link="internal">盤點那些曾經陪伴過小蛙的 VPS 虛擬主機</a></li><li><a href="https://noter.tw/176/%e5%a6%82%e4%bd%95%e6%8c%91%e9%81%b8-vps-%e6%9c%80%e5%88%92%e7%ae%97%e7%9a%84%e8%b2%b7%e6%b3%95/" data-wpel-link="internal">如何挑選 VPS + 最划算的買法</a></li><li><a href="https://noter.tw/406/%E6%89%8B%E6%8A%8A%E6%89%8B%E6%95%99%E4%BD%A0%E5%A6%82%E4%BD%95%E8%B3%BC%E8%B2%B7-vps/" data-wpel-link="internal">手把手教你如何購買 VPS</a></li><li><a href="https://noter.tw/4463/第一次買-kvm-虛擬主機/" data-wpel-link="internal">第一次買 KVM 虛擬主機</a></li><li><a href="https://noter.tw/4242/%e8%a1%80%e7%9a%84%e6%95%99%e8%a8%93-hiformance-%e8%b7%91%e8%b7%af%e4%ba%86/" data-wpel-link="internal">血的教訓 &#8211; HiFormance 跑路了 &#8230;</a></li><li><a href="https://noter.tw/196/%e7%82%ba%e8%87%aa%e5%b7%b1%e7%94%b3%e8%ab%8b%e4%b8%80%e5%80%8b%e5%9f%9f%e5%90%8d-hinet-%e7%82%ba%e4%be%8b/" data-wpel-link="internal">為自己申請一個域名 – HiNet 為例</a></li><li><a href="https://noter.tw/117/cloudflare-%E8%B6%85%E5%BC%B7%E5%A4%A7%E7%9A%84%E5%85%8D%E8%B2%BB-cdn/" data-wpel-link="internal">Cloudflare – 超強大的免費 CDN (?)</a></li><li><a href="https://noter.tw/195/%e4%bd%bf%e7%94%a8-cloudflare-%e4%bb%a3%e7%ae%a1%e4%bd%a0%e7%9a%84%e5%9f%9f%e5%90%8d/" data-wpel-link="internal">使用 Cloudflare 代管你的域名</a></li><li><a href="https://noter.tw/396/ubuntu-16-04-設定環境語言編碼，讓中文可以正常顯示/" data-wpel-link="internal">Ubuntu 16.04 設定環境語言編碼，讓中文可以正常顯示</a></li><li><a href="https://noter.tw/255/ubuntu-16-04-%e5%ae%89%e8%a3%9d-fail2ban/" data-wpel-link="internal">Ubuntu 16.04 安裝 fail2ban</a></li><li><a href="https://noter.tw/436/%E4%B8%80%E5%80%8B%E8%85%B3%E6%9C%AC%E6%AF%8F%E5%A4%A9%E8%87%AA%E5%8B%95%E5%82%99%E4%BB%BD/" data-wpel-link="internal">一個腳本每天自動備份</a></li><li><a href="https://noter.tw/32/linux-tar-%E5%AE%8C%E6%95%B4%E5%82%99%E4%BB%BD%E3%80%81%E5%A2%9E%E9%87%8F%E5%82%99%E4%BB%BD%E5%8F%8A%E5%B7%AE%E7%95%B0%E5%82%99%E4%BB%BD%E6%AF%94%E8%BC%83/" data-wpel-link="internal">Linux tar 完整備份、增量備份及差異備份比較</a></li><li><a href="https://noter.tw/3704/nginx-ssl-certificate-%E8%AE%93-http-%E8%AE%8A%E8%BA%AB%E6%88%90%E7%82%BA-https/" data-wpel-link="internal">nginx + SSL Certificate – 讓 http 變身成為 https</a></li><li><a href="https://noter.tw/3695/ssl-for-free-%E5%85%8D%E8%B2%BB%E5%8F%88%E6%9C%89%E7%B6%A0%E8%89%B2%E9%8E%96%E9%A0%AD%E7%9A%84-ssl-certificates/" data-wpel-link="internal">SSL For Free – 免費又有綠色鎖頭的 SSL Certificates</a></li><li><a href="https://noter.tw/8596/certbot-error/" data-wpel-link="internal">Certbot 申請 SSL certificate 錯誤問題</a></li><li><a href="https://noter.tw/9107/certbot-error-acmev1-is-deprecated/" data-wpel-link="internal">Certbot 錯誤：ACMEv1 is deprecated and you can …</a></li><li><a href="https://noter.tw/5967/ubuntu-18-04-%e5%ae%89%e8%a3%9d-awstats-%e4%be%86%e7%b5%b1%e8%a8%88%e7%b6%b2%e7%ab%99%e6%b5%81%e9%87%8f/" data-wpel-link="internal">Ubuntu 18.04 安裝 AWStats 來統計網站流量</a></li><li><a href="https://noter.tw/9287/pchome-%e8%b2%b7%e7%b6%b2%e5%9d%80%e7%ba%8c%e7%b4%84%e6%b5%81%e7%a8%8b/" data-wpel-link="internal">PCHome 買網址續約流程</a></li></ul>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/9107/certbot-error-acmev1-is-deprecated/" data-wpel-link="internal">Certbot error: ACMEv1 is deprecated and you can &#8230;</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://noter.tw/9107/certbot-error-acmev1-is-deprecated/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
