zoukankan      html  css  js  c++  java
  • debian10入门(切换root用户,更改网卡配置,及更新apt源配置)

    1、由于debian10系统最小化安装时,有很多命令是没有的,包括sudo命令,这时需要使用su命令切换到到root账户。

    2、debian10更改网卡及DNS配置

    网卡配置更改

    #网卡配置
    vim /etc/network/interfaces
    #网卡配置文件如下:
    allow-hotplug ens33
    iface ens33 inet static
    address 10.0.0.200
    netmask 255.255.255.0
    gateway 10.0.0.2
    
    #DNS配置
    vim /etc/resolv.conf
    #DNS配置文件如下:
    domain localdomain
    search localdomain
    nameserver 180.76.76.76
    nameserver 114.114.114.114

    #重启网卡
    systemctl restart networking.service

    3、debian10换源

    #进入安装源文件
    vim /etc/apt/sources.list
    #将原有的官方源注释掉,加入下面的源
    deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
    deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
    deb http://mirrors.aliyun.com/debian-security buster/updates main
    deb-src http://mirrors.aliyun.com/debian-security buster/updates main
    deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
    deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
    deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
    deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
    #更新
    apt update

     4、debian10配置vim开启右键粘贴

    #修改vim的配置文件
    vim /usr/share/vim/vim81/defaults.vim
    #编辑第78行
    mouse=a 改为mouse-=a

    5、设置ll别名

    #编辑/root/.bashrc文件
    vim /root/.bashrc
    #将以下几行取消注释
    export LS_OPTIONS='--color=auto'
    eval "`dircolors`"
    alias ls='ls $LS_OPTIONS'
    alias ll='ls $LS_OPTIONS -l'
    alias l='ls $LS_OPTIONS -lA'
    #使别名生效
    source /root/.bashrc
  • 相关阅读:
    POJ 1386 Play on Words(单词建图+欧拉通(回)路路判断)
    HTTP协议详解??
    Python 中三大框架各自的应用场景??
    django 开发中数据库做过什么优化??
    谈一下你对 uWSGI 和 nginx 的理解??
    django 中间件的使用??
    Flask 中请求钩子的理解和应用?
    七层模型? IP ,TCP/UDP ,HTTP ,RTSP ,FTP 分别在哪层?
    说说 HTTP 和 HTTPS 区别??
    hasattr() getattr() setattr() 函数使用详解??
  • 原文地址:https://www.cnblogs.com/nj-duzi/p/14833633.html
Copyright © 2011-2022 走看看