首页 > 系统相关 >Ubuntu系统安装后初始化操作

Ubuntu系统安装后初始化操作

时间:2023-01-12 11:11:57浏览次数:36  
标签:初始化 sshd config 192.168 etc ssh Ubuntu 安装 swap

目录


1. ubuntu20.04

关闭防火墙

sudo ufw disable
sudo ufw status

关闭swap

swapoff -a
sed -i ‘/ swap / s/^(.*)$/#\1/g’ /etc/fstab

修改网卡文件

### vi /etc/netplan/01-network-manager-all.yaml
# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
  ethernets:
    ens33:
      dhcp4: no
      dhcp6: no
      addresses: [192.168.10.43/24]
	  optional: true
	  gateway: 192.168.10.2
	  nameservers:
	    addresses: [192.168.10.2],[114.114.114.114],[8.8.8.8]

### netplan apply

修改国内源


apt update
apt upgrade
apt -y install net-tools openssh-server vim

允许root ssh远程登录

# cp /etc/ssh/sshd_config /etc/ssh/ssh_config_backup
# vim /etc/ssh/sshd_config    #允许root远程登录
PermitRootLogin yes

# systemctl restart sshd

2. ubuntu18.04

3. ubuntu22.04

标签:初始化,sshd,config,192.168,etc,ssh,Ubuntu,安装,swap
From: https://www.cnblogs.com/shenyuanhaojie/p/17045579.html

相关文章