ESXi服务器修改远程端口教程

发布时间 - 2023-03-14 09:38:13

ESXi本身可以看做一个操作系统,采用Linux内核,可直接安装在物理服务器上,不需安装其他操作系统。目前香港服务器美国服务器等物理服务器提供ESXi系统支持,您可在下单时选择该系统。ESXi服务器开通后,您可根据实际需要修改默认远程端口。下面一起来看下ESXi服务器修改远程端口的操作步骤介绍。

1、首先使用SSH工具登录到ESXi服务器(如基于ESXi系统的香港服务器),然后修改SSH配置文件。

vi /etc/ssh/sshd_config

ESXi服务器修改远程端口

2、复制并修改应用的端口配置文件。

cp /etc/services /vmfs/volumes/datastore1/

vi /vmfs/volumes/datastore1/services

ESXi服务器修改远程端口

3、编写防火墙策略(例:62008端口)。

vi /vmfs/volumes/datastore1/ssh.xml

文件增加以下内容:

<ConfigRoot>

<service>

<id>SSH 62008</id>

<rule id = ‘0000’>

<direction>inbound</direction>

<protocol>tcp</protocol>

<porttype>dst</porttype>

<port>62008</port>

</rule>

<enabled>true</enabled>

<required>false</required>

</service>

</ConfigRoot>

4. 编写脚本,以便重启时防火墙生效。

vi /etc/rc.local.d/local.sh

======================================

#!/bin/sh # local configuration options

# Note: modify at your own risk! If you do/use anything in this

# script that is not part of a stable API (relying on files to be in

# specific places, specific tools, specific output, etc) there is a

# possibility you will end up with a broken system after patching or

# upgrading. Changes are not supported unless under direction of

# VMware support.

cp /vmfs/volumes/datastore1/ssh.xml /etc/vmware/firewall/

esxcli network firewall refresh

chmod 666 /etc/services

rm -f /etc/services

cp /vmfs/volumes/datastore1/services /etc/services

kill -HUP `cat /var/run/inetd.pid`

exit 0

5、最后,重启ESXi服务器测试。

以上是ESXi服务器修改远程端口的主要操作步骤介绍,如果您开通的是ESXi服务器,那么可参考上述步骤来修改远程端口,并使用新的端口登录。


在线咨询
联系方式
微信二维码
线