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
相关推荐
付宇轩24 分钟前
进程的重要函数
linux·数据库
芊言芊语1 小时前
CentOS详细解析及其配置方法
linux
杨~friendship1 小时前
Ubuntu上使用qt和opencv显示图像
linux·开发语言·c++·qt·opencv·ubuntu
镭速2 小时前
远程跨境传输大文件如何做到安全又稳定?
运维·服务器·安全
laizhenghua2 小时前
Linux定时启动jar应用shell脚本分享
linux
Flying_Fish_roe2 小时前
linux-安全管理-SSH 安全管理
linux·安全·ssh
没有名字的小羊2 小时前
fastjson漏洞
运维·网络·web安全·中间件
成都古河云3 小时前
智慧园区:解析集成运维的未来之路
大数据·运维·人工智能·科技·5g·安全
ZH_qaq3 小时前
Linux 常用指令
linux·运维·服务器
码哝小鱼3 小时前
Openssl升级
linux·运维·服务器