ubuntu18.04修改静态IP

ubuntu18开始使用netplan

$ sudo netplan generate 
$ sudo vim /etc/netplan/01-netcfg.yaml 

修改文件

enp0s8:             
dhcp4: no
dhcp6: no
addresses: [192.168.56.110/24, ]
nameservers:
addresses: [8.8.8.8, 8.8.4.4]

应用IP

$ sudo netplan apply

ubuntu初始化操作

  • 启动root用户
sudo passwd  root
  • root用户ssh登录
vi /etc/ssh/sshd_config
PermitRootLogin yes (默认为#PermitRootLogin prohibit-password)
:wq

service ssh restart

18.04安装jenkins失败

添加仓库

/etc/apt/sources.list
deb [http://us.archive.ubuntu.com/ubuntu/](http://us.archive.ubuntu.com/ubuntu/) xenial main restricted universe
deb-src [http://us.archive.ubuntu.com/ubuntu/](http://us.archive.ubuntu.com/ubuntu/) xenial main restricted universe
deb [http://us.archive.ubuntu.com/ubuntu/](http://us.archive.ubuntu.com/ubuntu/) xenial-security main restricted universe
deb [http://us.archive.ubuntu.com/ubuntu/](http://us.archive.ubuntu.com/ubuntu/) xenial-updates main restricted univers
deb-src [http://us.archive.ubuntu.com/ubuntu/](http://us.archive.ubuntu.com/ubuntu/) xenial-security main restricted universe
deb-src [http://us.archive.ubuntu.com/ubuntu/](http://us.archive.ubuntu.com/ubuntu/) xenial-updates main restricted universe

你可能感兴趣的:(ubuntu18.04修改静态IP)