Ubuntu use overview

check ip address

c 复制代码
ip a
ls /etc/netplan/
sudo nano /etc/netplan/01-netcfg.yaml

Configure the Static IP

c 复制代码
network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s3:
      dhcp4: no
      addresses:
        - 192.168.1.100/24
      gateway4: 192.168.1.1
      nameservers:
        addresses:
          - 8.8.8.8
          - 8.8.4.4

Apply the Configuration

c 复制代码
sudo netplan apply

check

ip a

Ubuntu config apt mirror on China

c 复制代码
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
vim /etc/apt/sources.list

replace to mirrors.tuna.tsinghua.edu.cn

tls install

c 复制代码
sudo apt update
sudo apt install openssl
sudo apt install nginx
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx
openssl genpkey -algorithm RSA -out server.key -pkeyopt rsa_keygen_bits:2048
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
vim /etc/nginx/sites-available/default
server {
    listen 443 ssl;
    server_name your_domain.com;

    ssl_certificate /path/to/server.crt;
    ssl_certificate_key /path/to/server.key;

    # Other configurations...
}
sudo nginx -t
sudo systemctl reload nginx
相关推荐
掘根28 分钟前
【Docker】容器操作和实战
运维·docker·容器
肩上风骋30 分钟前
ubuntu系统使用ifconfig查询网络IP的时候,只能查到本地回环地址,无其他网络接口IP
网络·ubuntu·只能查到本地回环地址
星际工程师2 小时前
Windows10安装配置wsl+Ubuntu20.04环境
ubuntu
奔跑吧 android3 小时前
【Docker】【2.docker 安装 ubuntu 桌面版】
ubuntu·docker·容器
前端世界5 小时前
从零搭建多子网 DHCP 服务:CentOS 双网卡多作用域实战与原理解析
linux·运维·centos
头发那是一根不剩了5 小时前
Docker Desktop 安装教程和最佳实践
运维·docker·容器
路由侠内网穿透.6 小时前
本地部署轻量级持续集成工具 Drone CI 并实现外部访问
运维·服务器·ci/cd·远程工作
tianyuanwo7 小时前
K8s Dashboard运维技巧全面经验总结
linux·运维·kubernetes
无敌的牛7 小时前
Linux操作系统
linux·运维·服务器
顾小玙8 小时前
Linux : 进程概念
linux