0


Ubuntu24.04-server的安装与初始化

一、创建虚拟机

1.1 新建虚拟机
            1)选择典型安装

            2)稍后安装操作系统

            3)客户机操作系统选择[Linux],版本选择[Ubuntu 64位]

            4)修改一个好听的虚拟机名称,将虚拟机存储在非C盘的任意地方

            5)指定磁盘容量,默认即可

            6)自定义硬件,新 CD/DVD指定为 /[存储的位置]/Ubuntu24.04

            7)完成
1.2 配置安装Ubuntu24.04
1) 安装Ubuntu Server
2)选择语言

3)选择键盘布局
4)选择安装配置
5)配置网络

6)配置代理服务

7)验证镜像

8)配置磁盘

9)配置用户
10)是否启用 Ubuntu pro

11)配置SSH远程连接

12)安装额外服务
13)确认安装并重启

1.3 配置Ubuntu24.04
1)测试ssh连接

ubuntu@ubuntu:~$ ip a | grep inet | grep ens33
inet 10.0.0.100/24 brd 10.0.0.255 scope global ens33

测试连接 : ssh ubuntu@10.0.0.100

2)启用root账户

ubuntu@ubuntu:~$ sudo passwd root
New password: [新的root密码]
Retype new password: [确认root密码]
passwd: password updated successfully 成功

使ssh可以通过root用户连接

ubuntu@ubuntu:~$ sudo sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config

#sudo reboot重启,使用root用户登录

ssh root@10.0.0.100

root@ubuntu:~#

3)更换仓库源

#备份仓库源

root@ubuntu:~# cp /etc/apt/sources.list.d/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources.bak

修改仓库源为清华源

root@ubuntu:~# cat > /etc/apt/sources.list.d/ubuntu.sources << EOF

Types: deb
URIs: http://mirrors.tuna.tsinghua.edu.cn/ubuntu/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
EOF

#查看

root@ubuntu:~# cat /etc/apt/sources.list.d/ubuntu.sources
Types: deb
URIs: http://mirrors.tuna.tsinghua.edu.cn/ubuntu/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

更新缓存

apt-get update

更新

apt-get upgrade

测试

root@ubuntu:~# apt install apache2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
apache2-bin apache2-data apache2-utils libapr1t64 libaprutil1-dbd-sqlite3 libaprutil1-ldap libaprutil1t64
liblua5.4-0 ssl-cert
Suggested packages:
apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser
The following NEW packages will be installed:
apache2 apache2-bin apache2-data apache2-utils libapr1t64 libaprutil1-dbd-sqlite3 libaprutil1-ldap libaprutil1t64
liblua5.4-0 ssl-cert
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,083 kB of archives.
After this operation, 8,094 kB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.

至此,Ubuntu24.04安装完成

标签: linux 运维 服务器

本文转载自: https://blog.csdn.net/m0_74253886/article/details/140289642
版权归原作者 牛逼哄哄而又唯唯诺诺的 所有, 如有侵权,请联系我们删除。

“Ubuntu24.04-server的安装与初始化”的评论:

还没有评论