IP configuration Ubuntu system

Used ubuntu people know, just installed the system root user is no password, no password we would not be able to log in as root user password to enter the command sudo passwd root user, then the system will let you enter a password, then enter the password is the root user's password, and after the setup is complete you can switch the root user logged in as:

1、给root设置密码,输入下列命令:
sudo passwd
root@ubuntu:~# 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, open SSH
root @ ubuntu: ~ # vi / etc / SSH / sshdconfig
PermitRootLogin yes # (this change yes)
3, restart sshd service
root @ ubuntu: ~ # Service sshd restart
4, restart the network card
root @ ubuntu: ~ # /etc/init.d/networking restart

Guess you like

Origin blog.51cto.com/chentongsan/2459744