配置网络设置

首先在终端输入:ifconfig

【Ubuntu】安装Ubuntu虚拟机时的一些操作(安装一些插件)_vim
修改IPvi /etc/network/interfaces
【Ubuntu】安装Ubuntu虚拟机时的一些操作(安装一些插件)_服务端_02
这里面的ens33改成你自己上述圈出来的名字
addressIP地址
netmask子网掩码
gateway网关

使用cat /etc/resolv.conf命令配置DNS
【Ubuntu】安装Ubuntu虚拟机时的一些操作(安装一些插件)_服务端_03

重启网络服务使其生效:/etc/init.d/networking restart

使DNS永久生效

在 /etc/resolvconf/resolv.conf.d/ 目录中 base文件里添加一行配置(如果没有 base文件则需新建一个),配置如下

nameserver 8.8.8.8

然后重启服务:/etc/init.d/resolvconf restart

解决方向键出现字母(安装完整的vim)

卸载vim-tiny

sudo apt-get remove vim-common

安装vim full

sudo apt-get install vim
ssh免密登录

更新源

sudo apt-get update   

安装openssh服务端

sudo apt-get install openssh-server   

安装openssh客户端

sudo apt-get install openssh-client   

注意:如果想要使用 slave1 系统登录 slave2 系统,那么 slave1 装客户端, slave2 装服务端,如果想要互相都能登录,就服务端和客户端都装

生成密钥
ssh-keygen -t rsa
四次回车,直到见到下图
【Ubuntu】安装Ubuntu虚拟机时的一些操作(安装一些插件)_服务端_04
分发密钥
ssh-copy-id xxx.xxx.xxx.xxx
xxx是你要分发给的虚拟机的IP地址
在输入密码时可以会遇到一个错误
【Ubuntu】安装Ubuntu虚拟机时的一些操作(安装一些插件)_centos_05
打开/etc/ssh/sshd_config
【Ubuntu】安装Ubuntu虚拟机时的一些操作(安装一些插件)_vmware_06
将prohibit-password改为yes
重启ssh服务:/etc/init.d/ssh restart