Ubuntu14.4 系统进入单用户模式及配置网卡

1.进入单用户模式:

重启Ubuntu按e进入grub界面,选择 (recovery mode)”这一行按“e ”进入编辑页面.

Ubuntu14.4 系统进入单用户模式及配置网卡

 将“ro recovery nomodeset”改为“rw single init=/bin/bash”,然后按ctrl+x 启动

进入root shell  输入"passwd root "修改root用户密码.  完成后使用"ctrl+alt+del" 重启.

2.配置网卡/dns

Ubuntu系统的网络配置文件: /etc/network/interfaces 

编辑(vi /etc/network/interfaces )添加网卡信息:

将dhcp 一行屏蔽

# The primary network interface

auto eth0

#iface eth0 inet dhcp

添加和静态ip有关的参数

# This file describes the network interfaces available on your systemauto eth0

auto eth0

iface eth0 inet static

Ubuntu14.4 系统进入单用户模式及配置网卡

重启网卡使设定生效:/etc/init.d/networking restart

执行下面两个命令也可以:

$  ifdown eth0

$  ifup eth0