zoukankan      html  css  js  c++  java
  • Ubuntu14 关机重启版本网络防火墙时间修改

    关机、重启:

    立即关机:halt、poweroff、shutdown -h now

    延迟关机:shutdown -h 10  十分钟后关机

    立即重启:reboot、shutdown -r now

    延迟重启:shutdown -r 10 十分钟后重启、shutdown -r 20:35 定点重启

    取消:shutdown -c

    Ubuntu14 版本查询

    xzx@git:~$ lsb_release -a        LSB是Linux Standard Base的缩写,lsb_release命令用来显示LSB和特定版本的相关信息
    No LSB modules are available.
    Distributor ID:    Ubuntu        类别是ubuntu
    Description:    Ubuntu 14.04.6 LTS  16年3月发布的稳定版本,LTS是Long Term Support:长时间支持版本,支持周期长达三至五年
    Release:    14.04            发行版本号
    Codename:    trusty           ubuntu的代号名称
    xzx@git:~$ uname -a  查看系统相关信息
    Linux 内核名称
    git  主机名
    4.4.0-142-generic 内核发行号
    #168~14.04.1-Ubuntu SMP Sat Jan 19 11:26:28 UTC 2019 内核版本号
    x86_64 机器硬件名称,即操作系统位数
    x86_64 处理器类型
    x86_64 硬件平台
    GNU/Linux 操作系统
    xzx@git:~$ cat /proc/version
    Linux version 4.4.0-142-generic (buildd@lcy01-amd64-006)   linux内核版本号
    (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.4) )     gcc编译器版本号、Ubuntu版本号
    #168~14.04.1-Ubuntu SMP Sat Jan 19 11:26:28 UTC 2019   内核版本号

    系统时间查看修改

    xzx@test:/test$ date -R
    Mon, 16 Dec 2019 23:52:27 -0900
    xzx@test:/test$ tzselect
     5) Asia
     9) China    
    1) Beijing Time
    1) Yes
    xzx@test:/test$ sudo cp /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime
    xzx@test:/test$ date -R
    Tue, 17 Dec 2019 16:53:37 +0800

    Ubuntu14 重启

    执行service networking restart 报错!(需要root权限才可以正常运行)

    xzx@git:~
    $ service networking restart stop: Rejected send message, 1 matched rules; type="method_call", sender=":1.14" (uid=1000 pid=1576 comm="stop networking ") interface="com.ubuntu.Upstart0_6.Job" member="Stop" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init ")
    切换到root用户下,执行service networking restart,依然报错!
    Ubuntu14版已经不支持使用service对网络进行停止重启。
    xzx@git:~$ su root Password: root@git:/home/xzx# service networking restart stop: Job failed while
    stopping start: Job is already running: networking
    正确的使用方法:ifdown eth0 && ifup eth0
    root@git:
    /home/xzx# ifdown eth0 && ifup eth0 Internet Systems Consortium DHCP Client 4.2.4 Copyright 2004-2012 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on LPF/eth0/08:00:27:ef:72:ec Sending on LPF/eth0/08:00:27:ef:72:ec Sending on Socket/fallback DHCPRELEASE on eth0 to 10.20.6.254 port 67 (xid=0x1e6a46a7) Internet Systems Consortium DHCP Client 4.2.4 Copyright 2004-2012 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on LPF/eth0/08:00:27:ef:72:ec Sending on LPF/eth0/08:00:27:ef:72:ec Sending on Socket/fallback DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0x828e5509) DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5 (xid=0x828e5509) DHCPREQUEST of 10.20.6.185 on eth0 to 255.255.255.255 port 67 (xid=0x9558e82) DHCPOFFER of 10.20.6.185 from 10.20.6.254 DHCPACK of 10.20.6.185 from 10.20.6.254 bound to 10.20.6.185 -- renewal in 32751 seconds.

    需要root权限。

    查看防火墙当前状态
    ufw status
    
    开启防火墙
    ufw enable
    
    关闭防火墙
    ufw disable
    
    拒绝外部访问53端口
    ufw deny 53
    
    允许某个IP地址访问本机所有端口
    ufw allow from 192.168.0.1

     修改网卡IP

    vim /etc/network/interfaces
    auto eth0
    iface eth0 inet static
    address 10.20.1.125
    netmask 255.255.255.0
    gateway 10.20.1.254
    dns-nameservers 202.96.134.133




  • 相关阅读:
    ASP.NET中读取Excel内容,并显示在界面上
    SQL SERVER 的 CLR表值函数
    nowrap要与回车换行符结合才有意义
    何时使用 FILESTREAM?
    case 用在 UPDATE
    查看分区在哪个文件组
    C#里面的随机对象Random
    CLR程序里引用System.Web.dll
    不用写成 if @i=1 OR @i=2 OR ... 这么蠢
    SQL SERVER定期转移海量数据方案
  • 原文地址:https://www.cnblogs.com/dthum/p/11925885.html
Copyright © 2011-2022 走看看