Debian9:配置网络和软件源

  • IP配置
  • DNS配置
  • debian系统中重启网络
  • debian源设置
  • 其他

IP配置

# vim /etc/network/interfaces

#开机自动激活eth0接口 
auto eth0 
#配置eth0接口为静态设置IP地址 
iface eth0 inet static 
address 192.168.60.110
netmask 255.255.255.0  
gateway 192.168.60.2

DNS配置

# vim /etc/resolv.conf
nameserver 114.114.114.114

debian系统中重启网络

systemctl restart networking

debian源设置

  • 设置软件安装源
cp /etc/apt/sources.list /etc/apt/sources.list.ori
vi /etc/apt/sources.list    
#替换为以下内容    
deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb http://mirrors.aliyun.com/debian-security stretch/updates main
deb-src http://mirrors.aliyun.com/debian-security stretch/updates main
deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
  • 更新软件包列表
apt-get update    
  • 安装ssh服务
root@debian:~# apt-get install ssh -y
root@debian:~# grep Root /etc/ssh/sshd_config #修改sshd配置
#PermitRootLogin prohibit-password
PermitRootLogin yes
root@debian:~# systemctl restart sshd

其他

  • 升级系统所有软件
# apt-get upgrade
  • 升级系统版本
# apt-get dist-upgrade
  • 也可以使用图形化管理工具 aptitude

你可能感兴趣的:(Debian/Ubuntu)