Ubuntu系统的IP配置

用过ubuntu的人都知道,刚安装好系统root用户是没有密码的,没有密码我们就没法用root用户登录,给root用户设置密码输入命令 sudo passwd,然后系统会让你输入密码,这时输入的密码就是root用户的密码了,设置完成之后就可以切换root用户登录了,如图:

1、给root设置密码,输入下列命令:
sudo passwd
[email protected]:~# vi /etc/network/interfaces
#This file describes the network interfaces available on your system
#and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/
#The loopback network interface
auto lo
iface lo inet loopback
auto ens160
iface ens160 inet static
address 192.168.130.237
netmask 255.255.255.0
gateway 192.168.130.1

2、开启ssh
[email protected]:~# vi /etc/ssh/sshdconfig
PermitRootLogin yes #(这个改成yes)
3、重启sshd服务
[email protected]:~# service sshd restart
4、重启网卡
[email protected]:~# /etc/init.d/networking restart

原文地址:https://blog.51cto.com/chentongsan/2459744

时间: 2024-07-31 19:05:54

Ubuntu系统的IP配置的相关文章

ubuntu无线上网静态ip配置以及配置静态IP 之后无法正常上网的解决方案

一. 配置无线网络的静态IP 编辑/etc/network/interfaces文件如下: auto lo wlan0 iface lo inet loopback iface wlan0 inet static address 192.168.1.120 #(根据具体情况填写) netmask 255.255.255.0 #(根据具体情况填写) gateway 192.168.1.1 #(根据具体情况填写) dns-nameservers 8.8.8.8 8.8.4.4 #(根据具体情况填写)

解决ubuntu系统mysql open_files_limit配置不生效问题

最近接手维护一台mysql服务器,系统是ubuntu 16.04,mysql版本5.7,安装方式是apt检查mysql配置参数时发现open_files_limit是1024,有点小,需要调大一点 首先show global status like 'open_files_limit' 查看目前打开了多少文件,一看是900多,很明显1024太小,需要调大,于是修改/etc/my.cnf 将open_files_limit 设置为65535,然后/etc/init.d/mysql restart重

debian/ubuntu系统,IP DNS MTU 配置

1.配置添加IP:vi /etc/network/interfaces   修改如下内容 # The primary network interface auto eth0 iface eth0 inet static mtu 1410 address 192.168.1.100 address2                                    #添加多个IP地址 netmask 255.255.255.0 gateway 192.168.1.1 保存,重启网卡 servi

ubuntu系统添加ip

默认情况下,我们买服务器都会给我们5个以上的ip,一般主机都对应一个主ip,如果想把4个剩余ip加到主机上,需要手动配置,具体操作是 打开vim /etc/network/interfaces 默认是 auto loiface lo inet loopbackauto eth0iface eth0 inet static address 8.8.8.8(根据自己的ip) netmask 255.255.255.248 gateway 8.8.8.8(根据自己的getway) 要再添加就加上 au

基于虚拟机的CentOS7系统的IP配置

dhclient #自动获取动态IP ip add #获取ip地址 将动态IP修改为静态IP(步骤): vi /etc/sysconfig/network-scripts/ifcfg-ens33 按小写字母"i",进入编辑模式 然后增加或改变以下内容: IPADDR和GATEWAY的获取通"编辑"菜单下的"虚拟网络编辑器"获得 DNS1是常用的DNS 然后按"esc",":wq"保存 "ctrl+

VMware 虚拟机 Ubuntu 系统执行 ifconfig 命令 eth0没有IP地址(intet addr、Bcast、Mask) 解决:UP BROADCAST MULTICAST 问题

VMware 虚拟机 ifconfig没有net_addr地址.Bcast.Mask的解决方法 使用时间长的虚拟机,会莫名其妙的连接不上网 在终端中,使用ifconfig命令查看Ubuntu系统的IP地址,发现没有分配IP地址. eth0:网络接口 link encap : 网络类型 HWaddr : 网卡物理地址 Inet addr :(internet address) IP地址 Bcast:广播地址 Mask:子网掩码 UP:正在使用的网络接口 RX packets,TX packets 

2019.7.01—双硬盘安装Win10,Ubuntu18.04双系统(包括Ubuntu系统美化;安装QQ,微信;配置酸酸.乳)

这篇文章侧重于介绍双系统中Ubuntu系统的安装与配置,windows系统的安装较略.有些方法可能对你的机器不管用,那就要自行百度啦(^_^). 先放一张Ubuntu系统的成品照: 本人电脑配置情况:华硕w50j(老机器了= =),12g内存,500G固态硬盘+1T机械硬盘 总体目标:不使用任何第三方装机软件完成Win10及Ubuntu18.04纯净系统的安装,并完成Ubuntu系统的相关配置. 具体目标:固态中分350g给windows用于安装系统,其余用于安装Ubuntu系统:机械盘中分60

windows系统如何通过Xshell 客户端连接 linux系统(主要介绍ubuntu系统)

一. 1.查看ubuntu系统的ip地址:ifconfig 在window系统运行窗口下:ping ubuntu系统的IP地址:例如:ping 192.168.163.129 出现下述命令就是ping通了,按CTRL+C结束 2.再来查看windows系统的ip地址:ipconfig win+R  输入cmd(或者点击运行) 在Linux系统运行窗口下:ping windows系统的IP地址:例如:ping 192.168.20.56 出现下述命令就是ping通了,按CTRL+C结束 现在,双方

Ubuntu系统下配置IP地址方法介绍

配置IP方式有两种: 1.通过命令直接配置 sudo ifconfig eth0 IP地址 netmask 子网掩码------配置IP地 sudo route add default gw 网关------------添加默认路由 vi /etc/resolv.conf 配置文件 添加nameserver DNS----配置DNS sudo /etc/init.d/networking restart-----------重启网卡配置但是方式只能临时修改,当服务器重启后,配置信息丢失:第二种方