Ubuntu ip及apt源設置

  • 配置靜態ip及DNS

sodu vim /etc/network/interfacesubuntu

auto ens32vim

iface ens32 inet staticssh

address 10.0.0.111spa

netmask 255.255.255.0rest

gateway 10.0.0.2server

/etc/init.d/networking restartip

vi /etc/resolv.confget

nameserver 10.0.0.2it

nameserver 8.8.8.8table

  • 容許root登陸

vim /etc/ssh/sshd_config

PermitRootLogin yes

/etc/init.d/ssh restat

  • 配置apt源

mv /etc/apt/sources.list /etc/apt/sources.list.bak

vi /etc/apt/sources.list

deb http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse

apt-get update

相關文章
相關標籤/搜索