05 2025
|
$ ps aux | grep pppd /usr/sbin/pppd 230400 :169.254.2.1 noipdefault ipcp-accept-local noaccomp noauth default-asyncmap nopcomp receive-all nodefaultroute nodetach lcp-max-configure 40 mru 1354 logfd 2※ ppp0のremote IP addressがVPNサーバのIPアドレスになってしまうと、 物理NICを経由すべきVPNトラフィックがppp0を経由してし まってVPNサーバに届かなくなる。この結果、2.5分後にタイムアウトで切断さ れてしまう。
pppd 2.5.1 started by user, uid 0 Using interface ppp0 Connect: ppp0 <--> /dev/pts/5 local IP address xxx.xxx.xxx.xxx remote IP address yyy.yyy.yyy.yyy No response to 4 echo-requests Serial link appears to be disconnected. Connect time 2.5 minutes. Sent 18750 bytes, received 0 bytes. Connection terminated. Modem hangup Exit./etc/openfortivpn/config に 下記を記述しておけば良い。
pppd-accept-remote = 0しかし、ppp 2.5.x では、Peer側からの提案アドレスがある場合採用しないと、エラー(Peer refused to agree to his IP address)で停止する。
diff -urN ppp-2.5.2/pppd/ipcp.c ppp-2.5.2-new/pppd/ipcp.c --- ppp-2.5.2/pppd/ipcp.c 2025-05-11 11:49:26.000000000 +0900 +++ ppp-2.5.2-new/pppd/ipcp.c 2025-05-11 11:53:40.779157618 +0900 @@ -1811,11 +1811,13 @@ * We must have a non-zero IP address for both ends of the link. */ +#if 0 /* Do not error out if you do not accept the peer's idea of his address. */ if (wo->hisaddr && !wo->accept_remote && (!(ho->neg_addr || ho->old_addrs) || ho->hisaddr != wo->hisaddr)) { error("Peer refused to agree to his IP address"); ipcp_close(f->unit, "Refused his IP address"); return; } +#endif if (!ho->neg_addr && !ho->old_addrs) ho->hisaddr = wo->hisaddr;本来は、VPNサーバ側の設定で、Peer側からの提案アドレスを 169.254.2.1 に設定してもらう必要がありそうだ。
update: 2025/05/11 12:44 | path: /pub/software/linux/fortivpn
kernel: INFO: task kworker/u88:0:11 blocked for more than 120 seconds. kernel: Not tainted 6.12.11-amd64 #1 Debian 6.12.11-1 kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. kernel: task:kworker/u88:0 state:D stack:0 pid:11 tgid:11 ppid:2 flags:0x00004000 kernel: Workqueue: USBC000:00-con1 ucsi_poll_worker [typec_ucsi] kernel: Call Trace: kernel:task:kworker/u88:0 が何かのBlockを受けているようだ...。 task:kworker/u88:0はどうやらUSB-typeCのucsi(USB Type-C Connector system-software interface)関係のようだ...。kernel: __schedule+0x3e6/0xbf0 kernel: schedule+0x27/0xf0 kernel: schedule_preempt_disabled+0x15/0x30 kernel: __mutex_lock.constprop.0+0x3d0/0x6d0 kernel: ucsi_poll_worker+0x20/0x110 [typec_ucsi] kernel: process_one_work+0x174/0x330 kernel: worker_thread+0x252/0x390 kernel: ? __pfx_worker_thread+0x10/0x10 kernel: kthread+0xcf/0x100 kernel: ? __pfx_kthread+0x10/0x10 kernel: ret_from_fork+0x31/0x50 kernel: ? __pfx_kthread+0x10/0x10 kernel: ret_from_fork_asm+0x1a/0x30 kernel:
$ ps aux | grep ucsi ucsi_acpi 16384 0 typec_ucsi 53248 1 ucsi_acpi roles 20480 1 typec_ucsi typec 94208 1 typec_ucsisyslogには「kernel: ucsi_acpi USBC000:00: error -ETIMEDOUT: PPM init failed」が出ており、ucsi_acpiはfailして機能していないと思われる。 そこで、以下のような /etc/modprobe.d/vaio-ucsi-blacklist.conf を作成した。
# ucsi_acpi is not in use , so we block it by default. blacklist ucsi_acpiこれで、typec_ucsi も読み込まれない。
update: 2025/05/04 07:37 | path: /pub/software/linux
{"installed": { "client_id":"************-********************************.apps.googleusercontent.com", "project_id":"example0430", "auth_uri":"https://accounts.google.com/o/oauth2/auth", "token_uri":"https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs", "client_secret":"******-****************************", "redirect_uris":["http://localhost"] }}
項目 | 設定例 | 認識情報作成時 | 確認場所 | 備考 |
---|---|---|---|---|
アプリ名 | gmail0430oauth2 | OAuth同意 | ブランディング | 他のgoogleアプリとかぶらない名にする事 |
ユーザーサポートメール | example0430@gmail.com | OAuth同意 | ブランディング | ユーザーのgmailから選択 |
デベロッパーの連絡先情報 | example0430@gmail.com | OAuth同意 | ブランディング | ユーザーサポートメールと同じで良い |
スコープ(範囲) | https://mail.google.com/ | スコープ | データアクセス | Gmail のすべてのメールの閲覧、作成、送信、完全な削除 |
アプリケーションの種類 | デスクトップアプリ | OAuthクライアントID | クライアント | 名前 | desktop0430client01 | OAuthクライアントID | クライアント | コンソールでのクライアント識別 |
クライアントID | ************-********************************.apps.googleusercontent.com | - | クライアント | Google Cloud 自動生成ID |
クライアントシークレット | ******-**************************** | - | クライアント | Google Cloud 自動生成シークレット |
公開ステータス | テスト中 | - | 対象 | 変更しない。つまり、[アプリを公開]しない事 |
ユーザーの種類 | 外部 | - | 対象 | |
テストユーザー | example0430@gmail.com | - | 対象 | 自分のgmail等 |
名称 | URL |
---|---|
ブランディング | https://console.cloud.google.com/auth/branding |
対象 | https://console.cloud.google.com/auth/audience |
クライアント | https://console.cloud.google.com/auth/clients |
デーアアクセス | https://console.cloud.google.com/auth/scopes |
ロール | データ | 備考 |
---|---|---|
リソースオーナー | クライアントID, スコープ | Google Cloudののデータを使用 |
認可サーバ(https://accounts.google.com/o/oauth2/auth) | 認可コード | アクセストークン取得用 |
https://accounts.google.com/o/oauth2/auth?response_type=code &client_id=*************-********************************.apps.googleusercontent.com &state=xyz &scope=https://mail.google.com/ &redirect_uri=http://127.0.0.1/callbackGoogle Cloudのconsoleの[対象]で追加したテストユーザーの認証を求められる。
http://127.0.0.1/callback?state=xyz &code=*****_*******************************-_********************************** &scope=https://mail.google.com/※stateはリソースオーナー側でランダム生成した値。認可サーバからの返信に同じ値のstateがる事を確認する。
ロール | データ | 備考 |
---|---|---|
クライアント | クライアントID, クライアントシークレット, 認可コード | Google CloudののデータとSTEP 1で取得したコードを使用 |
トークンサーバ(https://oauth2.googleapis.com/token) | アクセストークン、リフレッシュトークン | リソースサーバアクセス用 |
curl -d "client_id=*************-********************************.apps.googleusercontent.com" \ -d "client_secret=******-****************-***********" \ -d "redirect_uri=http://127.0.0.1/callback" \ -d "grant_type=authorization_code" \ -d "code=*****_*******************************-_**********************************" \ https://oauth2.googleapis.com/token
{ "access_token": "****.**********************************************************************-********************************-********************************************************-********************************************************", "expires_in": 3599, "refresh_token": "*******************************-***************************************************************_*******", "scope": "https://mail.google.com/", "token_type": "Bearer", "refresh_token_expires_in": 604799 }%
update: 2025/05/01 21:04 | path: /pub/software/gmail
$ sudo apt install postfix procmail $ sudo dpkg -i sasl-xoauth2_0.20-1_amd64.deb sasl-xoauth2-tool_0.20-1_amd64.deb※ sasl-xoauth2 は debian experimental にある sasl-xoauth2 (0.20-1)を使用しました(R7年5月1日(木)現在 debian packageとしては、そこにしかない...)。
$ sudo dpkg-reconfigure postfix
項目 | 設定 | 備考 |
---|---|---|
General mail configuration type | スマートホスト付きインターネット Internet with smarthost | メールはSMTPを使用して直接受信するか、fetchmailなどのユーティリティを実行して受信します。送信メールはスマートホストを使用して送信されます。 Mail is received directly using SMTP or by running a utility such as fetchmail. Outgoing mail is sent using a smarthost. |
System mail name | (PCローカルHOST名に合わせる) | |
SMTP relay host | [smtp.gmail.com]:587 | Please specify a domain, host, host:port, [address] or [address]:port. |
Recipient for root and postmaster mail | (PCローカルのユーザー名) | Mail for the 'postmaster', 'root', and other system accounts needs to be redirected to the user account of the actual system administrator. |
メールを受け取るほかの宛先 (なければ空) | (空) | このマシンが最終的な宛先と見なされるドメインのリストを、コンマで区切って指定してください。 |
Local networks: | 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 | Please specify the network blocks for which this host should relay mail. The default is just the local host, which is needed by some mail user agents. |
Mailbox size limit (bytes) | 0 | A value of zero (0) means no limit. The upstream default is 51200000. |
Local address extension character | (空) | To not use address extensions, leave the string blank. |
利用するインターネットプロトコル | IPv4 | すべて : IPv4 と IPv6 アドレス両方を使う, IPv6: IPv6 アドレスのみをリスンする, ipv4: IPv4 アドレスのみをリスンする, |
mailbox_command = /usr/bin/procmail -a "$EXTENSION"
# SMTP Client TLS security level: none|may|encrypt|... smtp_tls_security_level = encrypt # SASL XOAUTH2 smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = smtp_sasl_mechanism_filter = xoauth2
[smtp.gmail.com]:587 YourMail@gmail.com:/etc/tokens/YourMail@gmail.com※ SecretなFILEなのでchown 600 しましょう。
{ "client_id": "*************-********************************.apps.googleusercontent.com", "client_secret": "******-****************************" }認可サーバへの通信にproxyを使用する場合は、以下のようにproxy設定を記述する。
{ "client_id": "*************-********************************.apps.googleusercontent.com", "client_secret": "******-****************************", "proxy" : "http://proxy:8080" }※ SecretなFILEなのでchown 600 しましょう。
$ sasl-xoauth2-tool get-token gmail \ --client-id=*************-********************************.apps.googleusercontent.com \ --client-secret=******-**************************** \ --scope="https://mail.google.com/" \ /tmp/YourMail@gmail.com $ sudo mkdir -p /var/spool/postfix/etc/tokens $ sudo mv /tmp/YourMail@gmail.com /var/spool/postfix/etc/tokens $ sudo chown -R postfix:postfix /var/spool/postfix/etc/tokens※ chrootで実行している設定なので、/var/spool/postfix/ 以下をアクセスする為
$ sudo mkdir -p /var/spool/postfix/etc/ssl/certs $ sudo cp /etc/ssl/certs/ca-certificates.crt /var/spool/postfix/etc/ssl/certs/ca-certificates.crt※ chrootで実行している設定なので、/var/spool/postfix/ 以下をアクセスする為
$ sudo postmap /etc/postfix/sasl_passwd
$ sudo systemctl reload postfix
update: 2025/05/01 20:36 | path: /pub/software/mta
update: 2025/05/01 14:57 | path: /pub/software/mta
$ dpkg-source -x mew_6.9-1.dsc $ cd mew-6.9 $ vi debian/changelog # 変更内容記載し、versionを上げておく $ dpkg-buildpackage -us -uc $ cd .. $ sudo dpkg -i mew_6.9-5_all.deb mew-bin_6.9-5_amd64.deb
;;; for OAuth2.0 (setq mew-oauth2-client-id "*************-********************************.apps.googleusercontent.com") (setq mew-oauth2-client-secret "******-****************************") (setq mew-config-alist '(("MyGmail" ("user" . "MyName") ("mail-domain" . "gmail.com") ("prog-ssl" . "/usr/bin/stunnel") ("use-smtp-auth" . t) ("smtp-ssl" . t) ("smtp-server" . "smtp.gmail.com") ("smtp-ssl-port" . "465") ("smtp-auth-list" . ("XOAUTH2")) ("smtp-user" . "MyName@gmail.com") ("imap-ssl" . t) ("imap-server" . "imap.gmail.com") ("imap-ssl-port" . "993") ("imap-auth-list" . ("XOAUTH2")) ("imap-user" . "MyName@gmail") )))
update: 2025/05/01 14:52 | path: /pub/software/emacs