当前位置: 移动技术网 > 网络运营>服务器>Linux > 详解Ubuntu14.04桥接网络设置与SSH登陆

详解Ubuntu14.04桥接网络设置与SSH登陆

2019年06月02日  | 移动技术网网络运营  | 我要评论

操作系统:unbuntu14.04

虚拟机:vmware10

一、网络设置

1、设置vmware bridge protocol

本地链接->属性->vmware bridge protocol打钩

ubuntu14.04桥接网络设置与ssh登陆0

  2、然后主机设定静态ip(如果已设置好了的不用管)

ubuntu14.04桥接网络设置与ssh登陆1

3、vmware 设置

编辑-》虚拟网络编辑器

ubuntu14.04桥接网络设置与ssh登陆2

4、ununtu设置

确认关闭,接下来设定ubuntu的ip和dns ,终端:(alt+ctrl+t打开 )

sudo vi /etc/network/interfaces

然后输入以下内容:

s(5) file used by ifup(8) and ifdown(8)
auto lo 
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.75.4.25
netmask 255.255.255.0
gateway 10.75.4.254 
dns-nameservers 10.75.210.1 107.5.210.2

说明:

iface eth0 inet static 表示使用静态ip,

address10.75.4.25,设定ip地址,要和windows上的电脑的ip在一个网络段

netmask 255.255.255.0 设定掩码,要和windows上的电脑的ip在一个网络段

gateway 10.75.4.254  设定gateway 要和windows上的电脑的ip在一个网络段

dns-nameservers 10.75.210.1 107.5.210.2设定网关,,设定dns 多个空格隔开

还有一个设定dns的 方法:

sudo vi /etc/resolvconf/resolv.conf.d/base

添加:

nameserver 223.5.5.5

nameserver 223.6.6.6

多个依次往下排

最后,重启下网络就好了

 sudo ifconfig etho down

然后再打开 

 sudo ifconfig etho up

然后打开看看ip地址设置得对不对

ubuntu14.04桥接网络设置与ssh登陆3

5、验证是否连接

主机ping虚拟主机:成功返回数据

ubuntu14.04桥接网络设置与ssh登陆4

虚拟主机ping主机:

ubuntu14.04桥接网络设置与ssh登陆5

其实最好的方法是直接打开浏览器就ok了:(如果 还是不能,请重新启动一下吧)

ubuntu14.04桥接网络设置与ssh登陆6

二、ssh登陆

ssh分客户端openssh-client和openssh-server

如果你只是想登陆别的机器的ssh只需要安装openssh-client(ubuntu有默认安装,如果没有则sudo
apt-get install openssh-client),如果要使本机开放ssh服务就需要安装openssh-server

sudo apt-get install openssh-server

然后确认sshserver是否启动了:

ps -e |grep ssh

如果看到sshd那说明ssh-server已经启动了。

1、服务端安装并通过securecrt来连接到linux

ubuntu14.04桥接网络设置与ssh登陆7

启动信息

ubuntu14.04桥接网络设置与ssh登陆8

2、客户端连接

ubuntu14.04桥接网络设置与ssh登陆9

然后输入ip(对应linux的ip,可以使用ipconfig来看)

ubuntu14.04桥接网络设置与ssh登陆10

ubuntu14.04桥接网络设置与ssh登陆11

ubuntu14.04桥接网络设置与ssh登陆12

ubuntu14.04桥接网络设置与ssh登陆13

最后就可以连上了

ubuntu14.04桥接网络设置与ssh登陆14

3.sftp登陆

使用filezilla ,安装过程很简单。这里不再说 了.filezilla和securecrt的区别就是一个带gui界面,一个没有。

ubuntu14.04桥接网络设置与ssh登陆15

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持移动技术网。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网