zoukankan      html  css  js  c++  java
  • ubuntu18.04

    网卡配置

    liujunjun@liujunjun-virtual-machine:~$ sudo cat /etc/network/interfaces
    [sudo] liujunjun 的密码: 
    # interfaces(5) file used by ifup(8) and ifdown(8)
    auto lo
    iface lo inet loopback
    
    auto ens33
    iface ens33 inet static
    address 192.168.1.235
    netmask 255.255.255.0
    gateway 192.168.1.1
    
    liujunjun@liujunjun-virtual-machine:~$ 

    配置DNS

    liujunjun@liujunjun-virtual-machine:~$ cat /etc/systemd/resolved.conf 
    #  This file is part of systemd.
    #
    #  systemd is free software; you can redistribute it and/or modify it
    #  under the terms of the GNU Lesser General Public License as published by
    #  the Free Software Foundation; either version 2.1 of the License, or
    #  (at your option) any later version.
    #
    # Entries in this file show the compile time defaults.
    # You can change settings by editing this file.
    # Defaults can be restored by simply deleting this file.
    #
    # See resolved.conf(5) for details
    
    [Resolve]
    DNS=114.114.114.114
    DNS=8.8.8.8
    #DNS=
    #FallbackDNS=
    #Domains=
    #LLMNR=no
    #MulticastDNS=no
    #DNSSEC=no
    #Cache=yes
    #DNSStubListener=yes

    网卡起动

    liujunjun@liujunjun-virtual-machine:~$ /etc/init.d/network
    networking       network-manager  
    liujunjun@liujunjun-virtual-machine:~$ /etc/init.d/networking force-reload 
    Reloading networking configuration (via systemctl): networking.service==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
    重新启动“networking.service”需要认证。
    Authenticating as: liujunjun,,, (liujunjun)
    Password: 
    ==== AUTHENTICATION COMPLETE ===
    .
    liujunjun@liujunjun-virtual-machine:~$ /etc/init.d/networking restart
    Restarting networking (via systemctl): networking.service==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
    重新启动“networking.service”需要认证。 
    Authenticating as: liujunjun,,, (liujunjun)
    Password: 
    ==== AUTHENTICATION COMPLETE ===
    .
    liujunjun@liujunjun-virtual-machine:~$ 

    如果IP地址没生效

    解决方法: 
    ip addr flush dev ens33
     ifdown ens33
     ifup ens33

    安装SSHD服务

    sudo apt-get install openssh-server
    sudo apt-get install openssh-client

    修改/etc/ssh/sshd_config

    liujunjun@liujunjun-virtual-machine:~$ sudo cat /etc/ssh/sshd_config |grep PasswordAuthentication
    PasswordAuthentication yes
    # PasswordAuthentication.  Depending on your PAM configuration,
    # PAM authentication, then enable this but set PasswordAuthentication

    liujunjun@liujunjun-virtual-machine:~$ sudo /etc/init.d/ssh restart
    Restarting ssh (via systemctl): ssh.service.

    SecureCRT 连接Win10内置ubuntu问题及解决办法

    在SecureCRT sessions > properties > Connection > SSH2  取消勾选 PublicKey.

     关闭防火墙并开机不启动

    liujunjun@liujunjun-virtual-machine:~$ sudo ufw disable 
    防火墙在系统启动时自动禁用
  • 相关阅读:
    微信小程序路由跳转 wx.navigateTo() 失败
    微信小程序文件下载 wx.downloadFile()、 wx.saveFile() 和 wx.openDocument()
    Vue——项目中接口返回值为函数回调,回调函数定义方法(Vue的方法给原生调用)
    h5页面判断移动端系统为Android或IOS
    解决小程序报错 Page "pages/index/main" has not been registered yet.
    mpvue路由传参报错Cannot read property 'query' of undefined
    解决前端项目启动时报错:Use // eslint-disable-next-line to ignore the next line.
    解决npm报错:Module build failed: TypeError: this.getResolve is not a function
    APIO2016赛艇
    容斥小结
  • 原文地址:https://www.cnblogs.com/liujunjun/p/12244174.html
Copyright © 2011-2022 走看看