Last update at :2024-06-02,Edit by888u
Due to our man-made or natural problems, the server SSH port may be blocked. We also often see problems with VPS hosts that cannot connect to SSH. This is caused by server failure or the SSH port is blocked. So how to check whether the SSH port is blocked? Here we use a few simple methods to check and troubleshoot. If it is indeed the case, we can solve the problem by changing the SSH port.
1. Port scanning check
Tool address: http://tool.chinaz.com/port/
Here we enter the IP address of the VPS and the port number you want to check, such as the port number of the SSH service and the port number used by SSR. Different port numbers are separated by commas. Then look at the scan results. If it is connected, the display is turned on. If it is blocked, it will be displayed as closed.
2. TcPing gadget
Note that Tcping is different from ping directly in the command prompt tool of win system. Ping cannot monitor the status of the port, and it is invalid to use ping to detect whether the IP port of the VPS is blocked; while Tcping works through the tcp port and can monitor the status of a certain port, and can accurately determine whether the port on a certain IP blocked. Search tcping on Baidu, and then you can download it from the author's project homepage, or you can download it from the download station in mainland China. Note that the system is 32-bit and 64-bit, and download the corresponding version. Generally, the 32-bit name is tcping.exe, and the 64-bit name is tcping64.exe.
Usage: Taking the win7 64-bit system as an example, copy and paste the tcping64.exe executable file into the c:\windows\system32 directory, and then use the command directly in the windows command prompt to query the port status. Command format: tcping64 IPaddress Port# (if it is 32-bit, there is no need to enter 64)
For example: tcping64 1.2.3.4 12345
The port number is generally the SSH port, as well as the port of the proxy Internet tool you need to check. If the port number is not written, the default query is port 80.
3. How to change the SSH port
If the SSH port is indeed blocked, then we need to modify it. We cannot open SSH, so how to log in?
How to enter the KiwiVM backend? I won't go into detail about this basic operation. Then click “Root shell – interactive” and then click “Launch” to enter.
An interface pops up and we need to log in. The username is root and the password is your own password. It is difficult to copy, so you can only enter it yourself. After logging in, enter the following command:
vim /etc/ssh/sshd_config
If the prompt command does not exist, install vim:
Ubuntu/Debian:
apt install -y vim
CentOS:
yum -y install vim
You can see that we have opened the SSH configuration file, scroll to the end, and see the following "Port". Just change it to the port you want. Note that the port range is 1 – 65535. It is best to set one A relatively large number. How to modify? First press "i" to enter insert mode, and then you can make changes. How to save after making changes? First press Esc, then press ":wq" and press Enter. (If you still can't see the port after pulling it down, we first enter "i" to enter the insert mode, and then press and hold the downward "↓" on the keyboard to find the port)
After saving, restart the SSH service.
systemctl restart sshd
In this way, we can solve the SSH port replacement problem.
At present, the following solutions are mainly recommended.
Coupon code: BWH3HYATVBJW
Purchase tutorial: The latest bricklayer purchase tutorial and Alipay payment tutorial
Plan | Memory | CPU | Hard disk | Traffic/month | Bandwidth | Computer room | Price | Buy |
---|---|---|---|---|---|---|---|---|
CN2 (cheapest) |
1GB | 1 core | 20GB | 1TB | 1Gbps | DC3 CN2 DC8 ZNET |
$49.99/year | Buy |
CN2 | 2GB | 1 core | 40GB | 2TB | 1Gbps | $52.99/half a year $99.99/year |
Buy | |
CN2 GIA-E (Most recommended) |
1GB | 2 cores | 20GB | 1TB | 2.5Gbps | DC6 CN2 GIA-E DC9 CN2 GIA Japan Softbank JPOS_1 Netherlands EUNL_9 |
$49.99/quarter $169.99/year |
Buy |
CN2 GIA-E | 2GB | 3 core | 40GB | 2TB | 2.5Gbps | $89.99/quarter $299.99/year |
Buy | |
HK | 2GB | 2 cores | 40GB | 0.5TB | 1Gbps | Hong Kong, China CN2 GIA | $89.99/month $899.99/year |
Buy |
HK | 4GB | 4 core | 80GB | 1TB | 1Gbps | $155.99/month $1559.99/year |
Buy | |
TOKYO | 2GB | 2 cores | 40GB | 0.5TB | 1.2Gbps | Tokyo, Japan CN2 GIA | $89.99/month $899.99/year |
Buy |
TOKYO | 4GB | 4 core | 80GB | 1TB | 1.2Gbps | $155.99/month $1559.99/year |
Buy | |
Bricklayer Discount Code: BWH3HYATVBJW | Tutorial on purchasing bricklayers: "The latest tutorial on purchasing bricklayers and Alipay payment tutorials" |
Recommended site search: IP address search, Hong Kong server, one-yuan domain name, Hong Kong server, mainland China vps host registration-free space, free asp space, mainland China space, free ip proxy, Hong Kong server rental,
发表评论