2024-09-19 11:00 / 技术分享 VMware 安装 Ubuntu Server 22.04 ### 下载 ISO 镜像 [ubuntu-22.04.5-live-server-amd64.iso](https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04.5/ubuntu-22.04.5-live-server-amd64.iso) ### 安装 ### 新增普通用户 用户名:`test`(生产环境为了安全请设置复杂些) 密码:`test123456`(生产环境为了安全请设置复杂些) ### 启用 root 用户 系统安装完成并重启后,先用 test 用户登录,登录后执行以下命令启用 root 用户 ```shell # 给 root 设置密码即启用 root 用户 sudo passwd root # 切换成 root 用户 su - root ``` ### 安装 SSH Server ``` # 安装 SSH Server sudo apt install openssh-server # 启用服务 sudo systemctl enable ssh # 查看状态 sudo systemctl status ssh # 重启 SSH sudo systemctl restart ssh ``` ### 其它 以下代码按需执行 ```shell # 更新源或包 sudo apt update && apt upgrade # 禁用 root 用户 sudo passwd -l root # 禁用 test 用户 sudo passwd -l test # 新增用户 adduser exampleUser # 给新用户设置密码 sudo passwd exampleUser # 必要工具 sudo apt install vim sudo apt install net-tools # 启用 root 用户 ssh 密码登录 sudo vim /etc/ssh/sshd_config 找到 #PermitRootLogin prohibit-password 改为 PermitRootLogin yes # 重启 SSH sudo systemctl restart ssh ``` ### 参考资料 [ 清华大学开源软件镜像站](https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04.5/)
发表评论 取消回复