Ubuntu16.04随笔

1.配置网卡,编辑/etc/network/interface(sudo vim /etc/network/interface)文件,添加如下内容

auto ens33
iface ens33 inet static
address 192.168.11.93
netmask 255.255.255.0
gateway 192.168.11.1
dns-nameservers 192.168.11.1

添加完成后wq保存退出,重启网卡

sudo /etc/inin.d/networking restart

或者直接追加内容到文件

sudo echo -e "address 192.168.11.93\nnetmask 255.255.255.0\ngateway 192.168.11.1\ndns-nameservers 192.168.11.1" > /etc/network/interface

2.配置阿里云镜像源(Ubuntu16.04,请跟根据自己的版本号选择相应的源),编辑/etc/apt/soures.list,添加以下内容或者用追加的方式也可以

复制代码
deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
复制代码

保存退出,更新软件源,需要几分钟的时间

apt-get update

3.Xshell连接Ubuntu连接失败,端口22不通,

关闭防火墙

sudo ufw disable #关闭防火墙
sudo ufw allow 22 #允许外部访问22端口
sudo ufw delete allow 22#禁止外部访问22端口

安装Openssh-server软件

sudo apt-get install openssh-server -y

4.修改root密码

oracle@oracle:~$ sudo passwd
[sudo] password for oracle: 
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
oracle@oracle:~$ 

 

posted @   小年青。  阅读(201)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示