zoukankan      html  css  js  c++  java
  • Ubuntu16.04随笔

    1.配置网卡,编辑/etc/network/interface(sudo vim /etc/network/interface)文件,添加如下内容

    auto ens33
    iface ens33 inet static
    address 192.168.11.93
    netmask 255.255.255.0
    gateway 192.168.11.1
    dns-nameservers 192.168.11.1

    添加完成后wq保存退出,重启网卡

    sudo /etc/inin.d/networking restart

    或者直接追加内容到文件

    sudo echo -e "address 192.168.11.93
    netmask 255.255.255.0
    gateway 192.168.11.1
    dns-nameservers 192.168.11.1" > /etc/network/interface

    2.配置阿里云镜像源(Ubuntu16.04,请跟根据自己的版本号选择相应的源),编辑/etc/apt/soures.list,添加以下内容或者用追加的方式也可以

    deb http://mirrors.aliyun.com/ubuntu/ xenial main
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
    deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
    deb http://mirrors.aliyun.com/ubuntu/ xenial universe
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
    deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
    deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
    deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe

    保存退出,更新软件源,需要几分钟的时间

    apt-get update

    3.Xshell连接Ubuntu连接失败,端口22不通,

    关闭防火墙

    sudo ufw disable #关闭防火墙
    sudo ufw allow 22 #允许外部访问22端口
    sudo ufw delete allow 22#禁止外部访问22端口

    安装Openssh-server软件

    sudo apt-get install openssh-server -y

    4.修改root密码

    oracle@oracle:~$ sudo passwd
    [sudo] password for oracle: 
    Enter new UNIX password: 
    Retype new UNIX password: 
    passwd: password updated successfully
    oracle@oracle:~$ 
  • 相关阅读:
    jQuery,from标签,歪路子小技巧
    UniApp随笔
    JS的一些操作
    文本环绕
    Dictionary 存储函数,方法
    GIT项目管理
    Vue2 学习记录
    VSCode + Vue 学习笔记
    Mysql,Insert,Select时自增长问题
    ASP.NET SignalR Troubeshooting
  • 原文地址:https://www.cnblogs.com/Roobbin/p/9597695.html
Copyright © 2011-2022 走看看