From 455f659c594bed9a836d4190f94ba1994ee08713 Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Tue, 7 Jun 2016 20:10:57 -0500 Subject: [PATCH] Move README section to new docs --- README-zh.md | 40 ++-------------------------------------- README.md | 40 ++-------------------------------------- docs/manage-users-zh.md | 38 ++++++++++++++++++++++++++++++++++++++ docs/manage-users.md | 38 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 76 deletions(-) create mode 100644 docs/manage-users-zh.md create mode 100644 docs/manage-users.md diff --git a/README-zh.md b/README-zh.md index 547760b..2f6709d 100644 --- a/README-zh.md +++ b/README-zh.md @@ -17,7 +17,6 @@ - [CentOS & RHEL](#centos--rhel) - [下一步](#下一步) - [重要提示](#重要提示) -- [管理 VPN 用户](#管理-vpn-用户) - [关于升级Libreswan](#关于升级libreswan) - [问题和反馈](#问题和反馈) - [另见](#另见) @@ -107,49 +106,14 @@ sudo sh vpnsetup_centos.sh **Android 6 (Marshmallow) 用户** 请参考此文档中的注释: 配置 IPsec/L2TP VPN 客户端。 +如果你需要添加,编辑或者删除 VPN 用户账户,请参见 管理 VPN 用户。 + 在 VPN 已连接时,客户端配置为使用 Google Public DNS。如果要使用另外的 DNS 服务商,可以编辑文件 `options.xl2tpd` 和 `ipsec.conf` 并用新的服务器替换 `8.8.8.8` 和 `8.8.4.4`。然后重新启动系统。 如果你为服务器配置了自定义 SSH 端口(不是 22)或其他服务,请在使用前编辑脚本中的 IPTables 防火墙规则。 这些脚本在更改现有的配置文件之前会先做备份,使用 `.old-日期-时间` 为文件名后缀。 -## 管理 VPN 用户 - -在默认情况下,将只创建一个用于 VPN 登录的用户账户。如果你需要添加,编辑或者删除用户,请阅读本节。 - -首先,IPsec PSK (预共享密钥) 保存在文件 `/etc/ipsec.secrets`。如果要更换一个新的 PSK,可以编辑此文件。 - -```bash - %any : PSK "" -``` - -对于 `IPsec/L2TP`,VPN 用户账户信息保存在文件 `/etc/ppp/chap-secrets`。该文件的格式如下: - -```bash -"" l2tpd "" * -"" l2tpd "" * -... ... -``` - -你可以添加更多用户,每个用户对应文件中的一行。**不要**在用户名,密码或 PSK 中使用这些字符:`\ " '` - -对于 `IPsec/XAuth ("Cisco IPsec")`, VPN 用户账户信息保存在文件 `/etc/ipsec.d/passwd`。该文件的格式如下: - -```bash -::xauth-psk -::xauth-psk -... ... -``` - -这个文件中的密码以 salted and hashed 的形式保存。该步骤可以借助比如 `openssl` 工具来完成: - -```bash -# The output will be -openssl passwd -1 "" -``` - -在完成修改之后,需要重启服务器。 - ## 关于升级Libreswan 提供两个额外的脚本 vpnupgrade_Libreswan.shvpnupgrade_Libreswan_centos.sh ,可用于升级 Libreswan。请关注官方网站,并在运行前根据需要更新 `swan_ver` 变量。 diff --git a/README.md b/README.md index 8665c83..02fe100 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ We will use Libreswan as th - [CentOS & RHEL](#centos--rhel) - [Next Steps](#next-steps) - [Important Notes](#important-notes) -- [Manage VPN Users](#manage-vpn-users) - [Upgrading Libreswan](#upgrading-libreswan) - [Bugs & Questions](#bugs--questions) - [See Also](#see-also) @@ -107,49 +106,14 @@ For **Windows users**, a Configure IPsec/L2TP VPN Clients. +If you wish to add, edit or remove VPN user accounts, refer to Manage VPN Users. + Clients are set to use Google Public DNS when the VPN is active. If another DNS provider is preferred, replace `8.8.8.8` and `8.8.4.4` in both `options.xl2tpd` and `ipsec.conf` with new ones. Then reboot your server. For servers with a custom SSH port (not 22) or other services, edit IPTables rules in the script before using. The scripts will backup existing config files before making changes, with `.old-date-time` suffix. -## Manage VPN Users - -By default, a single user account for VPN login is created. If you wish to add, edit or remove users, read this section. - -First, the IPsec PSK (pre-shared key) is stored in `/etc/ipsec.secrets`. To change to a new PSK, just edit this file. - -```bash - %any : PSK "" -``` - -For `IPsec/L2TP`, VPN users are specified in `/etc/ppp/chap-secrets`. The format of this file is: - -```bash -"" l2tpd "" * -"" l2tpd "" * -... ... -``` - -You can add more users, use one line for each user. DO NOT use these characters within values: `\ " '` - -For `IPsec/XAuth ("Cisco IPsec")`, VPN users are specified in `/etc/ipsec.d/passwd`. The format of this file is: - -```bash -::xauth-psk -::xauth-psk -... ... -``` - -Passwords in this file are salted and hashed. This step can be done using e.g. the `openssl` utility: - -```bash -# The output will be -openssl passwd -1 "" -``` - -When finished making changes, reboot your server. - ## Upgrading Libreswan The additional scripts vpnupgrade_Libreswan.sh and vpnupgrade_Libreswan_centos.sh can be used to upgrade Libreswan. Check the official website and update the `swan_ver` variable as necessary. diff --git a/docs/manage-users-zh.md b/docs/manage-users-zh.md new file mode 100644 index 0000000..4ec26fb --- /dev/null +++ b/docs/manage-users-zh.md @@ -0,0 +1,38 @@ +## 管理 VPN 用户 + +*其他语言版本: [English](manage-users.md), [简体中文](manage-users-zh.md).* + +在默认情况下,将只创建一个用于 VPN 登录的用户账户。如果你需要添加,编辑或者删除用户,请阅读本文档。 + +首先,IPsec PSK (预共享密钥) 保存在文件 `/etc/ipsec.secrets`。如果要更换一个新的 PSK,可以编辑此文件。 + +```bash + %any : PSK "" +``` + +对于 `IPsec/L2TP`,VPN 用户账户信息保存在文件 `/etc/ppp/chap-secrets`。该文件的格式如下: + +```bash +"" l2tpd "" * +"" l2tpd "" * +... ... +``` + +你可以添加更多用户,每个用户对应文件中的一行。**不要**在用户名,密码或 PSK 中使用这些字符:`\ " '` + +对于 `IPsec/XAuth ("Cisco IPsec")`, VPN 用户账户信息保存在文件 `/etc/ipsec.d/passwd`。该文件的格式如下: + +```bash +::xauth-psk +::xauth-psk +... ... +``` + +这个文件中的密码以 salted and hashed 的形式保存。该步骤可以借助比如 `openssl` 工具来完成: + +```bash +# The output will be +openssl passwd -1 "" +``` + +在完成修改之后,需要重启服务器。 diff --git a/docs/manage-users.md b/docs/manage-users.md new file mode 100644 index 0000000..33c61c7 --- /dev/null +++ b/docs/manage-users.md @@ -0,0 +1,38 @@ +## Manage VPN Users + +*Read this in other languages: [English](manage-users.md), [简体中文](manage-users-zh.md).* + +By default, a single user account for VPN login is created. If you wish to add, edit or remove users, read this document. + +First, the IPsec PSK (pre-shared key) is stored in `/etc/ipsec.secrets`. To change to a new PSK, just edit this file. + +```bash + %any : PSK "" +``` + +For `IPsec/L2TP`, VPN users are specified in `/etc/ppp/chap-secrets`. The format of this file is: + +```bash +"" l2tpd "" * +"" l2tpd "" * +... ... +``` + +You can add more users, use one line for each user. DO NOT use these characters within values: `\ " '` + +For `IPsec/XAuth ("Cisco IPsec")`, VPN users are specified in `/etc/ipsec.d/passwd`. The format of this file is: + +```bash +::xauth-psk +::xauth-psk +... ... +``` + +Passwords in this file are salted and hashed. This step can be done using e.g. the `openssl` utility: + +```bash +# The output will be +openssl passwd -1 "" +``` + +When finished making changes, reboot your server.