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 防火墙在系统启动时自动禁用
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?