在Linux中安装和配置Open科学 Server的最简便方法!

[[189329]]

【】本文介绍了如何在基于RPM和DEB的系统中安装和配置Open科学服务器。我们在本文中将使用一个名为open科学-install的脚本,它使整个Open科学服务器的安装和配置过程实现了自动化。该脚本可帮助你在几分钟内搭建好自己的科学服务器,哪怕你之前没有用过Open科学。

好了,闲话少说。

在Linux中安装和配置Open科学 Server

出于本文的需要,我将使用两个运行CentOS 7 64位版本的系统。一个充当Open科学服务器,另一个充当Open科学客户机。下面是测试系统的详细信息。

  • Open科学服务器:
  • 操作系统:CentOS 7 64位极简版
  • IP地址:192.168.43.150/24
  • 主机名称:科学server.ostechnix.local
  • Open科学客户机:
  • 操作系统:CentOS 7 64位极简版
  • IP地址:192.168.43.199/24

我们先来看看服务器端配置。

Open科学 Server的安装和配置

从GitHub页面下载open科学-install脚本。

wget https://git.io/科学 -O open科学-install.sh

然后,使用下列命令,以root用户的身份运行该脚本:

  1. bash open科学-install.sh 

系统会要求你回答一系列问题。回答相应的问题。

确保科学服务器的IP地址正确。如果你使用多个IP地址,输入想让Open科学侦听的那个网络接口的IP地址。

  • Welcome to this quick Open科学 “road warrior” installer
  • I need to ask you a few questions before starting the setup
  • You can leave the default options and just press enter if you are ok with them
  • First I need to know the IPv4 address of the network interface you want Open科学
  • listening to.
  • IP address: 192.168.43.150

选择你想使用哪种协议。我想要使用tcp端口,因此选择了数字2。

Which protocol do you want for Open科学 connections?

1) UDP (recommended)

2) TCP

Protocol [1-2]: 2

输入端口号。

What port do you want Open科学 listening to?

Port: 1194

输入你想与科学结合使用的DNS服务器细节。我想使用谷歌DNS解析器,于是选择了选项2。

Which DNS do you want to use with the 科学?

1) Current system resolvers

2) Google

3) OpenDNS

4) NTT

5) Hurricane Electric

6) Verisign

DNS [1-6]: 2

我们已到了最后一步。输入你的客户机证书名称。这个名称应该是一个单词,不该含有任何特殊字符。

  • Finally, tell me your name for the client certificate
  • Please, use one word only, no special characters
  • Client name: client

按回车键,开始Open科学服务器的安装。

  • Okay, that was all I needed. We are ready to setup your Open科学 server now
  • Press any key to continue…

没有任何问题,该脚本会开始装上安装Open科学服务器需要的所有必要依赖项。另外,它还会创建所有必要的密钥和证书,以便通过科学客户机的验证。这个过程需要几分钟。

最后,脚本会问你有没有任何外部IP地址。如果没有外部IP地址,就让它空着,不用管,按回车键。

  • If your server is NATed (e.g. LowEndSpirit), I need to know the external IP
  • If that’s not the case, just ignore this and leave the next field blank
  • External IP:
  • Finished!
  • Your client configuration is available at /root/client.o科学
  • If you want to add more clients, you simply need to run this script again!

Open科学服务器的安装和配置已完成。你从最后的输出中可以看出,客户机配置细节保存在文件/root/client.o科学中。需要将该文件拷贝到你的所有科学客户机系统。

我将client.o科学文件拷贝到了我的科学客户机。

  1. scp client.o科学 [email protected]:/etc/open科学/ 

接下来,我们需要配置Open科学客户机。

Open科学客户机的配置

确保你从科学服务器系统拷贝过来了client.o科学文件。我已经将这个文件拷贝到科学客户机系统的/etc/open科学/目录。

使用发行版软件包管理器安装Open科学软件包。

  1. yum install open科学 

接下来,运行下列命令,与科学服务器之间建立一条安全连接。

  1. open科学 --config /etc/open科学/client.o科学 

