这里记录ubuntu22.04一些基本操作配置,方便后续配置时查看使用
首先我们安装openssh和允许root账户登录系统
sudo apt update
sudo apt install openssh-server
配置可以使用root登录
vi /etc/ssh/sshd_config
PermitRootLogin yes #PermitRootLogin对应的值改为yes
接着我们给root账户设置下密码即可
sudo -s
输入密码后使用passwd root进行修改密码
passwd root
输入密码以后,重启sshd服务
systemctl restart sshd
配置静态IP方法如下:
sudo vi /etc/netplan/50-cloud-init.yaml
network:
ethernets:
eth0:
dhcp4: no
addresses: [192.168.0.180/24]
gateway4: 192.168.0.1
nameservers:
addresses: [114.114.114.114, 8.8.8.8]
version: 2
退出编辑状态下,然后保存配置到系统即可,注意:如果保存以后重启以后配置的静态IP失效了,就去
cat /etc/cloud/cloud.cfg.d/目录下配置90-installer-network.cfg这个文件,不同版本的可能稍微有一点区别,可以分别看看这个目录下的文件。
suod netplan apply
然后使用ifconfig命令进行查看当前配置的静态是否已经生效,ifconfig如果执行不了需要进行安装
apt install net-tools
更换apt源的方法如下,下面是替换的清华源或者是阿里源,注意ubuntu22.04版本代号为jammy
sudo vi /etc/apt/sources.list
#清华源
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
#阿里源
deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
上述两种源,可以选择复制进去一种然后保存退出,更新源码包列表
sudo apt update
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:https://sulao.cn/post/781
相关推荐
- ubuntu22.04编译安装hwloc/libevent/ucx/openpmix/openmpi
- ubuntu安装openvpn并配置连接
- ubuntu22.04使用gpu-burn进行gpu显卡测试
- ubuntu24.04使用deepin-wine安装企业微信
- ubuntu在线安装mysql8无法使用账户密码登陆的问题
- ubuntu22.04编译安装mysql8
- ubuntu22.04编译安装nginx
- ubuntu22.04撰写定时重启和开机启动执行指定脚本
- ubuntu22.04安装nvidia-container-runtime
- ubuntu22.04离线安装containerd和crictl管理工具
评论列表