ubuntu18.04
Posted liujunjun
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 sessions > properties > Connection > SSH2 取消勾选 PublicKey.
关闭防火墙并开机不启动
liujunjun@liujunjun-virtual-machine:~$ sudo ufw disable 防火墙在系统启动时自动禁用
以上是关于ubuntu18.04的主要内容,如果未能解决你的问题,请参考以下文章
Wordpress 网站在 Ubuntu 18.04 LTS 上全新安装 VirtualMin 后显示 php 代码