记录个人生活
首页
  • 分类
  • 标签
  • 归档

Canson

首页
  • 分类
  • 标签
  • 归档
  • ubuntu 设置系统语言
  • ubuntu 修改默认 ssh 端口
  • ubuntu 配置定时任务
  • ubuntu系统根目录下各个目录用途说明
  • Linux
Canson
2022-08-05

ubuntu 修改默认 ssh 端口

编辑配置文件 /etc/ssh/sshd_config (注意是 sshd_config,不是 ssh_config)

删除 Port 前面的 #,并修改成新的端口号

注意

确保防火墙已经开放了新端口

Port 2222
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
1
2
3
4

重启 ssh 服务 (注意是 sshd 不是 ssh)

注意

重启服务后,不要关闭当前的终端。新开一个终端,尝试使用新端口连接,如果无法正常连接,还可以通过原先的终端恢复原样。

sudo service sshd restart
1
#ubuntu
上次更新: 2022/08/05, 14:18:19
ubuntu 设置系统语言
ubuntu 配置定时任务

← ubuntu 设置系统语言 ubuntu 配置定时任务→

最近更新
01
为 docker pull 设置代理
02-05
02
ubuntu 开启bbr
11-04
03
整合管理过程ITO
10-23
更多文章>
Theme by Vdoing | Copyright © 2019-2025 Canson | 粤ICP备19120614号
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式