+#include "readline/readline.h"
+
+int main(int argc, char** argv)
+{
+ char* line = readline("my-rl-example> ");
+ printf("You entered: \"%s\"\n", line);
+
+ free(line);
+
+ return 0;
+}
+```
+
+你的程序会把控制权交给 Readline,它会负责从用户那里获得一行输入(以这样的方式让用户可以做所有花哨的行编辑工作),一旦用户真正提交了这一行,Readline 就会把它返回给你。在我的库搜索路径中有 Readline 库,所以我可以通过调用以下内容来链接 Readline 库,从而编译上面的内容:
+
+```
+$ gcc main.c -lreadline
+```
+
+当然,Readline 的 API 比起那个单一的函数要丰富得多,任何使用它的人都可以对库的行为进行各种调整,库的用户(开发者)甚至可以添加新的函数,来让最终用户可以通过 `~/.inputrc` 来配置它们,这意味着 Readline 非常容易扩展。但是据我所知,即使是 Bash ,虽然事先有很多配置,最终也会像上面的例子一样调用简单的 `readline()` 函数来获取输入。(参见 GNU Bash 源代码中的[这一行][3],Bash 似乎在这里将获取输入的责任交给了 Readline)。
+
+Ramey 现在已经在 Bash 和 Readline 上工作了二十多年,但他的工作却从来没有得到过报酬 —— 他一直都是一名志愿者。Bash 和 Readline 仍然在积极开发中,尽管 Ramey 说 Readline 的变化比 Bash 慢得多。我问 Ramey 作为这么多人使用的软件唯一的维护者是什么感觉,他说可能有几百万人在不知不觉中使用 Bash(因为每个苹果设备都运行 Bash),这让他担心一个破坏性的变化会造成多大的混乱,不过他已经慢慢习惯了所有这些人的想法。他还说他会继续在 Bash 和 Readline 上工作,因为在这一点上他已经深深地投入了,而且他也只是单纯地喜欢把有用的软件提供给世界。
+
+_你可以在 [Chet Ramey 的网站][4]上找到更多关于他的信息。_
+
+_喜欢这篇文章吗?我会每四周写出一篇像这样的文章。关注推特帐号 [@TwoBitHistory][5] 或者[订阅 RSS][6] 来获取更新吧!_
+
+--------------------------------------------------------------------------------
+
+via: https://twobithistory.org/2019/08/22/readline.html
+
+作者:[Two-Bit History][a]
+选题:[lujun9972][b]
+译者:[rakino](https://github.com/rakino)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://twobithistory.org
+[b]: https://github.com/lujun9972
+[1]: https://tiswww.case.edu/php/chet/readline/readline.html
+[2]: https://web.archive.org/web/20151105130220/http://www2.research.att.com/sw/download/man/man1/ksh88.html
+[3]: https://github.com/bminor/bash/blob/9f597fd10993313262cab400bf3c46ffb3f6fd1e/parse.y#L1487
+[4]: https://tiswww.case.edu/php/chet/
+[5]: https://twitter.com/TwoBitHistory
+[6]: https://twobithistory.org/feed.xml
+[7]: https://twitter.com/TwoBitHistory/status/1112492084383092738?ref_src=twsrc%5Etfw
diff --git a/published/202010/20191105 My first contribution to open source- Making a decision.md b/published/202010/20191105 My first contribution to open source- Making a decision.md
new file mode 100644
index 0000000000..a8863ea7ff
--- /dev/null
+++ b/published/202010/20191105 My first contribution to open source- Making a decision.md
@@ -0,0 +1,59 @@
+[#]: collector: (lujun9972)
+[#]: translator: (chenmu-kk)
+[#]: reviewer: (wxy)
+[#]: publisher: (wxy)
+[#]: url: (https://linux.cn/article-12768-1.html)
+[#]: subject: (My first contribution to open source: Making a decision)
+[#]: via: (https://opensource.com/article/19/11/my-first-open-source-contribution-mistake-decisions)
+[#]: author: (Galen Corey https://opensource.com/users/galenemco)
+
+我的第一次开源贡献:做出决定
+======
+
+> 一位新的开源贡献者告诉你如何加入到开源项目中。
+
+![](https://img.linux.net.cn/data/attachment/album/202010/30/112350rh0xwp1x1y6awehn.jpg)
+
+先前,我把我的第一次开源贡献的拖延归咎于[冒牌综合症][2]。但还有一个我无法忽视的因素:我做出决定太艰难了。在[成千上百万][3]的开源项目中选择时,选择一个要做贡献的项目是难以抉择的。如此重负,以至于我常常不得不关掉我的笔记本去思考:“或许我改天再做吧”。
+
+错误之二是让我对做出决定的恐惧妨碍了我做出第一次贡献。在理想世界里,也许开始我的开源之旅时,心中就已经有了一个真正关心和想去做的具体项目,但我有的只是总得为开源项目做出贡献的模糊目标。对于那些处于同一处境的人来说,这儿有一些帮助我挑选出合适的项目(或者至少是一个好的项目)来做贡献的策略。
+
+### 经常使用的工具
+
+一开始,我不认为有必要将自己局限于已经熟悉的工具或项目。有一些项目我之前从未使用过,但由于它们的社区很活跃,或者它们解决的问题很有趣,因此看起来很有吸引力。
+
+但是,考虑我投入到这个项目中的时间有限,我决定继续投入到我了解的工具上去。要了解工具需求,你需要熟悉它的工作方式。如果你想为自己不熟悉的项目做贡献,则需要完成一个额外的步骤来了解代码的功能和目标。这个额外的工作量可能是有趣且值得的,但也会使你的工作时间加倍。因为我的目标主要是贡献,投入到我了解的工具上是缩小范围的很好方式。回馈一个你认为有用的项目也是有意义的。
+
+### 活跃而友好的社区
+
+在选择项目的时候,我希望在那里有人会审查我写的代码才会觉得有信心。当然,我也希望审核我代码的人是个和善的人。毕竟,把你的作品放在那里接受公众监督是很可怕的。虽然我对建设性的反馈持开放态度,但开发者社区中的一些有毒角落是我希望避免的。
+
+为了评估我将要加入的社区,我查看了我正在考虑加入的仓库的议题部分。我要查看核心团队中是否有人定期回复。更重要的是,我试着确保没有人在评论中互相诋毁(这在议题讨论中是很常见的)。我还留意了那些有行为准则的项目,概述了什么是适当的和不适当的在线互动行为。
+
+### 明确的贡献准则
+
+因为这是我第一次为开源项目做出贡献,在此过程中我有很多问题。一些项目社区在流程的文档记录方面做的很好,可以用来指导挑选其中的议题并发起拉取请求。 [Gatsby][4] 是这种做法的典范,尽管那时我没有选择它们,因为在此之前我从未使用过该产品。
+
+这种清晰的文档帮助我们缓解了一些不知如何去做的不安全感。它也给了我希望:项目对新的贡献者是开放的,并且会花时间来查看我的工作。除了贡献准则外,我还查看了议题部分,看看这个项目是否使用了“第一个好议题”标志。这是该项目对初学者开放的另一个迹象(并可以帮助你学会要做什么)。
+
+### 总结
+
+如果你还没有计划好选择一个项目,那么选择合适的领域进行你的第一个开源贡献更加可行。列出一系列标准可以帮助自己缩减选择范围,并为自己的第一个拉取请求找到一个好的项目。
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/19/11/my-first-open-source-contribution-mistake-decisions
+
+作者:[Galen Corey][a]
+选题:[lujun9972][b]
+译者:[chenmu-kk](https://github.com/chenmu-kk)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://opensource.com/users/galenemco
+[b]: https://github.com/lujun9972
+[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lightbulb-idea-think-yearbook-lead.png?itok=5ZpCm0Jh (Lightbulb)
+[2]: https://opensource.com/article/19/10/my-first-open-source-contribution-mistakes
+[3]: https://github.blog/2018-02-08-open-source-project-trends-for-2018/
+[4]: https://www.gatsbyjs.org/contributing/
diff --git a/published/202010/20200512 Scan your Linux security with Lynis.md b/published/202010/20200512 Scan your Linux security with Lynis.md
new file mode 100644
index 0000000000..e945d3b86d
--- /dev/null
+++ b/published/202010/20200512 Scan your Linux security with Lynis.md
@@ -0,0 +1,380 @@
+[#]: collector: (lujun9972)
+[#]: translator: (wxy)
+[#]: reviewer: (wxy)
+[#]: publisher: (wxy)
+[#]: url: (https://linux.cn/article-12696-1.html)
+[#]: subject: (Scan your Linux security with Lynis)
+[#]: via: (https://opensource.com/article/20/5/linux-security-lynis)
+[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe)
+
+使用 Lynis 扫描 Linux 安全性
+======
+
+> 使用这个全面的开源安全审计工具检查你的 Linux 机器的安全性。
+
+![](https://img.linux.net.cn/data/attachment/album/202010/08/095516k6bdgeb6jhiajutm.jpg)
+
+你有没有想过你的 Linux 机器到底安全不安全?Linux 发行版众多,每个发行版都有自己的默认设置,你在上面运行着几十个版本各异的软件包,还有众多的服务在后台运行,而我们几乎不知道或不关心这些。
+
+要想确定安全态势(指你的 Linux 机器上运行的软件、网络和服务的整体安全状态),你可以运行几个命令,得到一些零碎的相关信息,但你需要解析的数据量是巨大的。
+
+如果能运行一个工具,生成一份关于机器安全状况的报告,那就好得多了。而幸运的是,有一个这样的软件:[Lynis][2]。它是一个非常流行的开源安全审计工具,可以帮助强化基于 Linux 和 Unix 的系统。根据该项目的介绍:
+
+> “它运行在系统本身,可以进行深入的安全扫描。主要目标是测试安全防御措施,并提供进一步强化系统的提示。它还将扫描一般系统信息、易受攻击的软件包和可能的配置问题。Lynis 常被系统管理员和审计人员用来评估其系统的安全防御。”
+
+### 安装 Lynis
+
+你的 Linux 软件仓库中可能有 Lynis。如果有的话,你可以用以下方法安装它:
+
+```
+dnf install lynis
+```
+
+或
+
+```
+apt install lynis
+```
+
+然而,如果你的仓库中的版本不是最新的,你最好从 GitHub 上安装它。(我使用的是 Red Hat Linux 系统,但你可以在任何 Linux 发行版上运行它)。就像所有的工具一样,先在虚拟机上试一试是有意义的。要从 GitHub 上安装它:
+
+```
+$ cat /etc/redhat-release
+Red Hat Enterprise Linux Server release 7.8 (Maipo)
+$
+$ uname -r
+3.10.0-1127.el7.x86_64
+$
+$ git clone https://github.com/CISOfy/lynis.git
+Cloning into 'lynis'...
+remote: Enumerating objects: 30, done.
+remote: Counting objects: 100% (30/30), done.
+remote: Compressing objects: 100% (30/30), done.
+remote: Total 12566 (delta 15), reused 8 (delta 0), pack-reused 12536
+Receiving objects: 100% (12566/12566), 6.36 MiB | 911.00 KiB/s, done.
+Resolving deltas: 100% (9264/9264), done.
+$
+```
+
+一旦你克隆了这个版本库,那么进入该目录,看看里面有什么可用的。主要的工具在一个叫 `lynis` 的文件里。它实际上是一个 shell 脚本,所以你可以打开它看看它在做什么。事实上,Lynis 主要是用 shell 脚本来实现的:
+
+```
+$ cd lynis/
+$ ls
+CHANGELOG.md CONTRIBUTING.md db developer.prf FAQ include LICENSE lynis.8 README SECURITY.md
+CODE_OF_CONDUCT.md CONTRIBUTORS.md default.prf extras HAPPY_USERS.md INSTALL lynis plugins README.md
+$
+$ file lynis
+lynis: POSIX shell script, ASCII text executable, with very long lines
+$
+```
+
+### 运行 Lynis
+
+通过给 Lynis 一个 `-h` 选项来查看帮助部分,以便有个大概了解:
+
+```
+$ ./lynis -h
+```
+
+你会看到一个简短的信息屏幕,然后是 Lynis 支持的所有子命令。
+
+接下来,尝试一些测试命令以大致熟悉一下。要查看你正在使用的 Lynis 版本,请运行:
+
+```
+$ ./lynis show version
+3.0.0
+$
+```
+
+要查看 Lynis 中所有可用的命令:
+
+```
+$ ./lynis show commands
+
+Commands:
+lynis audit
+lynis configure
+lynis generate
+lynis show
+lynis update
+lynis upload-only
+
+$
+```
+
+### 审计 Linux 系统
+
+要审计你的系统的安全态势,运行以下命令:
+
+```
+$ ./lynis audit system
+```
+
+这个命令运行得很快,并会返回一份详细的报告,输出结果可能一开始看起来很吓人,但我将在下面引导你来阅读它。这个命令的输出也会被保存到一个日志文件中,所以你可以随时回过头来检查任何可能感兴趣的东西。
+
+Lynis 将日志保存在这里:
+
+```
+ Files:
+ - Test and debug information : /var/log/lynis.log
+ - Report data : /var/log/lynis-report.dat
+```
+
+你可以验证是否创建了日志文件。它确实创建了:
+
+```
+$ ls -l /var/log/lynis.log
+-rw-r-----. 1 root root 341489 Apr 30 05:52 /var/log/lynis.log
+$
+$ ls -l /var/log/lynis-report.dat
+-rw-r-----. 1 root root 638 Apr 30 05:55 /var/log/lynis-report.dat
+$
+```
+
+### 探索报告
+
+Lynis 提供了相当全面的报告,所以我将介绍一些重要的部分。作为初始化的一部分,Lynis 做的第一件事就是找出机器上运行的操作系统的完整信息。之后是检查是否安装了什么系统工具和插件:
+
+```
+[+] Initializing program
+------------------------------------
+ - Detecting OS... [ DONE ]
+ - Checking profiles... [ DONE ]
+
+ ---------------------------------------------------
+ Program version: 3.0.0
+ Operating system: Linux
+ Operating system name: Red Hat Enterprise Linux Server 7.8 (Maipo)
+ Operating system version: 7.8
+ Kernel version: 3.10.0
+ Hardware platform: x86_64
+ Hostname: example
+ ---------------------------------------------------
+<<截断>>
+
+[+] System Tools
+------------------------------------
+ - Scanning available tools...
+ - Checking system binaries...
+
+[+] Plugins (phase 1)
+------------------------------------
+ Note: plugins have more extensive tests and may take several minutes to complete
+
+ - Plugin: pam
+ [..]
+ - Plugin: systemd
+ [................]
+```
+
+接下来,该报告被分为不同的部分,每个部分都以 `[+]` 符号开头。下面可以看到部分章节。(哇,要审核的地方有这么多,Lynis 是最合适的工具!)
+
+```
+[+] Boot and services
+[+] Kernel
+[+] Memory and Processes
+[+] Users, Groups and Authentication
+[+] Shells
+[+] File systems
+[+] USB Devices
+[+] Storage
+[+] NFS
+[+] Name services
+[+] Ports and packages
+[+] Networking
+[+] Printers and Spools
+[+] Software: e-mail and messaging
+[+] Software: firewalls
+[+] Software: webserver
+[+] SSH Support
+[+] SNMP Support
+[+] Databases
+[+] LDAP Services
+[+] PHP
+[+] Squid Support
+[+] Logging and files
+[+] Insecure services
+[+] Banners and identification
+[+] Scheduled tasks
+[+] Accounting
+[+] Time and Synchronization
+[+] Cryptography
+[+] Virtualization
+[+] Containers
+[+] Security frameworks
+[+] Software: file integrity
+[+] Software: System tooling
+[+] Software: Malware
+[+] File Permissions
+[+] Home directories
+[+] Kernel Hardening
+[+] Hardening
+[+] Custom tests
+```
+
+Lynis 使用颜色编码使报告更容易解读。
+
+ * 绿色。一切正常
+ * 黄色。跳过、未找到,可能有个建议
+ * 红色。你可能需要仔细看看这个
+
+在我的案例中,大部分的红色标记都是在 “Kernel Hardening” 部分找到的。内核有各种可调整的设置,它们定义了内核的功能,其中一些可调整的设置可能有其安全场景。发行版可能因为各种原因没有默认设置这些,但是你应该检查每一项,看看你是否需要根据你的安全态势来改变它的值:
+
+```
+[+] Kernel Hardening
+------------------------------------
+ - Comparing sysctl key pairs with scan profile
+ - fs.protected_hardlinks (exp: 1) [ OK ]
+ - fs.protected_symlinks (exp: 1) [ OK ]
+ - fs.suid_dumpable (exp: 0) [ OK ]
+ - kernel.core_uses_pid (exp: 1) [ OK ]
+ - kernel.ctrl-alt-del (exp: 0) [ OK ]
+ - kernel.dmesg_restrict (exp: 1) [ DIFFERENT ]
+ - kernel.kptr_restrict (exp: 2) [ DIFFERENT ]
+ - kernel.randomize_va_space (exp: 2) [ OK ]
+ - kernel.sysrq (exp: 0) [ DIFFERENT ]
+ - kernel.yama.ptrace_scope (exp: 1 2 3) [ DIFFERENT ]
+ - net.ipv4.conf.all.accept_redirects (exp: 0) [ DIFFERENT ]
+ - net.ipv4.conf.all.accept_source_route (exp: 0) [ OK ]
+ - net.ipv4.conf.all.bootp_relay (exp: 0) [ OK ]
+ - net.ipv4.conf.all.forwarding (exp: 0) [ OK ]
+ - net.ipv4.conf.all.log_martians (exp: 1) [ DIFFERENT ]
+ - net.ipv4.conf.all.mc_forwarding (exp: 0) [ OK ]
+ - net.ipv4.conf.all.proxy_arp (exp: 0) [ OK ]
+ - net.ipv4.conf.all.rp_filter (exp: 1) [ OK ]
+ - net.ipv4.conf.all.send_redirects (exp: 0) [ DIFFERENT ]
+ - net.ipv4.conf.default.accept_redirects (exp: 0) [ DIFFERENT ]
+ - net.ipv4.conf.default.accept_source_route (exp: 0) [ OK ]
+ - net.ipv4.conf.default.log_martians (exp: 1) [ DIFFERENT ]
+ - net.ipv4.icmp_echo_ignore_broadcasts (exp: 1) [ OK ]
+ - net.ipv4.icmp_ignore_bogus_error_responses (exp: 1) [ OK ]
+ - net.ipv4.tcp_syncookies (exp: 1) [ OK ]
+ - net.ipv4.tcp_timestamps (exp: 0 1) [ OK ]
+ - net.ipv6.conf.all.accept_redirects (exp: 0) [ DIFFERENT ]
+ - net.ipv6.conf.all.accept_source_route (exp: 0) [ OK ]
+ - net.ipv6.conf.default.accept_redirects (exp: 0) [ DIFFERENT ]
+ - net.ipv6.conf.default.accept_source_route (exp: 0) [ OK ]
+```
+
+看看 SSH 这个例子,因为它是一个需要保证安全的关键领域。这里没有什么红色的东西,但是 Lynis 对我的环境给出了很多强化 SSH 服务的建议:
+
+```
+[+] SSH Support
+------------------------------------
+ - Checking running SSH daemon [ FOUND ]
+ - Searching SSH configuration [ FOUND ]
+ - OpenSSH option: AllowTcpForwarding [ SUGGESTION ]
+ - OpenSSH option: ClientAliveCountMax [ SUGGESTION ]
+ - OpenSSH option: ClientAliveInterval [ OK ]
+ - OpenSSH option: Compression [ SUGGESTION ]
+ - OpenSSH option: FingerprintHash [ OK ]
+ - OpenSSH option: GatewayPorts [ OK ]
+ - OpenSSH option: IgnoreRhosts [ OK ]
+ - OpenSSH option: LoginGraceTime [ OK ]
+ - OpenSSH option: LogLevel [ SUGGESTION ]
+ - OpenSSH option: MaxAuthTries [ SUGGESTION ]
+ - OpenSSH option: MaxSessions [ SUGGESTION ]
+ - OpenSSH option: PermitRootLogin [ SUGGESTION ]
+ - OpenSSH option: PermitUserEnvironment [ OK ]
+ - OpenSSH option: PermitTunnel [ OK ]
+ - OpenSSH option: Port [ SUGGESTION ]
+ - OpenSSH option: PrintLastLog [ OK ]
+ - OpenSSH option: StrictModes [ OK ]
+ - OpenSSH option: TCPKeepAlive [ SUGGESTION ]
+ - OpenSSH option: UseDNS [ SUGGESTION ]
+ - OpenSSH option: X11Forwarding [ SUGGESTION ]
+ - OpenSSH option: AllowAgentForwarding [ SUGGESTION ]
+ - OpenSSH option: UsePrivilegeSeparation [ OK ]
+ - OpenSSH option: AllowUsers [ NOT FOUND ]
+ - OpenSSH option: AllowGroups [ NOT FOUND ]
+```
+
+我的系统上没有运行虚拟机或容器,所以这些显示的结果是空的:
+
+```
+[+] Virtualization
+------------------------------------
+
+[+] Containers
+------------------------------------
+```
+
+Lynis 会检查一些从安全角度看很重要的文件的文件权限:
+
+```
+[+] File Permissions
+------------------------------------
+ - Starting file permissions check
+ File: /boot/grub2/grub.cfg [ SUGGESTION ]
+ File: /etc/cron.deny [ OK ]
+ File: /etc/crontab [ SUGGESTION ]
+ File: /etc/group [ OK ]
+ File: /etc/group- [ OK ]
+ File: /etc/hosts.allow [ OK ]
+ File: /etc/hosts.deny [ OK ]
+ File: /etc/issue [ OK ]
+ File: /etc/issue.net [ OK ]
+ File: /etc/motd [ OK ]
+ File: /etc/passwd [ OK ]
+ File: /etc/passwd- [ OK ]
+ File: /etc/ssh/sshd_config [ OK ]
+ Directory: /root/.ssh [ SUGGESTION ]
+ Directory: /etc/cron.d [ SUGGESTION ]
+ Directory: /etc/cron.daily [ SUGGESTION ]
+ Directory: /etc/cron.hourly [ SUGGESTION ]
+ Directory: /etc/cron.weekly [ SUGGESTION ]
+ Directory: /etc/cron.monthly [ SUGGESTION ]
+```
+
+在报告的底部,Lynis 根据报告的发现提出了建议。每项建议后面都有一个 “TEST-ID”(为了下一部分方便,请将其保存起来)。
+
+```
+ Suggestions (47):
+ ----------------------------
+ * If not required, consider explicit disabling of core dump in /etc/security/limits.conf file [KRNL-5820]
+ https://cisofy.com/lynis/controls/KRNL-5820/
+
+ * Check PAM configuration, add rounds if applicable and expire passwords to encrypt with new values [AUTH-9229]
+ https://cisofy.com/lynis/controls/AUTH-9229/
+```
+
+Lynis 提供了一个选项来查找关于每个建议的更多信息,你可以使用 `show details` 命令和 TEST-ID 号来访问:
+
+```
+./lynis show details TEST-ID
+```
+
+这将显示该测试的其他信息。例如,我检查了 SSH-7408 的详细信息:
+
+```
+$ ./lynis show details SSH-7408
+2020-04-30 05:52:23 Performing test ID SSH-7408 (Check SSH specific defined options)
+2020-04-30 05:52:23 Test: Checking specific defined options in /tmp/lynis.k8JwazmKc6
+2020-04-30 05:52:23 Result: added additional options for OpenSSH < 7.5
+2020-04-30 05:52:23 Test: Checking AllowTcpForwarding in /tmp/lynis.k8JwazmKc6
+2020-04-30 05:52:23 Result: Option AllowTcpForwarding found
+2020-04-30 05:52:23 Result: Option AllowTcpForwarding value is YES
+2020-04-30 05:52:23 Result: OpenSSH option AllowTcpForwarding is in a weak configuration state and should be fixed
+2020-04-30 05:52:23 Suggestion: Consider hardening SSH configuration [test:SSH-7408] [details:AllowTcpForwarding (set YES to NO)] [solution:-]
+```
+
+### 试试吧
+
+如果你想更多地了解你的 Linux 机器的安全性,请试试 Lynis。如果你想了解 Lynis 是如何工作的,可以研究一下它的 shell 脚本,看看它是如何收集这些信息的。
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/20/5/linux-security-lynis
+
+作者:[Gaurav Kamathe][a]
+选题:[lujun9972][b]
+译者:[wxy](https://github.com/wxy)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://opensource.com/users/gkamathe
+[b]: https://github.com/lujun9972
+[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer)
+[2]: https://github.com/CISOfy/lynis
diff --git a/published/202010/20200521 Use the internet from the command line with curl.md b/published/202010/20200521 Use the internet from the command line with curl.md
new file mode 100644
index 0000000000..9880cead4e
--- /dev/null
+++ b/published/202010/20200521 Use the internet from the command line with curl.md
@@ -0,0 +1,171 @@
+[#]: collector: (lujun9972)
+[#]: translator: (MjSeven)
+[#]: reviewer: (wxy)
+[#]: publisher: (wxy)
+[#]: url: (https://linux.cn/article-12772-1.html)
+[#]: subject: (Use the internet from the command line with curl)
+[#]: via: (https://opensource.com/article/20/5/curl-cheat-sheet)
+[#]: author: (Seth Kenlon https://opensource.com/users/seth)
+
+使用 curl 从命令行访问互联网
+======
+
+> 下载我们整理的 curl 备忘录。要在不使用图形界面的情况下从互联网上获取所需的信息,curl 是一种快速有效的方法。
+
+![](https://img.linux.net.cn/data/attachment/album/202010/31/000543n032ud499yy4d94v.jpg)
+
+`curl` 通常被视作一款非交互式 Web 浏览器,这意味着它能够从互联网上获取信息,并在你的终端中显示,或将其保存到文件中。从表面看,这是 Web 浏览器,类似 Firefox 或 Chromium 所做的工作,只是它们默认情况下会*渲染*信息,而 `curl` 会下载并显示原始信息。实际上,`curl` 命令可以做更多的事情,并且能够使用多种协议与服务器进行双向传输数据,这些协议包括 HTTP、FTP、SFTP、IMAP、POP3、LDAP、SMB、SMTP 等。对于普通终端用户来说,这是一个有用的工具;而对于系统管理员,这非常便捷;对于微服务和云开发人员来说,它是一个质量保证工具。
+
+`curl` 被设计为在没有用户交互的情况下工作,因此与 Firefox 不同,你必须从头到尾考虑与在线数据的交互。例如,如果想要在 Firefox 中查看网页,你需要启动 Firefox 窗口。打开 Firefox 后,在地址栏或搜索引擎中输入要访问的网站。然后,导航到网站,然后单击要查看的页面。
+
+对于 `curl` 来说也是如此,不同之处在于你需要一次执行所有操作:在启动 `curl` 的同时提供需要访问的互联网地址,并告诉它是否要将数据保存在终端或文件中。当你必须与需要身份验证的网站或 API 进行交互时,会变得有点复杂,但是一旦你学习了 `curl` 命令语法,它就会变得自然而然。为了帮助你掌握它,我们在一个方便的[备忘录][2]中收集了相关的语法信息。
+
+### 使用 curl 下载文件
+
+你可以通过提供指向特定 URL 的链接来使用 `curl` 命令下载文件。如果你提供的 URL 默认为 `index.html`,那么将下载此页面,并将下载的文件显示在终端屏幕上。你可以将数据通过管道传递到 `less`、`tail` 或任何其它命令:
+
+```
+$ curl "http://example.com" | tail -n 4
+ Example Domain
+ This domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission.
+ More information...
+