修改 ssh 端口

noteId: C4F213082B424217994C5C7690AEABE0 · 原始路径:/ALL/网络 - C模块/修改 ssh 端口.note

1、修改 ssh 端口号为 2222:

ip ssh port 2222 rotary 1line vty 0 15rotary 1exit# 此时,ssh原本的 22 号端口会和 2222 端口一起启用,如果想要禁用原本的 22 端口,则可以使用 acl 进行拒绝

2、限制 22 端口访问(只允许 2222 端口):

access-list 100 permit tcp any any eq 2222 //使用扩展 ACL# 默认会有一台 deny any anyline vty 0 15access-class 100 in //应用 ACL