Files
nexus/wiki/sources/ubuntu-24.04-enable-ssh.md
2026-04-16 21:08:55 +08:00

1.6 KiB
Raw Blame History

title, type, tags, date
title type tags date
Ubuntu 24.04 启动 SSH 服务 source
ssh
ubuntu
linux
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.socketsudo systemctl enable --now ssh.service 切换回传统模式。" — 文档提供回退方案

Key Concepts

  • Socket Activation:按需启动服务的 systemd 机制,有连接进入时才启动守护进程
  • SSH:安全远程登录协议
  • UFWUbuntu 默认防火墙工具

Key Entities

  • OpenSSH:开源 SSH 协议实现
  • Ubuntu:基于 Debian 的 Linux 发行版
  • systemdLinux 系统和服务管理器

Connections

Contradictions

  • (无)