示例输出:

  1. Wed Apr 5 18:50:44 2017 Unrecognized option or missing parameter(s) in /etc/open科学/client.o科学:14: block-outside-dns (2.3.14) 
  2. Wed Apr 5 18:50:44 2017 Open科学 2.3.14 x86_64-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Dec 7 2016 
  3. Wed Apr 5 18:50:44 2017 library versions: OpenSSL 1.0.1e-fips 11 Feb 2013, LZO 2.06 
  4. Wed Apr 5 18:50:44 2017 Control Channel Authentication: tls-auth using INLINE static key file 
  5. Wed Apr 5 18:50:44 2017 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication 
  6. Wed Apr 5 18:50:44 2017 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication 
  7. Wed Apr 5 18:50:44 2017 Socket Buffers: R=[87380->87380] S=[16384->16384] 
  8. Wed Apr 5 18:50:44 2017 Attempting to establish TCP connection with [AF_INET]192.168.43.150:1194 [nonblock] 
  9. Wed Apr 5 18:50:45 2017 TCP connection established with [AF_INET]192.168.43.150:1194 
  10. Wed Apr 5 18:50:45 2017 TCPv4_CLIENT link local: [undef] 
  11. Wed Apr 5 18:50:45 2017 TCPv4_CLIENT link remote: [AF_INET]192.168.43.150:1194 
  12. Wed Apr 5 18:50:45 2017 TLS: Initial packet from [AF_INET]192.168.43.150:1194, sid=c6fb554e 362eb192 
  13. Wed Apr 5 18:50:45 2017 VERIFY OK: depth=1, CN=ChangeMe 
  14. Wed Apr 5 18:50:45 2017 Validating certificate key usage 
  15. Wed Apr 5 18:50:45 2017 ++ Certificate has key usage 00a0, expects 00a0 
  16. Wed Apr 5 18:50:45 2017 VERIFY KU OK 
  17. Wed Apr 5 18:50:45 2017 Validating certificate extended key usage 
  18. Wed Apr 5 18:50:45 2017 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication 
  19. Wed Apr 5 18:50:45 2017 VERIFY EKU OK 
  20. Wed Apr 5 18:50:45 2017 VERIFY OK: depth=0, CN=server 
  21. Wed Apr 5 18:50:45 2017 Data Channel Encrypt: Cipher 'AES-256-CBC' initialized with 256 bit key 
  22. Wed Apr 5 18:50:45 2017 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication 
  23. Wed Apr 5 18:50:45 2017 Data Channel Decrypt: Cipher 'AES-256-CBC' initialized with 256 bit key 
  24. Wed Apr 5 18:50:45 2017 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication 
  25. Wed Apr 5 18:50:45 2017 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 DHE-RSA-AES256-GCM-SHA384, 2048 bit RSA 
  26. Wed Apr 5 18:50:45 2017 [server] Peer Connection Initiated with [AF_INET]192.168.43.150:1194 
  27. Wed Apr 5 18:50:48 2017 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1) 
  28. Wed Apr 5 18:50:48 2017 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 8.8.8.8,dhcp-option DNS 8.8.4.4,route-gateway 10.8.0.1,topology subnet,ping 10,ping-restart 120,ifconfig 10.8.0.2 255.255.255.0' 
  29. Wed Apr 5 18:50:48 2017 OPTIONS IMPORT: timers and/or timeouts modified 
  30. Wed Apr 5 18:50:48 2017 OPTIONS IMPORT: --ifconfig/up options modified 
  31. Wed Apr 5 18:50:48 2017 OPTIONS IMPORT: route options modified 
  32. Wed Apr 5 18:50:48 2017 OPTIONS IMPORT: route-related options modified 
  33. Wed Apr 5 18:50:48 2017 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified 
  34. Wed Apr 5 18:50:48 2017 ROUTE_GATEWAY 192.168.43.1/255.255.255.0 IFACE=enp0s3 HWADDR=08:00:27:28:98:6b 
  35. Wed Apr 5 18:50:48 2017 TUN/TAP device tun0 opened 
  36. Wed Apr 5 18:50:48 2017 TUN/TAP TX queue length set to 100 
  37. Wed Apr 5 18:50:48 2017 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0 
  38. Wed Apr 5 18:50:48 2017 /usr/sbin/ip link set dev tun0 up mtu 1500 
  39. Wed Apr 5 18:50:48 2017 /usr/sbin/ip addr add dev tun0 10.8.0.2/24 broadcast 10.8.0.255 
  40. Wed Apr 5 18:50:48 2017 /usr/sbin/ip route add 192.168.43.150/32 dev enp0s3 
  41. Wed Apr 5 18:50:48 2017 /usr/sbin/ip route add 0.0.0.0/1 via 10.8.0.1 
  42. Wed Apr 5 18:50:48 2017 /usr/sbin/ip route add 128.0.0.0/1 via 10.8.0.1 
  43. Wed Apr 5 18:50:48 2017 Initialization Sequence Completed 

现在,检查一下tun0(科学接口)是否已创建,并使用‘ip addr’命令,检查科学接口的IP地址。

  1. ip addr 

