1.6 KiB
1.6 KiB
title, type, tags, date
| title | type | tags | date | |||
|---|---|---|---|---|---|---|
| Ubuntu 24.04 启动 SSH 服务 | source |
|
2026-04-16 |
Source File
Summary
- 核心主题:在 Ubuntu 24.04 中启用 SSH 远程登录服务
- 问题域:Linux 系统管理、网络服务配置
- 方法/机制:安装 openssh-server、配置 systemctl、设置 UFW 防火墙规则
- 结论/价值:实现安全的远程 Linux 系统管理访问
Key Claims
- Ubuntu 24.04 默认使用 ssh.socket 激活机制(按需启动),而非传统开机自启模式
- 通过
systemctl enable ssh可设置 SSH 开机自启 - 修改自定义端口推荐使用
systemctl edit ssh.socket而非直接修改配置文件
Key Quotes
"如果你发现
systemctl status ssh显示服务未运行,别担心。24.04 默认使用 Socket 激活模式。" — 文档说明 socket 激活是正常行为
"你可以通过
sudo systemctl disable --now ssh.socket和sudo systemctl enable --now ssh.service切换回传统模式。" — 文档提供回退方案
Key Concepts
- Socket Activation:按需启动服务的 systemd 机制,有连接进入时才启动守护进程
- SSH:安全远程登录协议
- UFW:Ubuntu 默认防火墙工具
Key Entities
Connections
Contradictions
- (无)