• 跳至主要導覽
  • 跳至主要內容
  • 跳至主要資訊欄
Office 指南

Office 指南

辦公室工作實用教學

  • Excel
  • Word
  • PowerPoint
  • Windows
  • PowerShell
  • R

Linux 使用 openfortivpn 連線至 Fortinet VPN 伺服器建立 PPP+SSL VPN 教學與範例

介紹如何在 Linux 系統上使用 openfortivpn 指令工具連線至 Fortinet VPN 伺服器建立 PPP+SSL VPN。


openfortivpn 是一個相容於 Fortinet VPN 的 PPP+SSL VPN client 指令工具,在 Linux 中若需要連線至 Fortinet VPN 伺服器建立 PPP+SSL VPN,就可以使用 openfortivpn。

安裝 openfortivpn

若在 Ubuntu Linux 中可用 apt 安裝 openfortivpn:

# 安裝 openfortivpn
sudo apt install openfortivpn

建立 VPN 連線

安裝好 openfortivpn 之後,即可使用以下指令稿建立 VPN 連線:

# Fortinet VPN 伺服器
VPN_GATEWAY=12.34.56.78:443

# 使用者名稱
USERNAME=officeguide

# 建立 VPN 連線
sudo openfortivpn ${VPN_GATEWAY} --username=${USERNAME}

信任指定憑證

如果 VPN 伺服器的安全憑證有問題,可能會出現類似這樣的錯誤:

ERROR:  Gateway certificate validation failed, and the certificate digest in not in the local whitelist. If you trust it, rerun with:
ERROR:      --trusted-cert fcf8010a3c12408e44fc3d949843b9fb16b46f26dcc5d179beff8f9600541bb5

如果確認 VPN 伺服器沒有問題,可以加上訊息中建議的 --trusted-cert 參數,讓 openfortivpn 信任該憑證:

# 建立 VPN 連線(信任指定憑證)
sudo openfortivpn ${VPN_GATEWAY} --username=${USERNAME} \
  --trusted-cert fcf8010a3c12408e44fc3d949843b9fb16b46f26dcc5d179beff8f9600541bb5

設定檔

我們也可以將所有 openfortivpn 要用的參數寫在一個設定檔案中,其語法如下:

# Fortinet VPN 伺服器
host = 12.34.56.78
port = 443

# 使用者名稱與密碼
username = officeguide
password = MY_PASSWORD

# 信任指定憑證
trusted-cert = fcf8010a3c12408e44fc3d949843b9fb16b46f26dcc5d179beff8f9600541bb5

將這些設定儲存為 vpn.config 之後,在執行 openfortivpn 的時候以 -c 參數指定設定檔路徑:

# 指定設定檔
sudo openfortivpn -c vpn.config

openfortivpn 預設的設定檔路徑為 /etc/openfortivpn/config,如果直接把設定寫在這個檔案中,則執行就可以不加任何參數。

# 使用 /etc/openfortivpn/config 的設定
sudo openfortivpn

分類:Linux 標籤:資訊安全

主要資訊欄

搜尋

近期文章

  • Python 使用 PyAutoGUI 自動操作滑鼠與鍵盤
  • Ubuntu Linux 以 WireGuard 架設 VPN 伺服器教學與範例
  • Linux 網路設定 ip 指令用法教學與範例
  • Windows 使用 TPM 虛擬智慧卡保護 SSH 金鑰教學與範例
  • Linux 以 Shamir’s Secret Sharing 分割保存金鑰教學與範例
  • Linux 以 Cryptsetup、LUKS 加密 USB 隨身碟教學與範例
  • Linux 以 Cryptsetup 與 LUKS 加密磁碟教學與範例
  • Linux 使用 age 簡潔的加密、解密工具使用教學與範例

推薦網站

  • Udemy 線上教學課程
  • Coursera 線上教學課程

關注本站

  • 電子郵件
  • Facebook

公益

  • 家扶基金會
  • 台灣世界展望會
  • Yahoo 奇摩公益
  • igiving 公益網
  • 兒福聯盟

Copyright © 2021 · Office Guide