示例输出:

  1. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN  
  2.  link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 
  3.  inet 127.0.0.1/8 scope host lo 
  4.  valid_lft forever preferred_lft forever 
  5.  inet6 ::1/128 scope host  
  6.  valid_lft forever preferred_lft forever 
  7. 2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 
  8.  link/ether 08:00:27:28:98:6b brd ff:ff:ff:ff:ff:ff 
  9.  inet 192.168.43.199/24 brd 192.168.43.255 scope global dynamic enp0s3 
  10.  valid_lft 42359sec preferred_lft 42359sec 
  11.  inet6 fe80::a00:27ff:fe28:986b/64 scope link  
  12.  valid_lft forever preferred_lft forever 
  13. 3: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 100 
  14.  link/none  
  15.  inet 10.8.0.2/24 brd 10.8.0.255 scope global tun0 
  16.  valid_lft forever preferred_lft forever 

你可以从上述输出中看出,我们的科学服务器自动将IP地址10.8.0.2分配给了科学客户机。

现在试着从科学客户机系统ping该科学服务器:

ping -c3 10.8.0.1

示例输出:

  1. PING 10.8.0.1 (10.8.0.1) 56(84) bytes of data. 
  2. 64 bytes from 10.8.0.1: icmp_seq=1 ttl=64 time=1.05 ms 
  3. 64 bytes from 10.8.0.1: icmp_seq=2 ttl=64 time=1.94 ms 
  4. 64 bytes from 10.8.0.1: icmp_seq=3 ttl=64 time=2.49 ms 
  5. --- 10.8.0.1 ping statistics --- 
  6. 3 packets transmitted, 3 received, 0% packet loss, time 2001ms 
  7. rtt min/avg/max/mdev = 1.057/1.832/2.495/0.594 ms 

恭喜!我们现在已在CentOS中成功地安装和配置了Open科学服务器和客户机。这个方法对基于DEB的系统(比如Ubuntu和Linux Mint)来说一样。不像手动安装,该脚本让Open科学的安装和配置容易了许多。

原文标题:An Easiest Way To Install And Configure Open科学 Server In Linux,作者:SK

【译稿,合作站点转载请注明原文译者和出处为.com】

文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/130601.html<

(0)
运维的头像运维
上一篇2025-02-26 04:00
下一篇 2025-02-26 04:01

相关推荐

  • 个人主题怎么制作?

    制作个人主题是一个将个人风格、兴趣或专业领域转化为视觉化或结构化内容的过程,无论是用于个人博客、作品集、社交媒体账号还是品牌形象,核心都是围绕“个人特色”展开,以下从定位、内容规划、视觉设计、技术实现四个维度,详细拆解制作个人主题的完整流程,明确主题定位:找到个人特色的核心主题定位是所有工作的起点,需要先回答……

    2025-11-20
    0
  • 社群营销管理关键是什么?

    社群营销的核心在于通过建立有温度、有价值、有归属感的社群,实现用户留存、转化和品牌传播,其管理需贯穿“目标定位-内容运营-用户互动-数据驱动-风险控制”全流程,以下从五个维度展开详细说明:明确社群定位与目标社群管理的首要任务是精准定位,需明确社群的核心价值(如行业交流、产品使用指导、兴趣分享等)、目标用户画像……

    2025-11-20
    0
  • 香港公司网站备案需要什么材料?

    香港公司进行网站备案是一个涉及多部门协调、流程相对严谨的过程,尤其需兼顾中国内地与香港两地的监管要求,由于香港公司注册地与中国内地不同,其网站若主要服务内地用户或使用内地服务器,需根据服务器位置、网站内容性质等,选择对应的备案路径(如工信部ICP备案或公安备案),以下从备案主体资格、流程步骤、材料准备、注意事项……

    2025-11-20
    0
  • 如何企业上云推广

    企业上云已成为数字化转型的核心战略,但推广过程中需结合行业特性、企业痛点与市场需求,构建系统性、多维度的推广体系,以下从市场定位、策略设计、执行落地及效果优化四个维度,详细拆解企业上云推广的实践路径,精准定位:明确目标企业与核心价值企业上云并非“一刀切”的方案,需先锁定目标客户群体,提炼差异化价值主张,客户分层……

    2025-11-20
    0
  • PS设计搜索框的实用技巧有哪些?

    在PS中设计一个美观且功能性的搜索框需要结合创意构思、视觉设计和用户体验考量,以下从设计思路、制作步骤、细节优化及交互预览等方面详细说明,帮助打造符合需求的搜索框,设计前的规划明确使用场景:根据网站或APP的整体风格确定搜索框的调性,例如极简风适合细线条和纯色,科技感适合渐变和发光效果,电商类则可能需要突出搜索……

    2025-11-20
    0

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注