zoukankan      html  css  js  c++  java
  • Linux学习笔记(不断更新。。。)

    Linux学习笔记(不断更新。。。)

    获取Root权限

    在终端中输入:
    sudo passwd root
    Enter new UNIX password: (在这输入你的密码)
    Retype new UNIX password: (确定你输入的密码)
    passwd: password updated successfully

    以后,如果在想获得root权限,只需进行如下的操作:
    su root
    Password: (在此输入你上面设置的密码)

    如果要再次禁用 root 帐号,

    那么可以执行 sudo passwd -l root


    vi(shell文本编辑器)保存、退出命令
    :w /* save not exit */

    :w newfilename /* save as use name "newfilename" */

    :q /* exit, only the file not changed */

    :q! /* exit not save file, all change will been give up */

    设置IP
    我这里网卡名为:enp2s0,同时记录下掩码地址,下面会用到这两个参数。

      终端输入vi /etc/network/interfaces命令编辑配置文件,增加如下内容:     
        auto enp2s0
        iface enp2s0 inet static
        address 192.168.1.211
        netmask 255.255.255.0
        gateway 192.168.1.1
        iface enp2s0 inet6 auto

    重启网络

    gec@ubuntu:~$ sudo /etc/init.d/networking restart

    * Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces

    * Reconfiguring network interfaces...

  • 相关阅读:
    C++ primer 简读
    C++函数及类方法(待补充)
    C++参数传递-复制和引用
    c++动态分配内存
    C++内存与指针
    c++循环
    C++容器vector及迭代器对象iterator
    c++字符类型一些知识点
    CNN中卷积运算转化成矩阵乘法的实现——img2col+GEMM大矩阵乘法
    046 LeetCode go
  • 原文地址:https://www.cnblogs.com/Rock-lynn/p/14000536.html
Copyright © 2011-2022 走看看