首页 > 编程知识 正文

ssh指定端口号,tomcat端口号如何修改

时间:2023-05-05 19:35:52 阅读:162479 作者:4711

ssh更改端口号

shisthedefaultprotocolusedtomanageremotesystemswhicharemainlylinuxandnetworkingoveranetworkconnectionandused mberwhichis22.inthistutorial,wewillookathowtochangethedefaultportnumberfromtheclientandserverpoinnt

ssh是主要用于管理Linux和网络设备远程系统的默认协议。 由于它通过网络连接运行并使用TCP,因此默认端口号为22。 本教程将从客户端和服务器的角度探讨如何更改缺省端口号。

SSH服务器端口配置(list ssh server port configuration/etc/shfolderwithanamesshd _ config.thisconfigurationfileprovidesalotofconfigurationparameters.wecanprintthecurrentportconfigurtconfigugurattconfiguloresttttionfigulonfiguloresco

Linux ssh服务器配置保存在sshd_config /etc/ssh文件夹中。 此配置文件具有许多配置参数。 可以使用以下命令打印当前端口的配置,即grepping Port文本:

$ cat/etc/ssh/sshd _ config|grepportssh服务器端口配置更改inordertochangeportconfiguration

要更改端口配置,只需从上一步所示的配置行的开头删除#。 所以

# port 22 willchangetothebelowwherenumberistheportnumberwewant。

改为: 其中,number是我们想要的端口号。

端口2222 andweneedtorestartthesshserviceinordertoaffectchanges。

此外,还必须重新启动ssh服务以影响更改。

$sudosystemctlrestartsshssh客户端端口配置更改(changesshclientportconfiguration ) )。 nowwehavechangessshportoftheserverbuthowcanwespecifydifferentportthan 22 insshclient.weusealinuxsshclientwhichusesport 22 ASD efasd dertospecifytheportnumberwewanttoconnect.in this example,wewillconnecttotheportnumber 222。

虽然在此更改了服务器的ssh端口,但ssh客户端如何指定与22个端口不同的端口? 正在使用Linux ssh客户端。 此客户端默认使用端口22。 使用-p选项指定要连接的端口号。 在本例中,连接到端口号2222。

$ ssh-p 2222192.168.1.1.ucfd 124 abb 76772 bec 1c9ceab 4c 7330 b 1, ucfd 124 abb 76772 bec 1c9ceab 4c 7330 b1. post imageurl, uce }.ucfd 124 abb 76772 bec 1c9ceab 4c 7330 b 1、 ucfd 124 abb 76772 bec 1c9ceab 4c 7330 b 1: hover、 ucfd 124 abb 76772 bec 1c9ceab 473330 b

ortant; } .ucfd124abb76772bec1c9ceab4c7330b1 .clearfix:after { content: ""; display: table; clear: both; } .ucfd124abb76772bec1c9ceab4c7330b1 { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .ucfd124abb76772bec1c9ceab4c7330b1:active , .ucfd124abb76772bec1c9ceab4c7330b1:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .ucfd124abb76772bec1c9ceab4c7330b1 .centered-text-area { width: 100%; position: relative; } .ucfd124abb76772bec1c9ceab4c7330b1 .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .ucfd124abb76772bec1c9ceab4c7330b1 .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .ucfd124abb76772bec1c9ceab4c7330b1 .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .ucfd124abb76772bec1c9ceab4c7330b1:hover .ctaButton { background-color: #E67E22!important; } .ucfd124abb76772bec1c9ceab4c7330b1 .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .ucfd124abb76772bec1c9ceab4c7330b1 .ucfd124abb76772bec1c9ceab4c7330b1-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .ucfd124abb76772bec1c9ceab4c7330b1:after { content: ""; display: block; clear: both; } LEARN MORE  Linux SCP Command Usage With Examples .ucfd124abb76772bec1c9ceab4c7330b1 , .ucfd124abb76772bec1c9ceab4c7330b1 .postImageUrl , .ucfd124abb76772bec1c9ceab4c7330b1 .centered-text-area { min-height: 80px; position: relative; } .ucfd124abb76772bec1c9ceab4c7330b1 , .ucfd124abb76772bec1c9ceab4c7330b1:hover , .ucfd124abb76772bec1c9ceab4c7330b1:visited , .ucfd124abb76772bec1c9ceab4c7330b1:active { border:0!important; } .ucfd124abb76772bec1c9ceab4c7330b1 .clearfix:after { content: ""; display: table; clear: both; } .ucfd124abb76772bec1c9ceab4c7330b1 { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .ucfd124abb76772bec1c9ceab4c7330b1:active , .ucfd124abb76772bec1c9ceab4c7330b1:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .ucfd124abb76772bec1c9ceab4c7330b1 .centered-text-area { width: 100%; position: relative; } .ucfd124abb76772bec1c9ceab4c7330b1 .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .ucfd124abb76772bec1c9ceab4c7330b1 .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .ucfd124abb76772bec1c9ceab4c7330b1 .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .ucfd124abb76772bec1c9ceab4c7330b1:hover .ctaButton { background-color: #E67E22!important; } .ucfd124abb76772bec1c9ceab4c7330b1 .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .ucfd124abb76772bec1c9ceab4c7330b1 .ucfd124abb76772bec1c9ceab4c7330b1-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .ucfd124abb76772bec1c9ceab4c7330b1:after { content: ""; display: block; clear: both; } 通过示例了解更多Linux SCP命令用法

翻译自: https://www.poftut.com/how-to-find-and-change-ssh-port-number/

ssh修改端口号

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。