Merge remote-tracking branch 'upstream/master'

This commit is contained in:
locez 2017-03-01 15:11:50 +08:00
commit e883ebfebf
4 changed files with 43 additions and 104 deletions

View File

@ -1,10 +1,9 @@
How to Configure Network Between Guest VM and Host in Oracle VirtualBox
如何配置 VirtualBox 中的客户机与宿主机之间的网络连接
============================================================
如何配置 Oracle VirtualBox 中的客户机与宿主机网络
当你在 [Oracle VirtualBox 虚拟机软件][2] 中安装了各种操作系统时,你可能需要实现宿主机与虚拟机之间的相互访问。
当你在 [VirtualBox 虚拟机软件][2] 中安装了各种操作系统时,你可能需要实现宿主机与虚拟机之间的相互访问。
在这篇文章中,我们将会以最简单明了的方式来说明如何配置客户机与 Linux 宿主机的网络,以实现两者相互访问或者让客户机连接到外网。(译注:客户机指 Oracle VirtualBox 虚拟机软件中安装的操作系统,如本文中用到的 CentOS 7  Ubuntu 16.10 。宿主机就是你自己的笔记本电脑或台式机,注意这篇文章中作者的宿主机上安装的操作系统是 Linux Mint 18 ,而不是我们平时使用的 Windows 系统。)
在这篇文章中,我们将会以最简单明了的方式来说明如何配置客户机与 Linux 宿主机的网络,以实现两者相互访问或者让客户机连接到外网。(LCTT 译注:客户机指 Oracle VirtualBox 虚拟机软件中安装的操作系统,如本文中用到的 CentOS 7  Ubuntu 16.10 。宿主机就是你自己的笔记本电脑或台式机,注意这篇文章中作者的宿主机上安装的操作系统是 Linux Mint 18 ,而不是我们平时使用的 Windows 系统。)
本文测试环境:
1、宿主机操作系统—— Linux Mint 18
@ -13,42 +12,36 @@ How to Configure Network Between Guest VM and Host in Oracle VirtualBox
#### 要求
1、宿主机上安装的 [Oracle VirtualBox 虚拟机][1] 能正常使用。
2、你得事先在 Oracle virtualBox 虚拟机软件中安装好客户机操作系统,比如 Ubuntu Fedora CentOS Linux Mint 或者其它的 Linux 系统也行。
2、你得事先在 Oracle virtualBox 虚拟机软件中安装好客户机操作系统,比如 Ubuntu、Fedora、CentOS、 Linux Mint 或者其它的 Linux 系统也行。
3、在你配置网络前请先关闭客户机。
为了让宿主机和客户机能够互相联通,这两个机器的默认网卡 IP 必须设置在同一网段,你可以为客户机添加 4 块网卡。
为了让宿主机和客户机能够互相联通,这两个机器的默认网卡 IP 必须设置在同一网段,你可以为客户机添加多达 4 块网卡。
默认网卡(网卡 1 )通常用于使用 NAT 连接方式连接到宿主机进行上网。
默认网卡(网卡 1通常用于使用 NAT 连接方式连接到宿主机进行上网。
重要提示:设置第一块网卡与宿主机通信,第二块网卡连接到外网。
重要提示:通常总是设置第一块网卡与宿主机通信,第二块网卡连接到外网。
### 为客户机和宿主机创建网卡
在下面的 VirtualBox 管理器界面,创建客户机和宿主机之间的通信网卡。
打开文件->首选项配置或者使用组合键 `Ctrl + G`
打开文件->首选项配置或者使用组合键 `Ctrl + G`
[
![Virtualbox Preferences Window](http://www.tecmint.com/wp-content/uploads/2017/02/Virtualbox-Preferences-Window.png)
][3]
Virtualbox 首选项配置界面
*Virtualbox 首选项界面*
在下图中有两个选项,单击并选择仅主机( Host-only )网络。然后使用右侧的 `+` 来添加一个新的仅主机网络。
在下图中有两个选项,单击并选择仅主机( Host-only )网络。然后使用右侧的 `+` 按钮来添加一个新的仅主机网络。
[
![Set Guest Network](http://www.tecmint.com/wp-content/uploads/2017/02/Set-Guest-Network.png)
][4]
设置客户机网络
*设置客户机网络*
下图显示一个名为 vboxnet0 的新的仅主机模式网卡已经被创建。
[
![Virtualbox Preferences Window](http://www.tecmint.com/wp-content/uploads/2017/02/Virtualbox-Preferences-Window-1.png)
][5]
VirtualBox 首选项界面
这样就创建好了一个名为 vboxnet0 的新的仅主机模式网卡。
如果你愿意,你可以使用中间的 `-` 按钮来删除这个网卡,你可以单击编辑按钮来查看这个网卡的详细配置信息。
@ -60,7 +53,7 @@ VirtualBox 首选项界面
![Host Network Details](http://www.tecmint.com/wp-content/uploads/2017/02/Host-Network-Details.png)
][6]
宿主机网络信息
*宿主机网络信息*
下图中,如果你想让客户机使用动态 IP 地址,你可以通过配置 DHCP 服务来完成(在使用前请确保启用 DHCP )。但是我建议你为客户机配置一个静态 IP 地址。
@ -70,7 +63,7 @@ VirtualBox 首选项界面
![Set Guest Static IP aAddress](http://www.tecmint.com/wp-content/uploads/2017/02/Set-Guest-Static-IP-Address.png)
][7]
为客户机设置静态 IP 地址
*为客户机设置静态 IP 地址*
#### 配置客户机网络设置
@ -82,11 +75,12 @@ VirtualBox 首选项界面
![Configure VM Settings](http://www.tecmint.com/wp-content/uploads/2017/02/Configure-VM-Settings.png)
][8]
配置客户机网络设置
*配置客户机网络设置*
#### 配置客户机网卡以连接到宿主机
从下图的界面中选择网络选项。然后配置第一块网卡( 网卡 1 )的信息如下:
从下图的界面中选择网络选项。然后配置第一块网卡( 网卡 1 )的信息如下:
1、勾选选项“启用网卡”来开启该网卡。
2、在连接方式选项选择仅主机 Host-only )网络。
3、然后选择网卡名称vboxnet0
@ -97,7 +91,7 @@ VirtualBox 首选项界面
![Enable Network Adapter for Guest VM](http://www.tecmint.com/wp-content/uploads/2017/02/Enable-Network-Adapter-for-Guest-VM.png)
][9]
启用客户机网络
*启用客户机网络*
#### 配置客户机网卡连接外网
@ -123,18 +117,19 @@ $ ip add
![Configure Static IP Address for VM](http://www.tecmint.com/wp-content/uploads/2017/02/Configure-Static-IP-Address-for-VM.png)
][12]
为客户机配置静态 IP 地址
*为客户机配置静态 IP 地址*
从上面的截图中可以看出客户机已启用了三块网卡:
1、 `lo` ——回环网络接口
2、 `enp0s3` (网卡 1—— 前一步我们配置的连接方式为仅主机( Host-Only模式并且已启用 DHCP 的网卡,之后我们又配置成了静态 IP 地址。
3、 `enp0s8` (网卡 2 )—— 用于连接到外网。该网卡默认情况下使用 DHCP 来动态获取 IP 地址。
从上面的截图中可以看出客户机已启用了三块网卡:
1、`lo` ——回环网络接口
2、`enp0s3` (网卡 1—— 前一步我们配置的连接方式为仅主机( Host-Only模式并且已启用 DHCP 的网卡,之后我们又配置成了静态 IP 地址。
3、`enp0s8` (网卡 2—— 用于连接到外网。该网卡默认情况下使用 DHCP 来动态获取 IP 地址。
##### 在 Debian/Ubuntu/Linux Mint 系统下的配置
重要提示: 这里我使用的是 Ubuntu 16.10 Server IP 地址为 192.168.56.5 。
使用你喜欢的编辑器及管理员账号打开 /etc/network/interfaces 配置文件
使用你喜欢的编辑器及管理员账号打开 `/etc/network/interfaces` 配置文件:
```
$ sudo vi /etc/network/interfaces
@ -170,7 +165,7 @@ $ ip add
重要提示: 这里我使用的是 CentOS 7 系统, IP 地址为: 192.168.56.10 。
使用管理员帐号及你喜欢的编辑器打开 enp0s3 (仅主机网络)的网卡配置文件 /etc/sysconfig/network-scripts/ifcfg-enp0s3
使用管理员帐号及你喜欢的编辑器打开 enp0s3 (仅主机网络)的网卡配置文件 `/etc/sysconfig/network-scripts/ifcfg-enp0s3`
```
$ sudo vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
@ -213,7 +208,7 @@ $ who
![Connect Guest VM using SSH](http://www.tecmint.com/wp-content/uploads/2017/02/Connect-Guest-VM-using-SSH.png)
][13]
使用 SSH 工具连接客户机
*使用 SSH 工具连接客户机*
就写到这里吧!在这篇文章中,我们用简单易懂的方法讲述了如何在宿主机与客户机之间设置网络连接方式。请在下面的评论区跟大家分享下你的想法。
@ -221,7 +216,8 @@ $ who
作者简介:
Aaron Kili 是一名 Linux 和 F.O.S.S 爱好者,即将从事 Linux 系统管理员和网页开发工作,他日前是 TecMint 技术网站的原创作者,非常喜欢使用电脑工作,坚信分享知识是一种美德。
Aaron Kili 是一名 Linux 和 F.O.S.S 爱好者,即将从事 Linux 系统管理员和网页开发工作,他日前是 TecMint 技术网站的原创作者,非常喜欢使用电脑工作,坚信分享知识是一种美德。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/network-between-guest-vm-and-host-virtualbox/

View File

@ -1,20 +1,17 @@
如何在 Linux 中使用 sFTP 上传或下载文件/文件夹
============================================================
现在下载你的免费电子书 - [10 本对 Linux 管理员的免费电子书][10] | [4 本免费 Shell 脚本电子书][11]
[sFTP安全文件传输程序][1]是一种安全的交互式文件传输程序,其工作方式与 FTP文件传输协议类似。 然而sFTP 比 FTP 更安全;它通过加密 SSH 传输处理所有操作。
[sFTP安全文件传输程序][1]是一种安全和交互式文件传输程序,其工作方式与 FTP文件传输协议类似。 然而sFTP 比 FTP 更安全; 它通过加密 SSH 传输处理所有操作。
它可以配置为使用几个有用的 SSH 功能,如[公钥认证][2]和压缩。 它连接并登录到指定的远程机器,并切换到交互式命令模式,在该模式下用户可以执行各种命令。
它可以配置使用几个有用的 SSH 功能,如[公钥认证][2]和压缩。 它连接并登录到指定的远程机器,然后切换到交互式命令模式,在该模式下用户可以执行各种命令。
在本文中,我们将向你展示如何使用 sFTP 上传/下载整个目录(包括其子目录和子文件)。
### 如何在 Linux 中使用 sFTP 传输文件/文件夹
默认情况下SFTP 协议采用相同的 SSH 传输协议建立到远程服务器的安全连接。虽然,密码用于验证类似于默认 SSH 设置的用户,但是,建议[创建和使用 SSH 无密码登录][3],以简化和更安全地连接到远程主机。
默认情况下SFTP 协议采用和 SSH 传输协议一样的方式建立到远程服务器的安全连接。虽然,用户验证使用类似于 SSH 默认设置的密码方式,但是,建议[创建和使用 SSH 无密码登录][3],以简化和更安全地连接到远程主机。
要连接到远程 sftp 服务器,首先建议一个安全 SSH 连接,接着创建一个如下所示 SFTP 会话。
要连接到远程 sftp 服务器,如下建立一个安全 SSH 连接并创建 SFTP 会话:
```
$ sftp tecmint@192.168.56.10
@ -32,11 +29,11 @@ sftp> mkdir uploads #create a new directory
![Run sFTP Commands on Remote Linux](http://www.tecmint.com/wp-content/uploads/2017/02/Run-sFTP-Commands-on-Remote-Linux.png)
][4]
Linux 主机上运行 sFTP 命令
* Linux 主机上运行 sFTP 命令*
#### 如何使用 sFTP 上传文件夹
要将整个目录上传到远程 Linux 主机中,请使用 put 命令。但是,如果目录名称不存在于远程主机上的工作目录中,你将收到错误,如下面的屏幕截图所示。
要将整个目录上传到远程 Linux 主机中,请使用 `put` 命令。但是,如果目录名称不存在于远程主机上的工作目录中,你将收到错误,如下面的屏幕截图所示。
因此,首先在远程主机上创建一个具有相同名称的目录,然后从本地主机上传它,`-r` 参数允许拷贝子目录和子文件:
@ -45,11 +42,12 @@ sftp> put -r Tecmint.com-articles
sftp> mkdir Tecmint.com-articles
sftp> put -r Tecmint.com-articles
```
[
![Upload Directory using SFTP](http://www.tecmint.com/wp-content/uploads/2017/02/Upload-Directory-using-SFTP.png)
][5]
使用 SFTP 上传文件夹
*使用 sFTP 上传文件夹*
要保留修改时间、访问时间以及被传输的文件的模式,请使用 `-p` 标志。
@ -68,7 +66,7 @@ sftp> get -r fstools-0.0
![Download Directory using sFTP](http://www.tecmint.com/wp-content/uploads/2017/02/Download-Directory-using-sFTP.png)
][6]
使用 sFTP 下载目录
*使用 sFTP 下载目录*
如果文件夹已经下载完成了,接着查看本机的工作目录。
@ -80,7 +78,7 @@ sftp> bye
sftp> exit
```
此外,阅读这篇[ sFTP 命令和使用技巧][7]。
此外,阅读这篇 [sFTP 命令和使用技巧][7]。
请注意,为了防止用户访问远程主机上的整个文件系统,出于安全原因,你可以使用 chroot Jail [将 sFTP 用户限制到其主目录][8]中。
@ -99,15 +97,15 @@ via: http://www.tecmint.com/sftp-upload-download-directory-in-linux/
作者:[Aaron Kili][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/aaronkili/
[1]:http://www.tecmint.com/sftp-command-examples/
[2]:http://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/
[3]:http://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/
[2]:https://linux.cn/article-6901-1.html
[3]:https://linux.cn/article-6901-1.html
[4]:http://www.tecmint.com/wp-content/uploads/2017/02/Run-sFTP-Commands-on-Remote-Linux.png
[5]:http://www.tecmint.com/wp-content/uploads/2017/02/Upload-Directory-using-SFTP.png
[6]:http://www.tecmint.com/wp-content/uploads/2017/02/Download-Directory-using-sFTP.png

View File

@ -1,56 +0,0 @@
5 new guides for working with OpenStack
============================================================
![OpenStack tutorials](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/rh_003588_01_rd3os.combacktoschoolserieshe_rh_051x_0.png?itok=Tm2UcSXw "OpenStack tutorials")
Image by : opensource.com
OpenStack experience continues to be among the most in-demand skills in the tech world, with more and more organizations seeking to build and manage their own open source clouds. But OpenStack is a huge domain of knowledge, containing dozen of individual projects that are being actively developed at a rapid pace. Just keeping your skills up to date can be a challenge.
The good news is that there are lots of resources out there to keep you up to speed. In addition to the [official project documentation][9], a variety training and certification programs, printed guides, and other resources, there are also a ton of tutorials and guides written by members of the OpenStack community and published across a variety of blogs and online publications.
At Opensource.com, every month we gather the best of these community-created resources and bring them together for you into one handy package. Here's what we rounded up last month.
* First up this time is a quick introduction to [Mistral usage in TripleO][1] from Julie Pichon. Mistral is a workflow service, allowing you to set up a multi-step process automation and coordinating actions for you asynchronously. Learn the basics of Mistral, how it works, and how it is used within TripleO in this quick guide.
* Want to dig further into TripleO for managing OpenStack deployments using OpenStack's own set of tools? Then you'll want to check out this [set of cheatsheets][2] for people who are making use of TripleO in their OpenStack setup. It's a work in progress, so feel free to contribute if you've got an idea of what should be included.
* Completing our trifecta of TripleO guides, don't miss this [quick guide][3] to using TripleO to stand up a standalone Ceph deployment. All it takes is a short YAML file and an easy command.
* Next up, if you're an OpenStack contributor, you might be familiar with the [Grafana dashboard][4] which displays various metrics around OpenStack's continuous integration infrastructure. Ever wondered how this service works, or want to create a new addition to this dashboard? Learn [how to create][5] your own local copy of the dashboard for testing purposes so you can play around with it and create your own modifications.
* Ever wonder what's happening under the hood with networking on an OpenStack cloud? OpenStack often makes use of [Open vSwitch][6] for network services for Neutron and Nova; learn the basics of how it is set up in [this walkthrough][7].
* * *
That's it for this time around. As always, be sure to check out our complete collection of [OpenStack tutorials][10], which brings together hundreds of individual guides published across the past three years.
--------------------------------------------------------------------------------
作者简介:
Jason Baker - Jason is passionate about using technology to make the world more open, from software development to bringing sunlight to local governments. Linux desktop enthusiast. Map/geospatial nerd. Raspberry Pi tinkerer. Data analysis and visualization geek. Occasional coder. Cloud nativist. Follow him on Twitter.
--------------------------------------------------------------------------------
via: https://opensource.com/article/17/1/openstack-tutorials
作者:[Jason Baker][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/jason-baker
[1]:http://www.jpichon.net/blog/2016/12/quick-introduction-mistral-tripleo/
[2]:http://www.anstack.com/blog/2016/12/16/printing-tripleo-cheat-sheet.html
[3]:http://giuliofidente.com/2016/12/tripleo-to-deploy-ceph-standlone.html
[4]:http://grafana.openstack.org/
[5]:http://blog.cafarelli.fr/2016/12/local-testing-of-openstack-grafana-dashboard-changes/
[6]:http://openvswitch.org/
[7]:http://superuser.openstack.org/articles/openvswitch-openstack-sdn/
[8]:https://opensource.com/article/17/1/openstack-tutorials?rate=q5H-KT2pm4NLExRhlHc0ru2dyjLkTSA45wim_2KtIec
[9]:http://docs.openstack.org/
[10]:https://opensource.com/resources/openstack-tutorials
[11]:https://opensource.com/user/19894/feed
[12]:https://opensource.com/article/17/1/openstack-tutorials#comments
[13]:https://opensource.com/users/jason-baker

View File

@ -1,3 +1,4 @@
translating by xiaow6
How to perform search operations in Vim
============================================================