commit(auto)
This commit is contained in:
parent
43834bcc49
commit
72b250ebbc
6 changed files with 11 additions and 48 deletions
|
@ -43,6 +43,7 @@ $ sudo reboot (最新にしたので再起動)
|
|||
- [[20240211141946 Raspi4 Cloudflareでトンネルを作る|Raspi4 Cloudflareでトンネルを作る]]
|
||||
- [[20240211185359 Raspi4 Cloudflareでsshアクセスできるようにする|Raspi4 Cloudflareでsshアクセスできるようにする]]
|
||||
- [[20240211202623 Raspi4 Cloudflare tunnel経由でhttpsサーバーを公開する|Raspi4 Cloudflareでhttpsサーバーを公開する]]
|
||||
- [[20240211185359 Raspi4 Cloudflareでsshアクセスできるようにする|Raspi4 Cloudflareでsshアクセスできるようにする]]
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -41,11 +41,17 @@ New password:
|
|||
Retype new password:
|
||||
passwd: password updated successfully
|
||||
|
||||
$ sudo visudo
|
||||
|
||||
cloudflare ALL=(ALL:ALL) ALL
|
||||
を追加
|
||||
|
||||
kazbo@saipi4:~ $ su cloudflare
|
||||
Password:
|
||||
cloudflare@saipi4:/home/kazbo $ cd
|
||||
cloudflare@saipi4:~ $ pwd
|
||||
/var/lib/cloudflare
|
||||
|
||||
```
|
||||
以降作業はこのユーザー(cloudflare)で実施
|
||||
|
||||
|
@ -70,8 +76,5 @@ Tunnel credentials written to /var/lib/cloudflare/.cloudflared/******.json. clou
|
|||
|
||||
Created tunnel saipi4 with id *****
|
||||
```
|
||||
`*****` の所のtokenをメモしておく
|
||||
|
||||
[[20240212183159 cloudflare トンネルのtoken]]
|
||||
## cf.
|
||||
`*****` の所のtokenをメモしておく [[20240212183159 cloudflare トンネルのtoken]]
|
||||
|
||||
|
|
|
@ -5,14 +5,11 @@
|
|||
[[20240211141946 Raspi4 Cloudflareでトンネルを作る|Raspi4 Cloudflareでトンネルを作る]] と同じ。設定方法がどんどん変わる上、私はその専門ではない
|
||||
|
||||
## 前提
|
||||
[[20240211141946 Raspi4 Cloudflareでトンネルを作る|Raspi4 Cloudflareでトンネルを作る]] の作業が完了している
|
||||
- [[20240211141946 Raspi4 Cloudflareでトンネルを作る|Raspi4 Cloudflareでトンネルを作る]] の作業が完了している
|
||||
- [[20240211202623 Raspi4 Cloudflare tunnel経由でhttpsサーバーを公開する|Raspi4 Cloudflare tunnel経由でhttpsサーバーを公開する]] の作業が完了している
|
||||
|
||||
|
||||
## 手順
|
||||
### サーバー側の設定
|
||||
- [[20240211195201 Cloudflare Access Groupsの作成|Cloudflare Access Groupsの作成]]
|
||||
- [[20240211195126 Cloudflare Applicationsの作成|Cloudflare Applicationsの作成]]
|
||||
|
||||
を終わらせる。他にやることはなかったと思う。
|
||||
|
||||
### クライアント側の設定
|
||||
直接sshではアクセスできず、 cloudflaredコマンドを使う。 以下はwsl2でubuntuを使っていた場合。
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
# 20240211193602 Cloudflare Public Hostnameの設定
|
||||
#cloudflare #config #server #raspi
|
||||
|
||||
|
||||
Cloudflareの同じ画面で、"Public Hostname" をクリック。
|
||||
"+ Add a public hostname"
|
||||
をクリック。
|
||||
subdomain: sshでアクセスしたい場合のサブドメインを設定(optional)
|
||||
Domain: 使いたいドメイン (サイトを追加する で追加したものしか選べない)を選ぶ
|
||||
|
||||
### SSHの追加
|
||||
Service
|
||||
Type: sshを選択
|
||||
URL: localhost:`[sshのポート]`
|
||||
Save hostname をクリック。
|
||||
|
||||
### HTTP/HTTPSの追加
|
||||
Service
|
||||
Type: https or httpを選ぶ
|
||||
URL: localhost
|
||||
Save hostname をクリック。
|
||||
|
||||
|
||||
自分の場合とりあえずこんな感じにしてある。
|
||||
![[Pasted image 20240211193442.png]]
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
#### 20240211195201 Cloudflare Access Groupsの作成
|
||||
cloudflareにログイン、 Zero Trustをクリック。
|
||||
AccessからAccess Groupsを選択。 "+ Add a Group"をクリック。
|
||||
遷移した画面で、"Assign as default group" に チェック。 Include の所のSelectorは適切に設定する。
|
||||
Everyone/Everyone という設定も可能だが、セキュリティ上あまりよろしくない。
|
||||
ドメインでメールの設定をしている場合、それが使えるので、 Selectorに"Emails ending in" を選んで、Valueにメールアドレスのドメインを記入した。複数指定できる。
|
||||
こんなかんじ。
|
||||
Group nameは "default_group"に設定した。
|
||||
|
||||
![[Pasted image 20240211191414.png]]
|
||||
|
|
@ -44,7 +44,6 @@ cloudflare@saipi4:~ $ vim sudo vim /etc/systemd/system/cloudflared.service\
|
|||
```
|
||||
中身は
|
||||
```
|
||||
|
||||
[Unit]
|
||||
Description=cloudflared
|
||||
After=network.target
|
||||
|
|
Loading…
Reference in a new issue