我是靠谱客的博主 爱笑灯泡,最近开发中收集的这篇文章主要介绍linux 修改ssh默认端口,修改ssh默认端口号,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

修改的是 /etc/ssh/sshd_config 文件

[root@linux ~]# vi /etc/ssh/sshd_config

#       $OpenBSD: sshd_config,v 1.69 2004/05/23 23:59:53 dtucker Exp $

# This is the sshd server system-wide configuration file. See

# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin

# The strategy used for options in the default sshd_config shipped with

# OpenSSH is to specify options with their default value where

# possible, but leave them commented. Uncommented options change a

# default value.

Port 8284      //以前这个前面是有 # 号的,而且默认是 22 ,修改一下就ok了

#Protocol 2,1

#ListenAddress 0.0.0.0

#ListenAddress ::

# HostKey for protocol version 1

#HostKey /etc/ssh/ssh_host_key

# HostKeys for protocol version 2

#HostKey /etc/ssh/ssh_host_rsa_key

#HostKey /etc/ssh/ssh_host_dsa_key

重起ssh服务,修改端口才生效

[root@linux ~]# /etc/init.d/sshd restart

Stopping sshd:                                             [ OK ]

Starting sshd:                                             [ OK ]

[root@linux ~]#

为了检验是否正确,可以使用 netstat -an 命令查看一下。

最后

以上就是爱笑灯泡为你收集整理的linux 修改ssh默认端口,修改ssh默认端口号的全部内容,希望文章能够帮你解决linux 修改ssh默认端口,修改ssh默认端口号所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(61)

评论列表共有 0 条评论

立即
投稿
返回
顶部