Ubuntu20.10 系统简单优化与配置阿里源

摘要:
Ubuntu 20.10系统简单优化和配置Alisource 1,网卡配置#16.04网卡配置mpd@ubuntu:~$cat/etc/network/interfaces#此文件描述了系统上可用的网络接口#以及如何激活它们。有关更多信息,请参阅接口(5)。so

Ubuntu20.10 系统简单优化与配置阿里源

一 , 网卡配置

# 16.04版本的网卡配置
mpd@ubuntu:~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto ens33
iface ens33 inet static
	address 192.168.15.200
	netmask 255.255.255.0
	network 192.168.15.0
	broadcast 192.168.15.255
	gateway 192.168.15.2
	# dns-* options are implemented by the resolvconf package, if installed
	dns-nameservers 223.5.5.5 114.114.114.114
	
# 20.10版本的网卡配置
mpd@ubuntu20:~$ cat /etc/netplan/00-installer-config.yaml 
# This is the network config written by 'subiquity'
network:
  ethernets:
    ens33:
      addresses:
      - 192.168.15.200/24
      gateway4: 192.168.15.2
      nameservers:
        addresses:
        - 114.114.114.114
  version: 2

重启网卡

/etc/init.d/networking restart
# ifdown enp0s3(关闭网卡ens33) && ifup   enp0s3(启动网卡ens33)
sudo service network-manager restart  
# 如果重启网卡不成功 可以重启试试reboot

二,开启远程链接22端口和设置开启支持root用户登录

1)开启22端口

由于Ubuntu没有默认开启22端口需要手动打开 才能ssh远程连接

sudo apt install net-tools

安装后,想通过MobaXterm远程工具连接的时候发现连接失败。

此时,查看Ubuntu关于22的端口,执行命令如下

netstat -ntlp|grep 22
    参数解释:
    -n  不以进程的服务名称,以端口号(port number)显示
	-t  列出tcp网络封包的信息
	-l  列出目前正在网络监听(listen)服务
	-p  列出该网络服务的进程

此时若发现无任何关于22端口的进程内容,执行以下命令

sudo apt-get install openssh-server
sudo apt-get install ufw
sudo ufw enable
sudo ufw allow 22

然后再用xshell连接成功。

2)设置允许root用户登录
mpd@ubuntu20:~$ sudo vim /etc/ssh/sshd_config
[sudo] password for mpd:
# ssh登录的时候用户没有输入密码时多少秒之后自动退出
LoginGraceTime 120
# 允许root用户用密码登录
# PermitRootLogin prohibit-password 改成PermitRootLogin yes
# 设置ssh在接收登录请求之前是否检查用户家目录和rhosts文件的权限和所有权
StrictModes yes

# 设置root密码
mpd@ubuntu:~$ sudo passwd root
Enter new UNIX password: 1
Retype new UNIX password: 1
passwd: password updated successfully
mpd@ubuntu:~$ su - root
Password: 1
root@ubuntu:~#

三,配置阿里云源

deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

四,apt包管理工具

sudo apt-cache search package           		   #搜索包
sudo apt-cache show package             		   #获取包的相关信息,如说明、大小、版本等
sudo apt-get install package       		           #安装包
sudo apt-get install package --reinstall		   #重新安装包
sudo apt-get -f install     			           #修复安装”-f = –fix-missing”
sudo apt-get remove package     			   #删除包
sudo apt-get remove package --purge     	           #删除包,包括删除配置文件等
sudo apt-get update     				   #更新源
sudo apt-get upgrade     				   #更新已安装的包
sudo apt-get dist-upgrade     			           #升级系统
sudo` `apt-get dselect-upgrade     		           #使用 dselect 升级
apt-cache depends package     			           #了解使用依赖
apt-cache rdepends package     			           #是查看该包被哪些包依赖
sudo apt-get build-dep package     			   #安装相关的编译环境
apt-get source package     			           #下载该包的源代码
sudo apt-get clean && sudo apt-get autoclean               #清理无用的包
sudo apt-get check     				           #检查是否有损坏的依赖
sudo apt-get clean     				           #清理所有软件缓存(即缓存在/var/cache/apt/archives目录里的deb包)
dpkg -L 包名						   #查看安装包的相关所有配置文件

五,查看发行版本

mpd@ubuntu20:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.10
Release:	20.10
Codename:	groovy

免责声明:文章转载自《Ubuntu20.10 系统简单优化与配置阿里源》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇搭配锚点使用的小技巧,自定义控制定位元素距离可视区域顶部的距离。双系统只能启动linux,无法启动Windows的解决方法下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

角色及权限

引言(Introduction) 1.1. 关键词定义(Definitions) 有关定义说明如下: 安全管理:计算机技术安全管理的范围很广,可以包括网络安全性、数据安全性、操作系统安全性以及应用程序安全性等。很多方面的安全性管理大都已经有成熟的产品了,我们只需根据自己需要有选择性的使用就可达到自己的目的了。本文中有关关涉及"安全管理"一词均只针对本公司推...

Centos下堡垒机Jumpserver V3.0环境部署完整记录(2)-配置篇

前面已经介绍了Jumpserver V3.0的安装,基于这篇安装文档,下面说下Jumpserver安装后的的功能使用: 一、jumpserver的启动 Jumpserver的启动和重启 [root@test-vm001 install]# /opt/jumpserver/service.sh start/restart 二、按照Jumpserver部署过...

Ubuntu系统配置系列1——更新软件源

Ubuntu软件源是国外的,因此下载软件时,速度太慢,所以更换为国内软件源。 本操作以Ubuntu16.04换中科大源为例,若系统为其他版本或者想换为中科大、阿里的源,只需把第三步软件源地址更改即可,具体操作见附件内容。 #1.备份系统自带的国外软件源 sudo cp /etc/apt/sources.list /etc/apt/sources.list....

centos 系统下安装FastDFS+nginx+fastdfs-nginx-module安装配置

前言: 以前的项目上传的文件都是保存到本地或者是局域网内的共享文件夹下,由于数据量,服务器的负载均衡(分机的某些图片无法访问的问题处理)等因素的情况下,就想到用fastdfs来文件管理,花了几天时间硬着头皮去学习怎样安装配置,由于linux基础不好,安装配置起来感觉有点费力,不得不随时去查找一些资料,好在经过这几天的努力安装配置fastdfs最终还是搞定了...

CentOS7安装OpenStack(Rocky版)-01.控制节点的系统环境准备

分享一下Rocky版本的OpenStack安装管理经验: OpenStack每半年左右更新一版,目前是版本是201808月发布的版本-R版(Rocky),目前版本安装方法优化较好,不过依然是比较复杂 官方文档地址:https://docs.openstack.org/install-guide/openstack-services.html 本文主要分享控...

Linux NFS服务器的安装与配置(转载)

一、NFS服务简介   NFS 是Network File System的缩写,即网络文件系统。一种使用于分散式文件系统的协定,由Sun公司开发,于1984年向外公布。功能是通过网络让不同的机器、不同的操作系统能够彼此分享个别的数据,让应用程序在客户端通过网络访问位于服务器磁盘中的数据,是在类Unix系统间实现磁盘文件共享的一种方法。   NFS 的基本原...