{"id":847,"date":"2019-07-29T10:42:53","date_gmt":"2019-07-29T02:42:53","guid":{"rendered":"https:\/\/wyxxt.org.cn\/?p=847"},"modified":"2023-12-04T16:47:44","modified_gmt":"2023-12-04T08:47:44","slug":"openvpn%e4%b8%80%e9%94%ae%e6%90%ad%e5%bb%ba%e8%84%9a%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/wyxxt.org.cn\/?p=847","title":{"rendered":"openvpn\u4e00\u952e\u642d\u5efa\u811a\u672c"},"content":{"rendered":"<pre><code class=\"language-shell line-numbers\">git clone https:\/\/github.com\/Nyr\/openvpn-install.git\n<\/code><\/pre>\n<pre><code class=\"language-shell line-numbers\">cd openvpn-install\/\nchmod +x openvpn-install.sh\nsudo .\/openvpn-install\n# \u6839\u636e\u63d0\u793a\u5f80\u4e0b\u8d70\n<\/code><\/pre>\n<pre><code class=\"language-shell line-numbers\">cat \/etc\/openvpn\/server.conf\nport 1194\nproto udp\ndev tun\nsndbuf 0\nrcvbuf 0\nca ca.crt\ncert server.crt\nkey server.key\ndh dh.pem\nauth SHA512\ntls-auth ta.key 0\ntopology subnet\nserver 10.8.0.0 255.255.255.0\nifconfig-pool-persist ipp.txt\npush \"redirect-gateway def1 bypass-dhcp\"\npush \"dhcp-option DNS 8.8.8.8\"\npush \"dhcp-option DNS 8.8.4.4\"\nkeepalive 10 120\ncipher AES-256-CBC\ncomp-lzo\nuser nobody\ngroup nogroup\npersist-key\npersist-tun\nstatus openvpn-status.log\nverb 3\ncrl-verify crl.pem\n<\/code><\/pre>\n<h3>\u751f\u6210\u5ba2\u6237\u7aef\u914d\u7f6e\u6587\u4ef6<\/h3>\n<pre><code class=\"language-shell line-numbers\">sudo .\/openvpn-install.sh\nLooks like OpenVPN is already installed.\n\nWhat do you want to do?\n   1) Add a new user\n   2) Revoke an existing user\n   3) Remove OpenVPN\n   4) Exit\nSelect an option [1-4]: 1\n\nTell me a name for the client certificate.\nPlease, use one word only, no special characters.\nClient name: josphat.mutai\nGenerating a 2048 bit RSA private key\n...+++\n.............................................................................................................................+++\nwriting new private key to '\/etc\/openvpn\/easy-rsa\/pki\/private\/josphat.mutai.key.8dsSsOTWPe'\n-----\nUsing configuration from .\/openssl-easyrsa.cnf\nCheck that the request matches the signature\nSignature ok\nThe Subject's Distinguished Name is as follows\ncommonName            :ASN.1 12:'josphat.mutai'\nCertificate is to be certified until Jul  4 08:10:32 2028 GMT (3650 days)\n\nWrite out database with 1 new entries\nData Base Updated\n\nClient josphat.mutai added, configuration is available at: \/root\/josphat.mutai.ovpn\n<\/code><\/pre>\n<h4>copy\u5230windows\u5ba2\u6237\u7aef,windows\u9700\u5b89\u88c5winshhd<\/h4>\n<pre><code class=\"language-shell line-numbers\">scp \/root\/josphat.mutai.ovpn Administrator@192.168.0.13:\/c:\/\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>git clone https:\/\/github.com\/Nyr\/openvpn-install.git cd [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[15],"tags":[399],"class_list":["post-847","post","type-post","status-publish","format-standard","hentry","category-15","tag-399"],"_links":{"self":[{"href":"https:\/\/wyxxt.org.cn\/index.php?rest_route=\/wp\/v2\/posts\/847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wyxxt.org.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wyxxt.org.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wyxxt.org.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wyxxt.org.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=847"}],"version-history":[{"count":2,"href":"https:\/\/wyxxt.org.cn\/index.php?rest_route=\/wp\/v2\/posts\/847\/revisions"}],"predecessor-version":[{"id":849,"href":"https:\/\/wyxxt.org.cn\/index.php?rest_route=\/wp\/v2\/posts\/847\/revisions\/849"}],"wp:attachment":[{"href":"https:\/\/wyxxt.org.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wyxxt.org.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wyxxt.org.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}